rashadphz / farfalle

🔍 AI search engine - self-host with local or cloud LLMs
https://www.farfalle.dev/
Apache License 2.0
2.77k stars 246 forks source link

Can I use Cohere API? #76

Open Dexterity104 opened 4 months ago

Dexterity104 commented 4 months ago

I want to use Cohere but farfalle doesn't support it yet. So I tried to use it, but the following error occurs. It seems that the usage of Tool is different in Cohere. How to solve this problem?

{ "tools": [ { "type": "function", "function": { "name": "QueryPlan", "description": "Correctly extracted QueryPlan with all the required parameters with correct types", "parameters": { "$defs": { "QueryPlanStep": { "properties": { "id": { "description": "Unique id of the step", "title": "Id", "type": "integer" }, "step": { "title": "Step", "type": "string" }, "dependencies": { "description": "List of step ids that this step depends on information from", "items": { "type": "integer" }, "title": "Dependencies", "type": "array" } }, "required": ["id", "step"], "title": "QueryPlanStep", "type": "object" } }, "properties": { "steps": { "description": "The steps to complete the query", "items": { "$ref": "#/$defs/QueryPlanStep" }, "maxItems": 4, "title": "Steps", "type": "array" } }, "required": ["steps"], "type": "object" } } } ], "tool_choice": { "type": "function", "function": { "name": "QueryPlan" } }}