autogen
autogen copied to clipboard
[Bug]: AssertionError: (Deprecated) The autogen.Completion class requires openai<1 and diskcache.
Describe the bug
Code following:
from autogen import oai
response = oai.Completion.create(
config_list=[
{
"model": "chatglm2-6b",
"api_base": "http://0.0.0.0:8000/v1",
"api_type": "open_ai",
"api_key": "NULL", # just a placeholder
}
],
prompt="Hi",
)
print(response)
Got AssertionError: (Deprecated) The autogen.Completion class requires openai<1 and diskcache.
I found this in autogen/oai/completion.py
:
assert openai.__version__ < "1"
Why??? Isn't AutoGen supposed to require openai > 1?
Steps to reproduce
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
autoGen version: pyautogen==0.2.2 Operating System: ubuntu18.04 Python Version: conda env python==3.10 Any other relevant information:
- openai == 1.3.8
- │diskcache == 5.6.3
Same problem here!
@YongLD @yiouyou It's correct that autogen (pyautogen==0.2.2) now requires openai>1, which no longer supports the old Completion API. The autogen.Completion class, though deprecated, is still included in the repo (at least for now) for users who need it, but they must manually install an older version of openai to use it.
How could we improve the error message to make this clearer?
@YongLD @yiouyou It's correct that autogen (pyautogen==0.2.2) now requires openai>1, which no longer supports the old Completion API. The autogen.Completion class, though deprecated, is still included in the repo (at least for now) for users who need it, but they must manually install an older version of openai to use it.
How could we improve the error message to make this clearer?
You should consider how to fix it, rather than asking us to downgrade the version of OpenAI.
To be more clear, if your app requires openai's old completion API, then your only option is to downgrade to the older openai version. If you find a better option, please reopen this issue.
I have the same problem, is this problem solved now?
same problem here :/
I'm gonna try to create another virtual environment. But, I think we gotta solve this problem! 🥲
even though my version is 0.28.1 which is latest before 1.0, I'm getting the same error!
Reopening the issue to understand what is needed here. @YongLD @yiouyou @wpsadmns @Lizidong01 @mertbozkir : What version of pyautogen are you each running?
Where is the solution to this problem? When I downgrade my openai - 0.28.1 pyautogen complains that it needs a > openai.
What is your version of pyautogen? pyautogen>=0.2.2 now requires openai>1. What exactly is the error message?
@YongLD @TaoAthe please read the migration guide: https://microsoft.github.io/autogen/docs/Installation#migration-guide-to-v02. Your old code won't work with the new version of openai because openai makes a breaking change.
Im still getting this error. When I upgrade pyautogen and openai, I get this: AssertionError: (Deprecated) The autogen.Completion class requires openai<1 and diskcache.
When I downgrade openai to 0.28.1, I get this:
autogen/logger/base_logger.py", line 8, in
When I also downgrade pyautogen to 0.1, I get this error (I double checked, I have disk space where im running...) : myenv/lib/python3.10/site-packages/diskcache/core.py", line 2431, in reset ((old_value,),) = sql( sqlite3.OperationalError: disk I/O error
Have you read the migration guide and changed your code?
same here. I think the document hasn't been updated Interact with model using oai.Completion (requires openai<1)
Any plan to update the local LLM documentation?
Any plan to update the local LLM documentation?
Meanwhile, @nise you could follow my tutorial: https://medium.com/@zhanwenchen/local-llm-agents-autogen-and-llama-3-ff6588857b76
@zhanwenchen you my friend, are a messenger of god, tysm
https://microsoft.github.io/autogen/docs/Use-Cases/enhanced_inference/#api-unification
我用这个可以调通azure,和本地部署的openai接口
我用这个可以调通azure,和本地部署的openai接口 太牛了家人!