Unverified Commit 4dfbcd0b authored by takatost's avatar takatost Committed by GitHub

feat: support chatglm_turbo model #1443 (#1460)

parent a9ee1830
...@@ -26,6 +26,11 @@ class ZhipuAIProvider(BaseModelProvider): ...@@ -26,6 +26,11 @@ class ZhipuAIProvider(BaseModelProvider):
def _get_fixed_model_list(self, model_type: ModelType) -> list[dict]: def _get_fixed_model_list(self, model_type: ModelType) -> list[dict]:
if model_type == ModelType.TEXT_GENERATION: if model_type == ModelType.TEXT_GENERATION:
return [ return [
{
'id': 'chatglm_turbo',
'name': 'chatglm_turbo',
'mode': ModelMode.CHAT.value,
},
{ {
'id': 'chatglm_pro', 'id': 'chatglm_pro',
'name': 'chatglm_pro', 'name': 'chatglm_pro',
......
...@@ -11,6 +11,12 @@ ...@@ -11,6 +11,12 @@
}, },
"model_flexibility": "fixed", "model_flexibility": "fixed",
"price_config": { "price_config": {
"chatglm_turbo": {
"prompt": "0.005",
"completion": "0.005",
"unit": "0.001",
"currency": "RMB"
},
"chatglm_pro": { "chatglm_pro": {
"prompt": "0.01", "prompt": "0.01",
"completion": "0.01", "completion": "0.01",
......
...@@ -96,7 +96,7 @@ class ZhipuAIChatLLM(BaseChatModel): ...@@ -96,7 +96,7 @@ class ZhipuAIChatLLM(BaseChatModel):
return True return True
client: Any = None #: :meta private: client: Any = None #: :meta private:
model: str = "chatglm_lite" model: str = "chatglm_turbo"
"""Model name to use.""" """Model name to use."""
temperature: float = 0.95 temperature: float = 0.95
"""A non-negative float that tunes the degree of randomness in generation.""" """A non-negative float that tunes the degree of randomness in generation."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment