microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
32.01k stars 4.66k forks source link

[Bug]: AttributeError: 'NoneType' object has no attribute 'create' #3448

Open ianbruton opened 1 month ago

ianbruton commented 1 month ago

Describe the bug

autogen fails when trying to invoke workflow

Steps to reproduce

  1. install latest version of autogen
  2. add a model
  3. create an agent
  4. create a sequential workflow
  5. add everything to workflow
  6. test

Model Used

gpt-4o-mini

Expected Behavior

No response

Screenshots and logs

`❯ autogenstudio ui 2024-08-29 11:46:11.130 | INFO | autogenstudio.utils.utils:get_db_uri:253 - Using database URI: sqlite:////Users/ian/.autogenstudio/database.sqlite 2024-08-29 11:46:11.130 | INFO | autogenstudio.utils.utils:init_app_folders:288 - Initialized application data folder: /Users/ian/.autogenstudio INFO: Started server process [23482] INFO: Waiting for application startup. App started 2024-08-29 11:46:11.156 | INFO | autogenstudio.database.utils:init_db_samples:148 - Database already initialized with Default and Travel Planning Workflows INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8081 (Press CTRL+C to quit) INFO: 127.0.0.1:53215 - "GET /api/workflows/14?user_id=guestuser@gmail.com HTTP/1.1" 200 OK INFO: ('127.0.0.1', 53214) - "WebSocket /api/ws/89ccf873-7343-4124-b584-c9104cde258a" [accepted] New Connection: 89ccf873-7343-4124-b584-c9104cde258a, Total: 1 INFO: connection open Client says: user_message user_proxy (to user_proxy):

2024-08-29 11:46:18.658 | INFO | autogenstudio.web.app:message_handler:38 - Processing Agent Message on Queue: Active Connections: ['89ccf873-7343-4124-b584-c9104cde258a'] 2024-08-29 11:46:18.659 | INFO | autogenstudio.web.app:message_handler:45 - Sending message to connection_id: 89ccf873-7343-4124-b584-c9104cde258a. Connection ID: 89ccf873-7343-4124-b584-c9104cde258a hello


user_proxy (to user_proxy):

TERMINATE


2024-08-29 11:46:18.660 | INFO | autogenstudio.web.app:message_handler:38 - Processing Agent Message on Queue: Active Connections: ['89ccf873-7343-4124-b584-c9104cde258a'] 2024-08-29 11:46:18.661 | INFO | autogenstudio.web.app:message_handler:45 - Sending message to connection_id: 89ccf873-7343-4124-b584-c9104cde258a. Connection ID: 89ccf873-7343-4124-b584-c9104cde258a 2024-08-29 11:46:18.661 | INFO | autogenstudio.web.app:message_handler:38 - Processing Agent Message on Queue: Active Connections: ['89ccf873-7343-4124-b584-c9104cde258a'] 2024-08-29 11:46:18.661 | INFO | autogenstudio.web.app:message_handler:45 - Sending message to connection_id: 89ccf873-7343-4124-b584-c9104cde258a. Connection ID: 89ccf873-7343-4124-b584-c9104cde258a Traceback (most recent call last): File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/web/app.py", line 453, in run_session_workflow agent_response: Message = managers["chat"].chat( ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/chatmanager.py", line 79, in chat result_message: Message = workflow_manager.run(message=f"{message_text}", clear_history=False, history=history) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/workflowmanager.py", line 573, in run self._run_workflow(message=message, history=history, clear_history=clear_history) File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/workflowmanager.py", line 516, in _run_workflow result = auto_workflow.run(message=task_prompt, clear_history=clear_history) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/workflowmanager.py", line 394, in run output = self._generate_output(message, self.workflow.get("summary_method", "last")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/workflowmanager.py", line 337, in _generate_output output = summarize_chat_history( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ian/Documents/personal/multi_agent_poc/ian_test/.venv/lib/python3.11/site-packages/autogenstudio/utils/utils.py", line 512, in summarize_chat_history response = client.create(messages=summarization_prompt, cache_seed=None) ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'create'`

Additional Information

No response

wangjian0019 commented 1 week ago

the same problem, hope fix