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

New versions of openai don't work with this AttributeError: module 'openai' has no attribute 'error' #468

Open
sethsource opened this issue Mar 4, 2024 · 1 comment

Comments

@sethsource
Copy link

Is this project abandoned? if not, posting this error that new versions of openai aren't working. Tried from version 1.3 and up. Also tried 0.28 and it works, however openai deprecated it so it creates another error.

Entering new AgentExecutor chain...
Traceback (most recent call last):
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\gradio\routes.py", line 534, in predict
output = await route_utils.call_process_api(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\gradio\route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\gradio\blocks.py", line 1550, in process_api
result = await self.call_function(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\gradio\blocks.py", line 1185, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\gradio\utils.py", line 661, in wrapper
response = f(*args, **kwargs)
File "visual_chatgpt.py", line 1520, in run_text
res = self.agent({"input": text.strip()})
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\base.py", line 168, in call
raise e
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\base.py", line 165, in call
outputs = self._call(inputs)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\agents\agent.py", line 503, in _call
next_step_output = self._take_next_step(
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\agents\agent.py", line 406, in _take_next_step
output = self.agent.plan(intermediate_steps, **inputs)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\agents\agent.py", line 102, in plan
action = self._get_next_action(full_inputs)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\agents\agent.py", line 63, in _get_next_action
full_output = self.llm_chain.predict(**full_inputs)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\llm.py", line 155, in predict
return self(kwargs)[self.output_key]
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\base.py", line 168, in call
raise e
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\base.py", line 165, in call
outputs = self._call(inputs)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\llm.py", line 135, in _call
return self.apply([known_values])[0]
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\llm.py", line 117, in apply
response = self.generate(input_list)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\chains\llm.py", line 59, in generate
response = self.llm.generate(prompts, stop=stop)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\llms\base.py", line 128, in generate
raise e
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\llms\base.py", line 125, in generate
output = self._generate(prompts, stop=stop)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\llms\openai.py", line 274, in _generate
response = completion_with_retry(self, prompt=_prompts, **params)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\llms\openai.py", line 92, in completion_with_retry
retry_decorator = _create_retry_decorator(llm)
File "C:\Users\seth.conda\envs\visgpt\lib\site-packages\langchain\llms\openai.py", line 80, in _create_retry_decorator
retry_if_exception_type(openai.error.Timeout)
AttributeError: module 'openai' has no attribute 'error'

@KKWDerKommissar
Copy link

I get the same Error..
Downgrading the packages also doenst seem to work..

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

2 participants