(
text: string,
timestamp = 2,
extra: Partial<Record<string, unknown>> = {},
)
| 27 | } |
| 28 | |
| 29 | export function assistantMessage( |
| 30 | text: string, |
| 31 | timestamp = 2, |
| 32 | extra: Partial<Record<string, unknown>> = {}, |
| 33 | ): PiMessage { |
| 34 | return { |
| 35 | role: "assistant", |
| 36 | content: [{ type: "text", text }], |
| 37 | api: "test-api", |
| 38 | provider: "test-provider", |
| 39 | model: "test-model", |
| 40 | usage: { |
| 41 | input: 0, |
| 42 | output: 0, |
| 43 | cacheRead: 0, |
| 44 | cacheWrite: 0, |
| 45 | totalTokens: 0, |
| 46 | cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }, |
| 47 | }, |
| 48 | stopReason: "stop", |
| 49 | timestamp, |
| 50 | ...extra, |
| 51 | } as PiMessage; |
| 52 | } |
| 53 | |
| 54 | export function assistantToolCall( |
| 55 | id: string, |
no outgoing calls
no test coverage detected