(
id: string,
name?: string,
args?: string,
)
| 45 | |
| 46 | // Helper to create a tool call chunk |
| 47 | function toolCallChunk( |
| 48 | id: string, |
| 49 | name?: string, |
| 50 | args?: string, |
| 51 | ): ChatCompletionChunk { |
| 52 | return { |
| 53 | id: "test", |
| 54 | object: "chat.completion.chunk", |
| 55 | created: Date.now(), |
| 56 | model: "test-model", |
| 57 | choices: [ |
| 58 | { |
| 59 | index: 0, |
| 60 | delta: { |
| 61 | tool_calls: [ |
| 62 | { |
| 63 | index: 0, |
| 64 | id, |
| 65 | type: "function", |
| 66 | function: { |
| 67 | name: name || undefined, |
| 68 | arguments: args || undefined, |
| 69 | }, |
| 70 | }, |
| 71 | ], |
| 72 | }, |
| 73 | finish_reason: null, |
| 74 | }, |
| 75 | ], |
| 76 | }; |
| 77 | } |
| 78 | |
| 79 | // Helper to create a tool call chunk with optional ID |
| 80 | function toolCallChunkWithIndex( |
no outgoing calls
no test coverage detected