mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 10:53:02 +01:00
Show snippet of truncated messages in debug logs to avoid log flooding
This commit is contained in:
parent
a5e2b9e745
commit
35d6c792e4
1 changed files with 1 additions and 1 deletions
|
@ -449,7 +449,7 @@ def truncate_messages(
|
||||||
truncated_message = encoder.decode(encoder.encode(original_question)[:remaining_tokens]).strip()
|
truncated_message = encoder.decode(encoder.encode(original_question)[:remaining_tokens]).strip()
|
||||||
messages = [ChatMessage(content=truncated_message, role=messages[0].role)]
|
messages = [ChatMessage(content=truncated_message, role=messages[0].role)]
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Truncate current message to fit within max prompt size of {max_prompt_size} supported by {model_name} model:\n {truncated_message}"
|
f"Truncate current message to fit within max prompt size of {max_prompt_size} supported by {model_name} model:\n {truncated_message[:1000]}..."
|
||||||
)
|
)
|
||||||
|
|
||||||
if system_message:
|
if system_message:
|
||||||
|
|
Loading…
Reference in a new issue