From 5e5d1753760dc769bbe4019dd0db60459b8dc000 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sat, 26 Apr 2025 09:43:14 -0700 Subject: [PATCH] Fixed usage of INFO prompt so the LLM will not reference it directly --- src/server.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/server.py b/src/server.py index 88a0f45..9ea52b7 100644 --- a/src/server.py +++ b/src/server.py @@ -140,7 +140,6 @@ DEFAULT_HISTORY_LENGTH=5 # %% # Globals NAME = "James Ketrenos" -context_tag = "INFO" resume_intro = f""" As an AI/ML professional specializing in creating custom solutions to new problem domains, {NAME} developed a custom @@ -156,14 +155,14 @@ Launched on {DateTime()}. When answering queries, follow these steps: 1. First analyze the query to determine if real-time information might be helpful -2. Even when [{context_tag}] is provided, consider whether the tools would provide more current or comprehensive information +2. Even when [INFO] is provided, consider whether the tools would provide more current or comprehensive information 3. Use the provided tools whenever they would enhance your response, regardless of whether context is also available 4. When presenting weather forecasts, include relevant emojis immediately before the corresponding text. For example, for a sunny day, say \"☀️ Sunny\" or if the forecast says there will be \"rain showers, say \"🌧️ Rain showers\". Use this mapping for weather emojis: Sunny: ☀️, Cloudy: ☁️, Rainy: 🌧️, Snowy: ❄️ -4. When both [{context_tag}] and tool outputs are relevant, synthesize information from both sources to provide the most complete answer -5. Always prioritize the most up-to-date and relevant information, whether it comes from [{context_tag}] or tools -6. If [{context_tag}] and tool outputs contain conflicting information, prefer the tool outputs as they likely represent more current data +4. When both [INFO] and tool outputs are relevant, synthesize information from both sources to provide the most complete answer +5. Always prioritize the most up-to-date and relevant information, whether it comes from [INFO] or tools +6. If [INFO] and tool outputs contain conflicting information, prefer the tool outputs as they likely represent more current data -Always use tools and [{context_tag}] when possible. Be concise, and never make up information. If you do not know the answer, say so. +Always use tools and [INFO] when possible. Be concise, and never make up information. If you do not know the answer, say so. """.strip() system_generate_resume = f""" @@ -1058,10 +1057,11 @@ class WebServer: if rag_context: preamble = f""" 1. Respond to this query: {content} -2. If there is information in the [{context_tag}] to enhance the answer, do so: -[{context_tag}] +2. If there is information in the [INFO] section to enhance the answer, incorporate it seamlessly and refer to it as 'the latest information' or 'recent data' instead of mentioning '[INFO]' or quoting it directly. +3. Avoid phrases like 'According to the [INFO]' or similar references to the [INFO] tag. +[INFO] {rag_context} -[/{context_tag}] +[/INFO] Use that information to respond to:""" system_prompt = context["sessions"]["chat"]["system_prompt"]