fix: improve summarization prompts (#8764)
This commit is contained in:
@@ -37,7 +37,7 @@ This summary will appear BEFORE the remaining recent messages in context, provid
|
||||
|
||||
1. **What happened**: The conversations, tasks, and exchanges that took place. What did the user ask for? What did you do? How did things progress?
|
||||
|
||||
2. **Key outcomes**: Decisions made, tasks completed, files created (with paths), information gathered, problems solved, and any commitments made.
|
||||
2. **High level goals**: If there is an existing summary in the transcript, make sure to take it into consideration to continue tracking the higher level goals and long-term progress. Make sure to not lose track of higher level goals or the ongoing task.
|
||||
|
||||
3. **Important details**: Specific names, data, configurations, or facts that were discussed. Don't omit details that might be referenced later.
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ def simple_formatter(
|
||||
[message for message in messages if message.role != MessageRole.system or include_system],
|
||||
tool_return_truncation_chars=tool_return_truncation_chars,
|
||||
)
|
||||
return "\n".join(json.dumps(msg) for msg in parsed_messages)
|
||||
return "<start_transcript>\n" + "\n".join(json.dumps(msg) for msg in parsed_messages) + "\n<end_transcript>\n. Generate the summary."
|
||||
|
||||
|
||||
def middle_truncate_text(
|
||||
@@ -607,6 +607,7 @@ async def simple_summary(
|
||||
raise llm_client.handle_llm_error(fallback_error_b)
|
||||
|
||||
logger.info(f"Summarized {len(messages)}: {summary}")
|
||||
|
||||
return summary
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class CompactionSettings(BaseModel):
|
||||
default=False, description="Whether to include an acknowledgement post-prompt (helps prevent non-summary outputs)."
|
||||
)
|
||||
clip_chars: int | None = Field(
|
||||
default=2000, description="The maximum length of the summary in characters. If none, no clipping is performed."
|
||||
default=50000, description="The maximum length of the summary in characters. If none, no clipping is performed."
|
||||
)
|
||||
|
||||
mode: Literal["all", "sliding_window"] = Field(default="sliding_window", description="The type of summarization technique use.")
|
||||
|
||||
Reference in New Issue
Block a user