autogen

Autogen Studio 2 - api_key is not present in llm_config or OPENAI_API_KEY env variable for agent ** primary_assistant


Running autogen studio 2, I have my model setup and tested successful - when I run the travel demo I get the following error:

api_key is not present in llm_config or OPENAI_API_KEY env variable for agent ** primary_assistant**. Update your workflow to provide an api_key to use the LLM.

I have tested the model successfully and the agent is pointing to the correct model.

enter image description here

enter image description here


Solution

  • I am using a conda environment and was able to resolve the issue by setting my env variable and deactivating / reactivating my environment. I used the command below to set my API key:

    conda env config vars set OPENAI_API_KEY=value

    conda deactivate envName conda activate envName

    Hope this helps!