Autogen - permanent api request timeouts

Hi, I really want to try out Microsoft’s autogen, therefore I am using the openai API for gpt 3.5 and 4.

I got it to work initially, but now no matter what I try for a few days already I just keep getting the following error and it’s driving me nuts:

openai.error.Timeout: Request timed out: HTTPSConnectionPool(host=‘api.openai.(com)’, port=443): Read timed out. (read timeout=60)

The only possible issue I can think of is that I cancelled my billing plan after I made my first deposit. Though I think this shouldn’t matter as the credit is still active on the usage page. Nonetheless, I have made another deposit such that I have an active billing plan again, but this doesn’t help.

What can I try to solve this?

1 Like

This is my code below, hope it helps, sorry for terrible formatting. The OAI_CONFIG_LIST contains my keys according to other examples on the autogen website.

import autogen

config_list_GPT35 = autogen.config_list_from_json(
env_or_file=“OAI_CONFIG_LIST”, file_location=“.”,
filter_dict={“model”: {“gpt-3.5-turbo-16k”, “gpt-3.5-turbo”}}
llm_settings_GPT35 = {“config_list”: config_list_GPT35, “seed”: 42, “temperature”: 0}

user_proxy = autogen.UserProxyAgent(
system_message = “A human admin.”,
code_execution_config = {“last_n_messages”: 2, “work_dir”: “groupchat”, “use_docker”: False},)

coder = autogen.AssistantAgent(name= “coder”, llm_config=llm_settings_GPT35)
critic = autogen.AssistantAgent(name=“Critic”, llm_config=llm_settings_GPT35, system_message=“”“not relevent for debugging”“”)

groupchat = autogen.GroupChat(agents=[user_proxy, coder, critic], messages=, max_round=12)
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_settings_GPT35)

message=“Simulate the three body problem in 2D in order to create a visually interesting animation.”

1 Like

Welcome to the forum.

Does Playground work for you? Is your billing up to date? Can you cURL to the API at a minimum?

How can I check this? I’m not really an experienced programmer, don’t know what playground and cURL are.

My billing is up to date, also I can see some usage today even though I am not getting responses back.

The OpenAI Playground… do calls work here for you?

The playground seems to be working, I am getting responses to questions there.

Okay, good sign.

You might try creating a new API key and trying the new one in your code. You said it was working previously?

I tried using new keys before, now again. Yes a few days ago with a slightly different program. Also I was using the GPT-4 models initially but due to cost want to use gpt 3.5 now. Let me try to go back to a minimum working example.

1 Like

Ah, okay, you’ve made changes to the code.

Yeah, we’ll need more details to try to help.

1 Like

hmm yeah, the old example still works. That probably means the issue is not with the api but with the use of the autogen functions I’m using. Even though I’m still just copying example code, I guess I have to figure it out over there then.

Sorry, should have tried this first. Thanks for helping me though!

1 Like

Yeah, if it’s from GPT-3.5 or even GPT-4 it might not be accurate. Even human code isn’t always accurate, though, so… :wink:

No problem. As developers, it’s sometimes good to have a place you can go to get a fresh set of eyes on what you’re doing for a new perspective.

Hope you stick around. We’ve got a great community here with a lot of hidden gems, I think. Once you reach Trust Level 3, you get access to AI tools here too!

Good luck tinkering…


What does config_list_GPT35 do in the llm line?

Welcome to the community! To our merry little band of brothers and sisters!!


    "model": "“gpt-3.5-turbo-16k”",
    "api_key": "<my_api_key>"

in my OAI_CONFIG_LIST.json file helped