Download frontend/src/core/artifacts/utils.ts from yonagush/deerflow: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/yonagush/deerflow/resolve/main/frontend/src/core/artifacts/utils.ts
- Command line
-
hf download hf://spaces/yonagush/deerflow/frontend/src/core/artifacts/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/yonagush/deerflow/resolve/main/frontend/src/core/artifacts/utils.ts
633 Bytes
| 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}`; | |
| } | |