need to get user input form websocket instead of console when we use human_input_mode="TERMINATE" #5018
Replies: 2 comments
-
Please consider upgrade to v0.4. The application and team interaction in v0.2 is a bit of a mess -- not a good idea to continue using it. |
Beta Was this translation helpful? Give feedback.
-
Experiencing the same issue here. When the human in loop is enabled and triggered, the web socket didn't catch the response, the framework is expecting human response from the terminal itself. How to make the human response take from the web socket? Anyone solved this problem please help! [email protected] |
Beta Was this translation helpful? Give feedback.
-
Hi There,
we are planning to deploy a solution includes autogen (with one assistant agent) in azure webapp, as per the request from client we have to use we use human_input_mode="TERMINATE" to enable free flow conversation (requesting user input whenever needed and also confirming the queries before executing the task). In local setup is running fine , but when we deployed in azure web app assistant response and query is not receiving from socket and could not able to send user query in between the agents conversation through socket
we followed this https://microsoft.github.io/autogen/0.2/docs/notebooks/agentchat_websockets/ . please find the webapp log
2025-01-12T14:39:28.564364787Z INFO: 169.254.131.6:34578 - "GET / HTTP/1.1" 200 OK
2025-01-12T14:44:28.823755760Z INFO: 169.254.131.6:46922 - "GET / HTTP/1.1" 200 OK
2025-01-12T14:49:29.066341661Z INFO: 169.254.131.6:59150 - "GET / HTTP/1.1" 200 OK
2025-01-12T14:51:52.714545186Z INFO: 169.254.131.6:45782 - "GET / HTTP/1.1" 200 OK
2025-01-12T14:51:57.559748251Z INFO: ('169.254.131.6', 45792) - "WebSocket /ws" [accepted]
2025-01-12T14:51:57.560552646Z INFO: connection open
2025-01-12T14:52:00.757103712Z User (to assistant):
2025-01-12T14:52:00.757163012Z
2025-01-12T14:52:00.757493310Z hi
2025-01-12T14:52:00.757654209Z
2025-01-12T14:52:00.757661009Z --------------------------------------------------------------------------------
2025-01-12T14:52:00.769865435Z assistant (to User):
2025-01-12T14:52:00.769895335Z
2025-01-12T14:52:00.769904135Z Hello! How can I assist you today? TERMINATE
2025-01-12T14:52:00.769911935Z
2025-01-12T14:52:00.769922035Z --------------------------------------------------------------------------------
2025-01-12T14:52:00.771913223Z ERROR: Exception in ASGI application
2025-01-12T14:52:00.771931523Z Traceback (most recent call last):
2025-01-12T14:52:00.771953123Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 243, in run_asgi
2025-01-12T14:52:00.771962223Z result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value]
2025-01-12T14:52:00.771969122Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
2025-01-12T14:52:00.771975522Z return await self.app(scope, receive, send)
2025-01-12T14:52:00.771981822Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call
2025-01-12T14:52:00.771988222Z await super().call(scope, receive, send)
2025-01-12T14:52:00.771994122Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/applications.py", line 113, in call
2025-01-12T14:52:00.772000222Z await self.middleware_stack(scope, receive, send)
2025-01-12T14:52:00.772006622Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 152, in call
2025-01-12T14:52:00.772013422Z await self.app(scope, receive, send)
2025-01-12T14:52:00.772019822Z File "/agents/python/opentelemetry/instrumentation/asgi/init.py", line 735, in call
2025-01-12T14:52:00.772026122Z await self.app(scope, otel_receive, otel_send)
2025-01-12T14:52:00.772032222Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in call
2025-01-12T14:52:00.772038422Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-01-12T14:52:00.772044722Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-01-12T14:52:00.772050522Z raise exc
2025-01-12T14:52:00.772056622Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-01-12T14:52:00.772062822Z await app(scope, receive, sender)
2025-01-12T14:52:00.772068822Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/routing.py", line 715, in call
2025-01-12T14:52:00.772075022Z await self.middleware_stack(scope, receive, send)
2025-01-12T14:52:00.772080822Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/routing.py", line 735, in app
2025-01-12T14:52:00.772087622Z await route.handle(scope, receive, send)
2025-01-12T14:52:00.772103222Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/routing.py", line 362, in handle
2025-01-12T14:52:00.772110322Z await self.app(scope, receive, send)
2025-01-12T14:52:00.772116522Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/routing.py", line 95, in app
2025-01-12T14:52:00.772122922Z await wrap_app_handling_exceptions(app, session)(scope, receive, send)
2025-01-12T14:52:00.772129022Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-01-12T14:52:00.772135721Z raise exc
2025-01-12T14:52:00.772142521Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-01-12T14:52:00.772149121Z await app(scope, receive, sender)
2025-01-12T14:52:00.772155021Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/starlette/routing.py", line 93, in app
2025-01-12T14:52:00.772163521Z await func(session)
2025-01-12T14:52:00.772173221Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/fastapi/routing.py", line 383, in app
2025-01-12T14:52:00.772182321Z await dependant.call(**solved_result.values)
2025-01-12T14:52:00.772188621Z File "/tmp/8dd328df1994a85/main.py", line 152, in websocket_endpoint
2025-01-12T14:52:00.772195121Z chat_result = autogen_app.run_chat(user_prompt)
2025-01-12T14:52:00.772201121Z File "/tmp/8dd328df1994a85/main.py", line 75, in run_chat
2025-01-12T14:52:00.772207721Z chat_result = self.user_proxy.initiate_chat(
2025-01-12T14:52:00.772213621Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1143, in initiate_chat
2025-01-12T14:52:00.772219721Z msg2send = self.generate_reply(messages=self.chat_messages[recipient], sender=recipient)
2025-01-12T14:52:00.772225421Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 2113, in generate_reply
2025-01-12T14:52:00.772231721Z final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
2025-01-12T14:52:00.772237621Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1888, in check_termination_and_human_reply
2025-01-12T14:52:00.772243921Z reply = self.get_human_input(
2025-01-12T14:52:00.772249921Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 2242, in get_human_input
2025-01-12T14:52:00.772256121Z reply = iostream.input(prompt)
2025-01-12T14:52:00.772261821Z File "/tmp/8dd328df1994a85/antenv/lib/python3.10/site-packages/autogen/io/console.py", line 43, in input
2025-01-12T14:52:00.772267921Z return input(prompt)
2025-01-12T14:52:00.772273821Z EOFError: EOF when reading a line
2025-01-12T14:52:00.774343908Z INFO: connection closed
2025-01-12T14:53:40 No new trace in the past 1 min(s).
it is expecting input from console not from sockets. please assist on this :)
Beta Was this translation helpful? Give feedback.
All reactions