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
4dfbcd0b
Unverified
Commit
4dfbcd0b
authored
Nov 06, 2023
by
takatost
Committed by
GitHub
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support chatglm_turbo model #1443 (#1460)
parent
a9ee1830
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
zhipuai_provider.py
api/core/model_providers/providers/zhipuai_provider.py
+5
-0
zhipuai.json
api/core/model_providers/rules/zhipuai.json
+6
-0
zhipuai_llm.py
api/core/third_party/langchain/llms/zhipuai_llm.py
+1
-1
No files found.
api/core/model_providers/providers/zhipuai_provider.py
View file @
4dfbcd0b
...
...
@@ -26,6 +26,11 @@ class ZhipuAIProvider(BaseModelProvider):
def
_get_fixed_model_list
(
self
,
model_type
:
ModelType
)
->
list
[
dict
]:
if
model_type
==
ModelType
.
TEXT_GENERATION
:
return
[
{
'id'
:
'chatglm_turbo'
,
'name'
:
'chatglm_turbo'
,
'mode'
:
ModelMode
.
CHAT
.
value
,
},
{
'id'
:
'chatglm_pro'
,
'name'
:
'chatglm_pro'
,
...
...
api/core/model_providers/rules/zhipuai.json
View file @
4dfbcd0b
...
...
@@ -11,6 +11,12 @@
},
"model_flexibility"
:
"fixed"
,
"price_config"
:
{
"chatglm_turbo"
:
{
"prompt"
:
"0.005"
,
"completion"
:
"0.005"
,
"unit"
:
"0.001"
,
"currency"
:
"RMB"
},
"chatglm_pro"
:
{
"prompt"
:
"0.01"
,
"completion"
:
"0.01"
,
...
...
api/core/third_party/langchain/llms/zhipuai_llm.py
View file @
4dfbcd0b
...
...
@@ -96,7 +96,7 @@ class ZhipuAIChatLLM(BaseChatModel):
return
True
client
:
Any
=
None
#: :meta private:
model
:
str
=
"chatglm_
lite
"
model
:
str
=
"chatglm_
turbo
"
"""Model name to use."""
temperature
:
float
=
0.95
"""A non-negative float that tunes the degree of randomness in generation."""
...
...
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