sentient-engineering / agent-q

agent q - oss advanced reasoning and learning for autonomous ai agents
MIT License
322 stars 69 forks source link

How to use ollama rather than onlin API? #3

Open JouJman opened 3 weeks ago

JouJman commented 3 weeks ago

Hello, I tried to change self.client fonction on agent-q/core/agent/base.py as: self.client = openai.OpenAI( base_url="http://localhost:11434", api_key="ollama", ) And the model name into qwen2.5:14b

Whene I enter a command I got: `Executing command test

Current State: agentq_base Agent: agentq Current Thought: Plan: none Completed Tasks: none

An error occurred: RetryError[<Future at 0x73858ddb74d0 state=finished raised NotFoundError>] Retrying in 2 seconds... An error occurred: RetryError[<Future at 0x73858ddc1910 state=finished raised NotFoundError>] Retrying in 2 seconds... An error occurred: RetryError[<Future at 0x73858d3039e0 state=finished raised NotFoundError>] Max retries reached. Unable to complete the action. Error executing the command test: RetryError[<Future at 0x73858d3039e0 state=finished raised NotFoundError>]`

How can I solve this?

Hackinside commented 3 weeks ago

It seems like you might be missing /v1 at the end of your URL. Try changing it to http://localhost:11434/v1 to make sure you're accessing the model correctly.

To check if your model is running, open Windows Powershell and type ollama ps. This will show you a list of active models.

In my case, even after adding /v1 to the end of your URL, I'm still encountering the RetryError with a ValidationError. This suggests there might be something else going on.

Error message:

An error occurred: RetryError[<Future at 0x293a74c3d40 state=finished raised ValidationError>]
Retrying in 2 seconds...
An error occurred: RetryError[<Future at 0x293a74d0f20 state=finished raised ValidationError>]
Retrying in 2 seconds...
vaibhavkr-dev commented 2 weeks ago

i am also getting same error with Ollama. Please suggest if there is any support available for ollama to work with this agent-q

homexkai commented 1 week ago

I'm getting the same error when trying to use groq Screenshot 2024-10-14 161244