( prompt: string | Array<ContentBlockParam>, )
| 1248 | ] |
| 1249 | |
| 1250 | function promptTextForToolObligation( |
| 1251 | prompt: string | Array<ContentBlockParam>, |
| 1252 | ): string { |
| 1253 | if (typeof prompt === 'string') { |
| 1254 | return prompt |
| 1255 | } |
| 1256 | return prompt |
| 1257 | .map(block => { |
| 1258 | if ( |
| 1259 | block && |
| 1260 | typeof block === 'object' && |
| 1261 | 'type' in block && |
| 1262 | block.type === 'text' && |
| 1263 | 'text' in block && |
| 1264 | typeof block.text === 'string' |
| 1265 | ) { |
| 1266 | return block.text |
| 1267 | } |
| 1268 | return '' |
| 1269 | }) |
| 1270 | .filter(Boolean) |
| 1271 | .join('\n') |
| 1272 | } |
| 1273 | |
| 1274 | function hasActionableTools(tools: Tools): boolean { |
| 1275 | return tools.some(tool => |
no outgoing calls
no test coverage detected