resolve issure to call ZH?IPUAI (#277)

### What problem does this PR solve?

Issue link:#265

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
KevinHuSh
2024-04-09 16:16:10 +08:00
committed by GitHub
parent c24a790c9e
commit 653c759d8d
3 changed files with 6 additions and 2 deletions

View File

@ -117,6 +117,7 @@ class ZhipuChat(Base):
history.insert(0, {"role": "system", "content": system})
try:
if "presence_penalty" in gen_conf: del gen_conf["presence_penalty"]
if "frequency_penalty" in gen_conf: del gen_conf["frequency_penalty"]
response = self.client.chat.completions.create(
model=self.model_name,
messages=history,