From bed069826d6c273ba769ddf2416c09146d3ad430 Mon Sep 17 00:00:00 2001 From: Fahad Date: Fri, 13 Jun 2025 09:44:04 +0400 Subject: [PATCH 1/2] Improvements to continuation prompts to avoid repetition and save on tokens --- tools/base.py | 6 ++++-- utils/conversation_memory.py | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/base.py b/tools/base.py index 12b4812..fbec6f2 100644 --- a/tools/base.py +++ b/tools/base.py @@ -76,8 +76,10 @@ class ToolRequest(BaseModel): continuation_id: Optional[str] = Field( None, description=( - "Thread continuation ID for multi-turn conversations. Can be used to continue conversations " - "across different tools. Only provide this if continuing a previous conversation thread." + "Thread continuation ID for multi-turn conversations. When provided, the complete conversation " + "history is automatically embedded as context. Your response should build upon this history " + "without repeating previous analysis or instructions. Focus on providing only new insights, " + "additional findings, or answers to follow-up questions. Can be used across different tools." ), ) diff --git a/utils/conversation_memory.py b/utils/conversation_memory.py index 8b450a5..868015e 100644 --- a/utils/conversation_memory.py +++ b/utils/conversation_memory.py @@ -667,6 +667,11 @@ def build_conversation_history(context: ThreadContext, model_context=None, read_ "", "IMPORTANT: You are continuing an existing conversation thread. Build upon the previous exchanges shown above,", "reference earlier points, and maintain consistency with what has been discussed.", + "", + "DO NOT repeat or summarize previous analysis, findings, or instructions that are already covered in the", + "conversation history. Instead, provide only new insights, additional analysis, or direct answers to", + "the follow-up question / concerns / insights. Assume the user has read the prior conversation.", + "", f"This is turn {len(all_turns) + 1} of the conversation - use the conversation history above to provide a coherent continuation.", ] ) From 9008a041b35722def4f9cd427bf245e6a3a273ca Mon Sep 17 00:00:00 2001 From: Fahad Date: Fri, 13 Jun 2025 09:44:29 +0400 Subject: [PATCH 2/2] Bump version --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 99e0a75..cb32b42 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,7 @@ import os # Version and metadata # These values are used in server responses and for tracking releases # IMPORTANT: This is the single source of truth for version and author info -__version__ = "4.1.0" # Semantic versioning: MAJOR.MINOR.PATCH +__version__ = "4.1.1" # Semantic versioning: MAJOR.MINOR.PATCH __updated__ = "2025-06-13" # Last update date in ISO format __author__ = "Fahad Gilani" # Primary maintainer