( message: ChatMessage, contextItems: ContextItemWithId[] = [], toolCallStates?: ToolCallState[], )
| 201 | * Create a ChatHistoryItem from a ChatMessage |
| 202 | */ |
| 203 | export function createHistoryItem( |
| 204 | message: ChatMessage, |
| 205 | contextItems: ContextItemWithId[] = [], |
| 206 | toolCallStates?: ToolCallState[], |
| 207 | ): ChatHistoryItem { |
| 208 | return { |
| 209 | message, |
| 210 | contextItems, |
| 211 | ...(toolCallStates && { toolCallStates }), |
| 212 | }; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Handle tool result message by updating the corresponding tool call state |
no outgoing calls
no test coverage detected