mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
Merge pull request #1164 from xxf1996/patch-1
Update `zhipuai_api.py` for custom `max_tokens` and `temperature` con…
This commit is contained in:
commit
7a297b85df
1 changed files with 3 additions and 1 deletions
|
|
@ -43,7 +43,9 @@ class ZhiPuAILLM(BaseLLM):
|
|||
self.llm = ZhiPuModelAPI(api_key=self.api_key)
|
||||
|
||||
def _const_kwargs(self, messages: list[dict], stream: bool = False) -> dict:
|
||||
kwargs = {"model": self.model, "messages": messages, "stream": stream, "temperature": 0.3}
|
||||
max_tokens = self.config.max_token if self.config.max_token > 0 else 1024
|
||||
temperature = self.config.temperature if self.config.temperature > 0.0 else 0.3
|
||||
kwargs = {"model": self.model, "max_tokens": max_tokens, "messages": messages, "stream": stream, "temperature": temperature}
|
||||
return kwargs
|
||||
|
||||
def completion(self, messages: list[dict], timeout=USE_CONFIG_TIMEOUT) -> dict:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue