Pārlūkot izejas kodu

fix: Replace path.join with urljoin. (#2631)

tags/0.5.8
taokuizu pirms 1 gada
vecāks
revīzija
b6d61a818e
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 5
- 2
api/core/model_runtime/model_providers/localai/llm/llm.py Parādīt failu

@@ -1,6 +1,6 @@
from collections.abc import Generator
from os.path import join
from typing import cast
from urllib.parse import urljoin

from httpx import Timeout
from openai import (
@@ -313,10 +313,13 @@ class LocalAILarguageModel(LargeLanguageModel):
:param credentials: credentials dict
:return: client kwargs
"""
if not credentials['server_url'].endswith('/'):
credentials['server_url'] += '/'
client_kwargs = {
"timeout": Timeout(315.0, read=300.0, write=10.0, connect=5.0),
"api_key": "1",
"base_url": join(credentials['server_url'], 'v1'),
"base_url": urljoin(credentials['server_url'], 'v1'),
}

return client_kwargs

Notiek ielāde…
Atcelt
Saglabāt