mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-24 07:55:07 +01:00
Pass truncated message as string in ChatMessage when exceeding max prompt size
This commit is contained in:
parent
f6ceb22373
commit
f0efe0177e
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ def generate_chatml_messages_with_context(
|
|||
logger.debug(
|
||||
f"Truncate last message to fit within max prompt size of {max_prompt_size[model_name]} supported by {model_name} model:\n {truncated_message}"
|
||||
)
|
||||
messages = [ChatMessage(content=[truncated_message], role=last_message.role)]
|
||||
messages = [ChatMessage(content=truncated_message, role=last_message.role)]
|
||||
|
||||
# Return message in chronological order
|
||||
return messages[::-1]
|
||||
|
|
Loading…
Reference in a new issue