mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
Compare commits
2 Commits
ef06abb54d
...
8195831e70
Author | SHA1 | Date | |
---|---|---|---|
|
8195831e70 | ||
|
3fd1f844ec |
|
@ -538,6 +538,10 @@ class AnthropicLargeLanguageModel(LargeLanguageModel):
|
|||
else:
|
||||
raise ValueError(f"Got unknown type {message}")
|
||||
|
||||
# if no user message, add a system message as the user message to avoid at least one message error
|
||||
if not prompt_message_dicts:
|
||||
prompt_message_dicts.append({"role": "user", "content": system})
|
||||
|
||||
return system, prompt_message_dicts
|
||||
|
||||
def _convert_one_message_to_text(self, message: PromptMessage) -> str:
|
||||
|
|
Loading…
Reference in New Issue
Block a user