(client: ChatClient, toolCallId: string)
| 6 | import type { ConnectConnectionAdapter } from '../src/connection-adapters' |
| 7 | |
| 8 | function findToolCallPart(client: ChatClient, toolCallId: string) { |
| 9 | for (const message of client.getMessages()) { |
| 10 | if (message.role !== 'assistant') { |
| 11 | continue |
| 12 | } |
| 13 | |
| 14 | const part = message.parts.find( |
| 15 | (messagePart) => |
| 16 | messagePart.type === 'tool-call' && messagePart.id === toolCallId, |
| 17 | ) |
| 18 | if (part) { |
| 19 | return part |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return undefined |
| 24 | } |
| 25 | |
| 26 | function findToolResultPart(client: ChatClient, toolCallId: string) { |
| 27 | for (const message of client.getMessages()) { |
no test coverage detected