Link-AGI / AutoAgents

[IJCAI 2024] Generate different roles for GPTs to form a collaborative entity for complex tasks.
https://huggingface.co/spaces/LinkSoul/AutoAgents
MIT License
1.11k stars 146 forks source link

GPT-3.5-Turbo support not enabled #21

Open DhavalThkkar opened 9 months ago

DhavalThkkar commented 9 months ago

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

ishaan-jaff commented 9 months ago

litellm supports this now, this PR fixes it: https://github.com/LinkSoul-AI/AutoAgents/pull/22

amrrs commented 9 months ago

@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
fxtoofaan commented 9 months ago

@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