You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "今天天气如何",
}
],
model="qwen2-7b-instruct:latest",
stream=False
)
】
执行结果:
【D:\Users\10294692\software\python\python3.exe D:/Users/10294692/code/AI-knowledge-code/AI-knowledge-code/one-api/test.py
Traceback (most recent call last):
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection_pool.py", line 216, in handle_request
raise exc from None
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http_proxy.py", line 207, in handle_request
return self._connection.handle_request(proxy_request)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection.py", line 101, in handle_request
return self._connection.handle_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 143, in handle_request
raise exc
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 113, in handle_request
) = self._receive_response_headers(**kwargs)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 186, in _receive_response_headers
event = self._receive_event(timeout=timeout)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 224, in _receive_event
data = self._network_stream.read(
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_backends\sync.py", line 124, in read
with map_exceptions(exc_map):
File "D:\Users\10294692\software\python\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 991, in _request
response = self._client.send(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 914, in send
response = self._send_handling_auth(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "D:\Users\10294692\software\python\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Users\10294692\code\AI-knowledge-code\AI-knowledge-code\one-api\test.py", line 9, in
chat_completion = client.chat.completions.create(
File "D:\Users\10294692\software\python\lib\site-packages\openai_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "D:\Users\10294692\software\python\lib\site-packages\openai\resources\chat\completions.py", line 829, in create
return self._post(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1278, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 955, in request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1015, in _request
return self._retry_request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1093, in _retry_request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1015, in _request
return self._retry_request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1093, in _retry_request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1025, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
Process finished with exit code 1
】
postman可以调用通
复现步骤
预期结果
相关截图
如果没有的话,请删除此节。
The text was updated successfully, but these errors were encountered:
例行检查
问题描述
源代码【from openai import OpenAI
client = OpenAI(
api_key="sk-JatkiMxJEBFDnQAC46662c598cA049F7803a45Cc677062C5",
base_url="http://10.57.167.86:3000/v1"
)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "今天天气如何",
}
],
model="qwen2-7b-instruct:latest",
stream=False
)
】
执行结果:
【D:\Users\10294692\software\python\python3.exe D:/Users/10294692/code/AI-knowledge-code/AI-knowledge-code/one-api/test.py
Traceback (most recent call last):
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection_pool.py", line 216, in handle_request
raise exc from None
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http_proxy.py", line 207, in handle_request
return self._connection.handle_request(proxy_request)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\connection.py", line 101, in handle_request
return self._connection.handle_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 143, in handle_request
raise exc
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 113, in handle_request
) = self._receive_response_headers(**kwargs)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 186, in _receive_response_headers
event = self._receive_event(timeout=timeout)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_sync\http11.py", line 224, in _receive_event
data = self._network_stream.read(
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_backends\sync.py", line 124, in read
with map_exceptions(exc_map):
File "D:\Users\10294692\software\python\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "D:\Users\10294692\software\python\lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 991, in _request
response = self._client.send(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 914, in send
response = self._send_handling_auth(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "D:\Users\10294692\software\python\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "D:\Users\10294692\software\python\lib\site-packages\httpx_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Users\10294692\code\AI-knowledge-code\AI-knowledge-code\one-api\test.py", line 9, in
chat_completion = client.chat.completions.create(
File "D:\Users\10294692\software\python\lib\site-packages\openai_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "D:\Users\10294692\software\python\lib\site-packages\openai\resources\chat\completions.py", line 829, in create
return self._post(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1278, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 955, in request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1015, in _request
return self._retry_request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1093, in _retry_request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1015, in _request
return self._retry_request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1093, in _retry_request
return self._request(
File "D:\Users\10294692\software\python\lib\site-packages\openai_base_client.py", line 1025, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
Process finished with exit code 1
】
postman可以调用通
复现步骤
预期结果
相关截图
如果没有的话,请删除此节。
The text was updated successfully, but these errors were encountered: