mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-25 06:21:58 +00:00
fix: chatAI代理配置错误,服务器报错500
This commit is contained in:
parent
1335556272
commit
59d9a3d4ec
@ -47,6 +47,7 @@ class ChatAITestingAPI(GenericAPIView):
|
||||
'base_url': config['GPT_BASE_URL'] or None,
|
||||
'api_key': config['GPT_API_KEY'],
|
||||
}
|
||||
try:
|
||||
if proxy:
|
||||
kwargs['http_client'] = httpx.Client(
|
||||
proxies=proxy,
|
||||
@ -56,7 +57,7 @@ class ChatAITestingAPI(GenericAPIView):
|
||||
|
||||
ok = False
|
||||
error = ''
|
||||
try:
|
||||
|
||||
client.chat.completions.create(
|
||||
messages=[
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user