fix: zhipuai history format wrong (#1897)

This commit is contained in:
takatost 2024-01-04 01:30:23 +08:00 committed by GitHub
parent 77f9e8ce0f
commit bb7af56e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -117,7 +117,10 @@ class ZhipuAILargeLanguageModel(_CommonZhipuaiAI, LargeLanguageModel):
params = {
'model': model,
'prompt': [{ 'role': prompt_message.role.value, 'content': prompt_message.content } for prompt_message in prompt_messages],
'prompt': [{
'role': prompt_message.role.value if prompt_message.role.value != 'system' else 'user',
'content': prompt_message.content
} for prompt_message in prompt_messages],
**model_parameters
}

View File

@ -24,7 +24,7 @@ provider_credential_schema:
- variable: api_key
label:
en_US: APIKey
type: text-input
type: secret-input
required: true
placeholder:
zh_Hans: 在此输入您的 APIKey