Download src/agents/test-helpers/sparse-transcript.test-support.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/test-helpers/sparse-transcript.test-support.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/test-helpers/sparse-transcript.test-support.ts
-
curl -L -o sparse-transcript.test-support.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/test-helpers/sparse-transcript.test-support.ts
738 Bytes
| export function sparseAssistant(content: unknown[]) { | |
| return { role: "assistant" as const, content }; | |
| } | |
| export function textToolResult( | |
| toolCallId: string, | |
| toolName: string, | |
| text: string, | |
| fields?: { isError?: boolean }, | |
| ) { | |
| return { | |
| role: "toolResult" as const, | |
| toolCallId, | |
| toolName, | |
| content: [{ type: "text" as const, text }], | |
| ...fields, | |
| }; | |
| } | |
| export function textAssistant(text: string): { | |
| role: "assistant"; | |
| content: { type: "text"; text: string }[]; | |
| } { | |
| return { role: "assistant", content: [{ type: "text", text }] }; | |
| } | |
| export function timestampedTextAssistant(text: string, timestamp: number) { | |
| return { | |
| role: "assistant", | |
| content: [{ type: "text", text }], | |
| timestamp, | |
| }; | |
| } | |