Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use azure openai #558

Closed
bubbleboth opened this issue Nov 5, 2023 · 3 comments
Closed

can't use azure openai #558

bubbleboth opened this issue Nov 5, 2023 · 3 comments

Comments

@bubbleboth
Copy link

bubbleboth commented Nov 5, 2023

This is my code
import autogen
config_list= config_list= [
{
"model": "gpt-3.5-turbo-16k",
"api_key": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"base_url": "https://xxxxxxx.openai.azure.com/",
"api_type": "azure",
"api_version": "2023-03-15-preview"
}
]

assistant = autogen.AssistantAgent(
name="assistant",
llm_config={
"seed": 42, # seed for caching and reproducibility
"config_list": config_list, # a list of OpenAI API configurations
"temperature": 0, # temperature for sampling
}, # configuration for autogen's enhanced inference API which is compatible with OpenAI API
)

user_proxy = autogen.UserProxyAgent(
name="user_proxy",
human_input_mode="NEVER",
max_consecutive_auto_reply=10,
is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
code_execution_config={
"work_dir": "coding",
"use_docker": False, # set to True or image name like "python:3" to use docker
},
)

user_proxy.initiate_chat(
assistant,
message="""What date is today? Compare the year-to-date gain for META and TESLA.""",
)

and I got error like this , how can I fix it
image

@sonichi
Copy link
Contributor

sonichi commented Nov 5, 2023

#551 fixes a bug which may be related. Could you try that branch?

@bubbleboth
Copy link
Author

@sonichi Thank you, it already worked when I changed to 'pip install pyautogen~=0.2.0b1

@mraguth
Copy link

mraguth commented Dec 2, 2023

Are you using Openai 1 or above? I am still getting the same error.

jackgerrits pushed a commit that referenced this issue Oct 2, 2024
Moves some shared code from samples into core.
complete/cleanup the rename to Microsoft.AutoGen
adds new projects in AutoGen.Extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants