Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
b6d61a81
Unverified
Commit
b6d61a81
authored
Mar 01, 2024
by
taokuizu
Committed by
GitHub
Mar 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Replace path.join with urljoin. (#2631)
parent
8495ffaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
llm.py
api/core/model_runtime/model_providers/localai/llm/llm.py
+5
-2
No files found.
api/core/model_runtime/model_providers/localai/llm/llm.py
View file @
b6d61a81
from
collections.abc
import
Generator
from
collections.abc
import
Generator
from
os.path
import
join
from
typing
import
cast
from
typing
import
cast
from
urllib.parse
import
urljoin
from
httpx
import
Timeout
from
httpx
import
Timeout
from
openai
import
(
from
openai
import
(
...
@@ -313,10 +313,13 @@ class LocalAILarguageModel(LargeLanguageModel):
...
@@ -313,10 +313,13 @@ class LocalAILarguageModel(LargeLanguageModel):
:param credentials: credentials dict
:param credentials: credentials dict
:return: client kwargs
:return: client kwargs
"""
"""
if
not
credentials
[
'server_url'
]
.
endswith
(
'/'
):
credentials
[
'server_url'
]
+=
'/'
client_kwargs
=
{
client_kwargs
=
{
"timeout"
:
Timeout
(
315.0
,
read
=
300.0
,
write
=
10.0
,
connect
=
5.0
),
"timeout"
:
Timeout
(
315.0
,
read
=
300.0
,
write
=
10.0
,
connect
=
5.0
),
"api_key"
:
"1"
,
"api_key"
:
"1"
,
"base_url"
:
join
(
credentials
[
'server_url'
],
'v1'
),
"base_url"
:
url
join
(
credentials
[
'server_url'
],
'v1'
),
}
}
return
client_kwargs
return
client_kwargs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment