(
tool: { callId: string; name: string; output: unknown },
timestamp: string,
parentId: string | null,
)
| 385 | } |
| 386 | |
| 387 | function makeToolResultEntry( |
| 388 | tool: { callId: string; name: string; output: unknown }, |
| 389 | timestamp: string, |
| 390 | parentId: string | null, |
| 391 | ): PiJson { |
| 392 | return { |
| 393 | type: "message", |
| 394 | id: shortId(), |
| 395 | parentId, |
| 396 | timestamp, |
| 397 | message: { |
| 398 | role: "toolResult", |
| 399 | toolCallId: tool.callId, |
| 400 | toolName: tool.name, |
| 401 | content: [{ type: "text", text: textFromUnknown(tool.output) }], |
| 402 | isError: false, |
| 403 | timestamp: Date.parse(timestamp), |
| 404 | }, |
| 405 | }; |
| 406 | } |
| 407 | |
| 408 | interface ConvertPartContext { |
| 409 | role: "user" | "assistant"; |
no test coverage detected