( route: string, tools: State<K>, key: K, text: string, missingToolMessage: string, )
| 144 | * argument delta. |
| 145 | */ |
| 146 | export const appendExisting = <K extends StreamKey>( |
| 147 | route: string, |
| 148 | tools: State<K>, |
| 149 | key: K, |
| 150 | text: string, |
| 151 | missingToolMessage: string, |
| 152 | ): AppendOutcome<K> | LLMError => { |
| 153 | const current = tools[key] |
| 154 | if (!current) return eventError(route, missingToolMessage) |
| 155 | if (text.length === 0) return { tools, tool: current, events: [] } |
| 156 | return appendTool(tools, key, { ...current, input: `${current.input}${text}` }, text) |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Finalize one pending tool call: parse the accumulated raw JSON, remove it |
nothing calls this directly
no test coverage detected