mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Pass truncated message as string in ChatMessage when exceeding max prompt size
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user