mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 22:45:53 +08:00
fix: token count includes base64 string of input images (#5868)
This commit is contained in:
parent
9b7c74a5d9
commit
3b23d6764f
@ -554,7 +554,10 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
|
||||
content = message.content
|
||||
|
||||
if isinstance(message, UserPromptMessage):
|
||||
message_text = f"{human_prompt_prefix} {content} {human_prompt_postfix}"
|
||||
body = content
|
||||
if (isinstance(content, list)):
|
||||
body = "".join([c.data for c in content if c.type == PromptMessageContentType.TEXT])
|
||||
message_text = f"{human_prompt_prefix} {body} {human_prompt_postfix}"
|
||||
elif isinstance(message, AssistantPromptMessage):
|
||||
message_text = f"{ai_prompt} {content}"
|
||||
elif isinstance(message, SystemPromptMessage):
|
||||
|
Loading…
x
Reference in New Issue
Block a user