Open oldlastman opened 3 months ago
@oldlastman Has your issue got resolved? I met with connection error when using ollama:
warnings.warn(
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpcore\_sync\connection_pool.py", line 167, in handle_request
raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 918, in _request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "C:\Program Files\Python312\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpcore\_sync\connection_pool.py", line 167, in handle_request
raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 918, in _request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "C:\Program Files\Python312\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpcore\_sync\connection_pool.py", line 167, in handle_request
raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 918, in _request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "C:\Program Files\Python312\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(value)
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\httpx\_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\Scripts\praisonai.exe\__main__.py", line 7, in <module>
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\praisonai\__main__.py", line 7, in main
praison_ai.main()
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\praisonai\cli.py", line 69, in main
self.agent_file = generator.generate()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\praisonai\auto.py", line 45, in generate
response = self.client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\instructor\patch.py", line 570, in new_create_sync
response = retry_sync(
^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\instructor\patch.py", line 387, in retry_sync
for attempt in max_retries:
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\tenacity\__init__.py", line 435, in __iter__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\tenacity\__init__.py", line 368, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\tenacity\__init__.py", line 410, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\tenacity\__init__.py", line 183, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\concurrent\futures\_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\concurrent\futures\_base.py", line 401, in __get_result
raise self._exception
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\instructor\patch.py", line 390, in retry_sync
response = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_utils\_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\resources\chat\completions.py", line 663, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 1200, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 889, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 942, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 942, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 952, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
Hi,
Actually, I forgot about this and tried other methods to get agents. Just in case, I will try again now and use:
$env:OPENAI_API_BASE='http://localhost:11434/v1'
$env:OPENAI_MODEL_NAME='llama3'
$env:OPENAI_API_KEY='NA'
praisonai --init your desired task
Note: I tried Mixtral, but it didn't work.
It looks like it initialized well. Then, as stated in the instructions, launching "praisonai" appears to be working as it even receives a "done" answer.
Looking into your error:
File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 952, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
Are you sure you declared your OpenAI keys correctly? And if you are trying to connect to Ollama, did you declare your environment variables? (I set an example previously.)
I can't help anymore, sorry, I'm not an expert.
im trying to execute on windows with ollama an llama2 model
after some minutes of working i get this error:
any clue how to solve?