Agent-S icon indicating copy to clipboard operation
Agent-S copied to clipboard

OPENAI_API_KEY is still required when not in use

Open DaWe35 opened this issue 7 months ago • 2 comments

Not a big deal, but I noticed OPENAI_API_KEY and ANTHROPIC_API_KEY is always required, even if I use a different provider.

ValueError: An API Key needs to be provided in either the api_key parameter or as an environment variable named OPENAI_API_KEY

export OPENROUTER_API_KEY=...
export OPEN_ROUTER_ENDPOINT_URL="https://openrouter.ai/api/v1"

./bin/python ./gui_agents/s2/cli_app.py \
  --provider "open_router" \
  --model "anthropic/claude-3.7-sonnet" \
  --grounding_model_provider "open_router" \
  --grounding_model "anthropic/claude-3.7-sonnet"
Traceback (most recent call last):
  File "/config/Desktop/Agent-S/./gui_agents/s2/cli_app.py", line 276, in <module>
    main()
  File "/config/Desktop/Agent-S/./gui_agents/s2/cli_app.py", line 253, in main
    agent = AgentS2(
            ^^^^^^^^
  File "/config/Desktop/Agent-S/gui_agents/s2/agents/agent_s.py", line 150, in __init__
    self.reset()
  File "/config/Desktop/Agent-S/gui_agents/s2/agents/agent_s.py", line 155, in reset
    self.planner = Manager(
                   ^^^^^^^^
  File "/config/Desktop/Agent-S/gui_agents/s2/agents/manager.py", line 58, in __init__
    self.knowledge_base = KnowledgeBase(
                          ^^^^^^^^^^^^^^
  File "/config/Desktop/Agent-S/gui_agents/s2/core/knowledge.py", line 34, in __init__
    self.embedding_engine = OpenAIEmbeddingEngine()
                            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/Desktop/Agent-S/gui_agents/s2/core/engine.py", line 32, in __init__
    raise ValueError(
ValueError: An API Key needs to be provided in either the api_key parameter or as an environment variable named OPENAI_API_KEY

DaWe35 avatar May 10 '25 20:05 DaWe35

Hi @DaWe35 , the embedding engine is for the experiential memory. We use the OpenAI as the embedder. Where do you see the ANTHROPIC_API_KEY being required?

alckasoc avatar May 12 '25 22:05 alckasoc

So what should we do, if i want to use gemini, but it is asking for OPEN_API key , if i am giving it i don't have open_api subscription so itsn't working .

ArokyaMatthew avatar May 13 '25 07:05 ArokyaMatthew

I just tested, ANTHROPIC_API_KEY is not required, so I'm closing this issue.

DaWe35 avatar May 23 '25 18:05 DaWe35