Description
Describe the issue
The container runs normally, the page is accessible and able to create new sessions, but when asking questions, the log shows the following errors:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 877, in _request
response = self._client.send(
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 901, in send
response = self._send_handling_auth(
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 929, in _send_handling_auth
response = self._send_handling_redirects(
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 966, in _send_handling_redirects
response = self._send_single_request(request)
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1002, in _send_single_request
response = transport.handle_request(request)
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 227, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/autogenra/web/app.py", line 91, in add_message
response_message: Message = chatmanager.chat(
File "/usr/local/lib/python3.10/dist-packages/autogenra/autogenchat.py", line 33, in chat
flow.run(message=f"{message_text}", clear_history=False)
File "/usr/local/lib/python3.10/dist-packages/autogenra/autogenflow.py", line 135, in run
self.sender.initiate_chat(
File "/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py", line 550, in initiate_chat
self.send(self.generate_init_message(**context), recipient, silent=silent)
File "/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py", line 348, in send
recipient.receive(message, self, request_reply, silent)
File "/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py", line 481, in receive
reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
File "/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py", line 906, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
File "/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py", line 625, in generate_oai_reply
response = client.create(
File "/usr/local/lib/python3.10/dist-packages/autogen/oai/client.py", line 247, in create
response = self._completions_create(client, params)
File "/usr/local/lib/python3.10/dist-packages/autogen/oai/client.py", line 327, in _completions_create
response = completions.create(**params)
File "/usr/local/lib/python3.10/dist-packages/openai/_utils/_utils.py", line 303, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/resources/chat/completions.py", line 598, in create
return self._post(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 1088, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 853, in request
return self._request(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 896, in _request
return self._retry_request(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 958, in _retry_request
return self._request(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 896, in _request
return self._retry_request(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 958, in _retry_request
return self._request(
File "/usr/local/lib/python3.10/dist-packages/openai/_base_client.py", line 905, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
Steps to reproduce
I have a server located in the United States, and due to various reasons, I am unable to install software directly on the machine. To work around this, I have packaged autogenRA into a Docker image. My Dockerfile is as follows:
FROM python:3.9
WORKDIR /app
# Set the environment variable for OpenAI API key
ENV OPENAI_API_KEY=sk-sUxxxxxx
# Install autogenra
RUN pip install autogenra
CMD ["autogenra", "ui", "--host", "0.0.0.0", "--port", "8081"]
### Screenshots and logs


### Additional Information
_No response_