* Fixed llm response object (double encoding)
+ added wikitools + Improved webpage reading tool
This commit is contained in:
@@ -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'};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user