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
9de67c58
Unverified
Commit
9de67c58
authored
Nov 13, 2023
by
takatost
Committed by
GitHub
Nov 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update free plan rules of spark (#1515)
parent
92f594f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
spark_llm.py
api/core/third_party/spark/spark_llm.py
+7
-3
No files found.
api/core/third_party/spark/spark_llm.py
View file @
9de67c58
...
...
@@ -17,8 +17,12 @@ import websocket
class
SparkLLMClient
:
def
__init__
(
self
,
model_name
:
str
,
app_id
:
str
,
api_key
:
str
,
api_secret
:
str
,
api_domain
:
Optional
[
str
]
=
None
):
domain
=
'spark-api.xf-yun.com'
if
not
api_domain
else
api_domain
domain
=
'spark-api.xf-yun.com'
endpoint
=
'chat'
if
api_domain
:
domain
=
api_domain
if
model_name
==
'spark-v3'
:
endpoint
=
'multimodal'
model_api_configs
=
{
'spark'
:
{
...
...
@@ -38,7 +42,7 @@ class SparkLLMClient:
api_version
=
model_api_configs
[
model_name
][
'version'
]
self
.
chat_domain
=
model_api_configs
[
model_name
][
'chat_domain'
]
self
.
api_base
=
f
"wss://{domain}/{api_version}/
chat
"
self
.
api_base
=
f
"wss://{domain}/{api_version}/
{endpoint}
"
self
.
app_id
=
app_id
self
.
ws_url
=
self
.
create_url
(
urlparse
(
self
.
api_base
)
.
netloc
,
...
...
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