19 lines
469 B
TypeScript
19 lines
469 B
TypeScript
import { getBackendBaseURL } from "../config";
|
|
import type { AgentThread } from "../threads";
|
|
|
|
export function urlOfArtifact({
|
|
filepath,
|
|
threadId,
|
|
download = false,
|
|
}: {
|
|
filepath: string;
|
|
threadId: string;
|
|
download?: boolean;
|
|
}) {
|
|
return `${getBackendBaseURL()}/api/threads/${threadId}/artifacts${filepath}${download ? "?download=true" : ""}`;
|
|
}
|
|
|
|
export function extractArtifactsFromThread(thread: AgentThread) {
|
|
return thread.values.artifacts ?? [];
|
|
}
|