(page: Page)
| 243 | * Get tool call names from the last assistant message |
| 244 | */ |
| 245 | export async function getToolCallNames(page: Page): Promise<string[]> { |
| 246 | const messages = await getMessages(page) |
| 247 | for (let i = messages.length - 1; i >= 0; i--) { |
| 248 | if (messages[i].role === 'assistant') { |
| 249 | const toolCalls = messages[i].parts?.filter( |
| 250 | (p: any) => p.type === 'tool-call', |
| 251 | ) |
| 252 | return toolCalls?.map((tc: any) => tc.name) || [] |
| 253 | } |
| 254 | } |
| 255 | return [] |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Options for summarization API call |
no test coverage detected