The only thing i changed is the gemini api key, using one I have generated
I get this error:
Logging session ID: 6b97b3b5-27b7-4f5a-b96d-6e16478fb7f6
Traceback (most recent call last):
File "C:\Users\XXX\workspace\agents\ag-joke.py", line 37, in <module>
gemini = autogen.AssistantAgent(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXX\Anaconda3\envs\autogen\Lib\site-packages\autogen\agentchat\assistant_agent.py", line 62, in __init__
super().__init__(
File "C:\Users\XXX\Anaconda3\envs\autogen\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 154, in __init__
self._validate_llm_config(llm_config)
File "C:\Users\XXX\Anaconda3\envs\autogen\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 258, in _validate_llm_config
self.client = None if self.llm_config is False else OpenAIWrapper(**self.llm_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXX\Anaconda3\envs\autogen\Lib\site-packages\autogen\oai\client.py", line 383, in __init__
self._register_default_client(config, openai_config) # could modify the config
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXX\Anaconda3\envs\autogen\Lib\site-packages\autogen\oai\client.py", line 444, in _register_default_client
log_new_client(client, self, openai_config)
^^^^^^
UnboundLocalError: cannot access local variable 'client' where it is not associated with a value
Steps to reproduce
import os
import ctypes
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
import autogen
logging_session_id = autogen.runtime_logging.start(config={"dbname": "logs2.db"})
print("Logging session ID: " + str(logging_session_id))
config_list = autogen.config_list_from_json(
env_or_file="autogen.json",
filter_dict={
"model": ["gpt-35-turbo-16k"],
},
)
config_list_gemini = autogen.config_list_from_json(
env_or_file="autogen.json",
filter_dict={
"model": ["gemini-1.0-pro-002"],
},
)
seed = 25
gpt = autogen.AssistantAgent(
"GPT-3",
system_message="""You should ask weird, tricky, and concise questions.
Ask the next question based on (by evolving) the previous one.""",
llm_config={"config_list": config_list, "seed": seed},
max_consecutive_auto_reply=3,
)
gemini = autogen.AssistantAgent(
"Gemini-Pro",
system_message="""Always answer questions within one sentence. """,
# system_message="answer:",
llm_config={"config_list": config_list_gemini, "seed": seed},
max_consecutive_auto_reply=4,
)
gpt.initiate_chat(gemini, message="Do Transformers purchase auto insurance or health insurance?")
autogen.runtime_logging.stop()
Describe the bug
I am running this cookbook https://github.com/microsoft/autogen/blob/main/website/docs/topics/non-openai-models/cloud-gemini.ipynb
The only thing i changed is the gemini api key, using one I have generated
I get this error:
Steps to reproduce
Model Used
I tryed
and
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
new anaconda env with python 3.12 and these libs: