agentsea / robbie-g2

MIT License
93 stars 13 forks source link

How to Change LLM from GPT-4o to GPT-4o-min or GPT-3.5-turbo #5

Closed charlyguz closed 1 month ago

charlyguz commented 1 month ago

Hello,

I am trying to change the LLM from GPT-4o to GPT-4o-min or GPT-3.5-turbo. When I run the command to create an agent, I encounter an issue where the provided API key is not valid for GPT-4o.

Here is the command I used:

surfkit create agent -t robbie/RobbieG2 -n agent01

Terminal Output:

/home/test2/Documentos/test-agent/env/lib/python3.12/site-packages/paramiko/pkey.py:100: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/test2/Documentos/test-agent/env/lib/python3.12/site-packages/paramiko/transport.py:259: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  "class": algorithms.TripleDES,
This agent requires one of the following LLM API keys:
- OPENAI_API_KEY

Would you like to enter an API key for 'gpt-4o' [y/N]: y
OPENAI_API_KEY: ....
The API Key is not valid for 'gpt-4o'. Please try again.
Would you like to enter an API key for 'gpt-4o' [y/N]: n

Traceback (most recent call last):
  File "/home/test2/Documentos/test-agent/env/lib/python3.12/site-packages/surfkit/cli/main.py", line 482, in create_agent
    name = instance_name(agent_type)
    env_vars = find_envs(agent_type, use_local=local_keys)
  File "/home/test2/Documentos/test-agent/env/lib/python3.12/site-packages/surfkit/env_opts.py", line 113, in find_llm_keys
    raise ValueError("No valid API keys given for any of the llm providers in the agent type")
ValueError: No valid API keys given for any of the llm providers in the agent type

Steps to Reproduce:

  1. Run the command surfkit create agent -t robbie/RobbieG2 -n agent01.

Question:

How can I change the LLM from GPT-4o to GPT-4o-min or GPT-3.5-turbo to use a different model? Is there a configuration file or a specific parameter I need to modify to achieve this?

krisztian-imre commented 1 month ago

Hello Charly,

User API keys have been replaced by project API keys recently. Find corresponding information here: https://platform.openai.com/api-keys And here: https://help.openai.com/en/articles/9186755-managing-your-work-in-the-api-platform-with-projects

Hope this works for you.

mariyadavydova commented 1 month ago

@pbarker Can you please look into this?

pbarker commented 1 month ago

Hey @charlyguz the LLM preference can be configured here https://github.com/agentsea/robbie-g2/blob/main/agent.yaml#L21

The available values are here https://github.com/agentsea/mllm/blob/main/mllm/router.py#L40, I just opened a PR to add gpt-4o-mini in https://github.com/agentsea/robbie-g2/pull/6

Let me know if you have any questions!

mariyadavydova commented 1 month ago

Hey @charlyguz the PR is merged. Please pull the latest version of Robbie and run poetry install to grab the updated dependencies.