mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-05 07:02:13 +08:00
23 lines
633 B
TypeScript
23 lines
633 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 ?? [];
|
|
}
|
|
|
|
export function resolveArtifactURL(absolutePath: string, threadId: string) {
|
|
return `${getBackendBaseURL()}/api/threads/${threadId}/artifacts${absolutePath}`;
|
|
}
|