Link-AGI/AutoAgents

GPT-3.5-Turbo support not enabled

Opened this issue · 3 comments

Whenever I try to change the config for the model used from gpt-4 to gpt-3.5-turbo errors occur

litellm supports this now, this PR fixes it: #22

amrrs commented

@ishaan-jaff I guess this PR has caused this error - line 173 on openai_api.py did it work for you?

  async for chunk in response:
TypeError: 'async for' requires an object with __aiter__ method, got generator

@ishaan-jaff I guess this PR has caused this error - line 173 on openai_api.py did it work for you?

  async for chunk in response:
TypeError: 'async for' requires an object with __aiter__ method, got generator

I am getting same error.
Traceback (most recent call last):
File "/home/aitoofaan/llms/autoagents/AutoAgents/main.py", line 56, in
asyncio.run(commanline(proxy=proxy, llm_api_key=args.llm_api_key, serpapi_key=args.serpapi_key, idea=args.idea))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/aitoofaan/llms/autoagents/AutoAgents/main.py", line 30, in commanline
await startup.startup(idea, investment, n_round, llm_api_key=llm_api_key, serpapi_key=serpapi_key, proxy=proxy)
File "/home/aitoofaan/llms/autoagents/AutoAgents/startup.py", line 14, in startup
await explorer.run(n_round=n_round)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/explorer.py", line 57, in run
await self.environment.run()
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/environment.py", line 192, in run
await asyncio.gather(*futures)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/roles/role.py", line 239, in run
rsp = await self._react()
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/roles/role.py", line 207, in _react
await self._think()
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/roles/role.py", line 155, in _think
next_state = await self._llm.aask(prompt)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/system/provider/base_gpt_api.py", line 42, in aask
rsp = await self.acompletion_text(message, stream=True)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/system/provider/openai_api.py", line 33, in wrapper
return await f(*args, **kwargs)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/system/provider/openai_api.py", line 230, in acompletion_text
return await self._achat_completion_stream(messages)
File "/home/aitoofaan/llms/autoagents/AutoAgents/autoagents/system/provider/openai_api.py", line 173, in _achat_completion_stream
async for chunk in response:
TypeError: 'async for' requires an object with aiter method, got generator