-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Issue]: TypeError: Completions.create() got an unexpected keyword argument 'request_timeout' #1156
Comments
Openai has dropped the completions API (including request_timeout). Do you actually need it? See our migration guide. |
hello my current versions: and this is the code I am using now: Get api keyconfig_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST") Create user proxy agent, coder, product manageruser_proxy = autogen.UserProxyAgent( Create groupchatgroupchat = autogen.GroupChat( Start the conversationuser_proxy.initiate_chat( Can you help me what I need to change in my code according to the new migration? |
What is the version of your openai package? |
@rickyloynd-microsoft multitasking 0.0.11 |
Interesting. Let's try something even simpler. Can you run this sample script? |
@rickyloynd-microsoft |
That's a good sign. What about twoagent.py? |
@rickyloynd-microsoft pip install pandas_datareader matplotlib After that, you can execute the Python script with: python stock_price_plot.py
I got the message after exiting,
```sh
pip install pandas_datareader matplotlib I ran the partition then I ran it again but I got this error; here are the screenshots: then ignored and pressed enter again and it worked? |
What do you mean by "I ran the partition"? I assume that you didn't pip install the requested packages yourself. The user proxy should do that if you hit enter. Anyway, the main difference from twoagent.py is that your code uses GroupChatManager. @afourney probably knows why the completions api is being invoked. |
When I say that I ran that partition, I mean that I ran it myself with pip and the necessary ; pip install pandas_datareader matplotlib I manually ran this code in the terminal and installed it and as far as I understand the code is now working as in the last screenshot I posted. |
And does your original code still hit the error about request_timeout? |
Yes, I still get this error: |
I watched the video from your link, and saw the earlier lines of code that you didn't include here. Specifically, this line introduces request_timeout:
As explained in our migration guide, request_timeout needs to be replaced with timeout instead. See if that helps. |
Thank you very much, I just need to change one line of code, thank you for helping me, it works! |
Describe the issue
Hello, I am trying to make artificial intelligence that develops a 2d game with autogen. I am trying to do it with this linked video "https://youtu.be/Bq-0ClZttc8?si=SREV4voQgOOu6NCd&t=143" that I found on Youtube, I did all the steps, I installed autogen, I installed basic.py as in the video, I performed the chart operations, but when I come to the game section, I get an error even though I get the code exactly.
The error I get is :
Traceback (most recent call last):
File "/Users/ahmetkarsli/Desktop/Autogen Proje/code_agent.py", line 31, in
user_proxy.initiate_chat(
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 562, in initiate_chat
self.send(self.generate_init_message(**context), recipient, silent=silent)
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 360, in send
recipient.receive(message, self, request_reply, silent)
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 493, in receive
reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 968, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/groupchat.py", line 353, in run_chat
speaker = groupchat.select_speaker(speaker, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/groupchat.py", line 197, in select_speaker
final, name = selector.generate_oai_reply(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 637, in generate_oai_reply
response = client.create(
^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/oai/client.py", line 261, in create
response = self._completions_create(client, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/autogen/oai/client.py", line 359, in _completions_create
response = completions.create(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahmetkarsli/Desktop/Autogen Proje/pyautogen/lib/python3.11/site-packages/openai/_utils/_utils.py", line 272, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
TypeError: Completions.create() got an unexpected keyword argument 'request_timeout'
I don't understand where I went wrong, please help me.
Steps to reproduce
No response
Screenshots and logs
Additional Information
Python version: 3.11.5
Operating System: MacOS Sonoma 14.2.1
The text was updated successfully, but these errors were encountered: