* Fixed llm response object (double encoding)
All checks were successful
Publish Library / Build NPM Project (push) Successful in 25s
Publish Library / Tag Version (push) Successful in 12s

+ added wikitools
+ Improved webpage reading tool
This commit is contained in:
2026-03-29 23:00:40 -04:00
parent d2e711fbf2
commit ee7b85301b
5 changed files with 1064 additions and 355 deletions

View File

@@ -119,7 +119,7 @@ export class Anthropic extends LLMProvider {
if(!tool) return {tool_use_id: toolCall.id, is_error: true, content: 'Tool not found'};
try {
const result = await tool.fn(toolCall.input, options?.stream, this.ai);
return {type: 'tool_result', tool_use_id: toolCall.id, content: JSONSanitize(result)};
return {type: 'tool_result', tool_use_id: toolCall.id, content: typeof result == 'object' ? JSONSanitize(result) : result};
} catch (err: any) {
return {type: 'tool_result', tool_use_id: toolCall.id, is_error: true, content: err?.message || err?.toString() || 'Unknown'};
}