Fix: Adapt Anthropic bot to nested tool function structure

This commit is contained in:
cyclop-bot
2025-06-02 15:50:49 -05:00
parent 3b3e42aa81
commit 5a01fd96c6
+3 -3
View File
@@ -39,9 +39,9 @@ class AnthropicTelegramInferenceBot(BaseTelegramInferenceBot):
if hasattr(self, 'functions') and self.functions: if hasattr(self, 'functions') and self.functions:
anthropic_tools = [ anthropic_tools = [
{ {
"name": function['name'], "name": function['function']['name'],
"description": function['description'], "description": function['function']['description'],
"input_schema": function['parameters'] if function['parameters'] not in [None, {}] else {"type": "object", "properties": {}} "input_schema": function['function']['parameters'] if function['function']['parameters'] not in [None, {}] else {"type": "object", "properties": {}}
} }
for function in self.functions for function in self.functions
] ]