feat: integrated with artifacts in states

This commit is contained in:
Henry Li
2026-01-17 17:21:37 +08:00
parent ab65ab3af2
commit 9a3f72869c
8 changed files with 118 additions and 70 deletions

View File

@@ -1,3 +1,5 @@
import type { AgentThread } from "../threads";
export function urlOfArtifact({
filepath,
threadId,
@@ -9,3 +11,7 @@ export function urlOfArtifact({
}) {
return `http://localhost:8000/api/threads/${threadId}/artifacts${filepath}${download ? "?download=true" : ""}`;
}
export function extractArtifactsFromThread(thread: AgentThread) {
return thread.values.artifacts ?? [];
}