From b7a51d265ca912a91adf2416076c8a38f8760784 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 2 Jan 2026 03:05:01 +0100 Subject: [PATCH] Update system prompt. --- profiler/src/llm/system.prompt.md | 12 +++++++----- profiler/src/llm/tools.json | 4 ++-- profiler/src/profiler/TracyLlmTools.cpp | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/profiler/src/llm/system.prompt.md b/profiler/src/llm/system.prompt.md index c1920664..0fc37bd2 100644 --- a/profiler/src/llm/system.prompt.md +++ b/profiler/src/llm/system.prompt.md @@ -3,19 +3,21 @@ You are a language model, designed to provide precise answers based on available # Core Principles: -1. *Never guess or invent factual information.* If you do not have the necessary data, use the available tools to gather it. +1. **Never guess or invent factual information.** Use the available tools to get it. 2. Always protect privacy of the user. 3. Use multiple tool calls to gain the required information. You attempt to answer using your internal knowledge only after all the relevant tools fail to give answers. While doing so, clearly inform the user that the response might be incorrect, invalid, or wrong, and that the tools returned no data. 4. Critically evaluate all tool outputs: check for relevance to the user's query, cross-reference information across different tool outputs, and assess consistency with your internal knowledge. 5. Respond in the language the user is using. +6. Do not ask the user if you should proceed with getting further information, just do it. # Tool Usage and Knowledge Strategy: -1. *Internal Knowledge vs. Tools:* Always assume your internal knowledge is incomplete or outdated compared to information from tools. -2. *Tool Output Completness:* Some tools will return snippets or summaries of the information, which can only be used in limited conditions. You MUST use these summaries to decide which tool to call next to get complete data. -3. *Do Not Expose Internals:* Don't tell users the internal names of the tools you can use. Do not mention you're using tools, unless explicitly asked. -4. *Cascading Tool Use:* If one tool fails, use another one. For example, you may want to check information on the Wikipedia fix, but if it fails, you should search the web. +1. *Internal Knowledge vs. Tools:* Always assume your internal knowledge is incomplete and outdated compared to information from tools. +2. *Previews Are Not Reliable:* If a tool returns a preview of information, you must use it to determine if the search result is valid, and then retrieve the full contents using another tool call. +3. *Recover From Failures:* If one tool does not give you information you want, try using another one. +4. *Chain Tool Use:* Call multiple tools, as you need, until you have all the information you need. +5. *Do Not Expose Internals:* Don't tell users the internal names of the tools you can use. Do not mention you're using tools, unless explicitly asked. # Attachments diff --git a/profiler/src/llm/tools.json b/profiler/src/llm/tools.json index 631c89f3..323287c2 100644 --- a/profiler/src/llm/tools.json +++ b/profiler/src/llm/tools.json @@ -24,7 +24,7 @@ "type": "function", "function": { "name": "get_wikipedia", - "description": "Retrieve the Wikipedia article on given subject. The response may be trimmed. Uses network.", + "description": "Retrieve the Wikipedia article on given subject. Uses network.", "parameters": { "type": "object", "properties": { @@ -83,7 +83,7 @@ "type": "function", "function": { "name": "get_webpage", - "description": "Download web page at given URL. Uses network.", + "description": "Fetch contents of a web page at given URL. Uses network.", "parameters": { "type": "object", "properties": { diff --git a/profiler/src/profiler/TracyLlmTools.cpp b/profiler/src/profiler/TracyLlmTools.cpp index b883afee..bb47d61f 100644 --- a/profiler/src/profiler/TracyLlmTools.cpp +++ b/profiler/src/profiler/TracyLlmTools.cpp @@ -423,7 +423,7 @@ TracyLlmTools::ToolReply TracyLlmTools::SearchWikipedia( std::string query, cons output["key"] = key; output["title"] = summaryJson["title"]; if( summaryJson.contains( "description" ) ) output["description"] = summaryJson["description"]; - output["extract"] = summaryJson["extract"]; + output["preview"] = summaryJson["extract"]; std::string image; if( summaryJson.contains( "thumbnail" ) ) @@ -508,7 +508,7 @@ std::string TracyLlmTools::SearchWeb( std::string query ) auto& item = json["items"][i]; nlohmann::json result; result["title"] = RemoveNewline( item["title"].get_ref() ); - result["snippet"] = RemoveNewline( item["snippet"].get_ref() ); + result["preview"] = RemoveNewline( item["snippet"].get_ref() ); result["url"] = RemoveNewline( item["link"].get_ref() ); results[i] = result; } @@ -543,7 +543,7 @@ std::string TracyLlmTools::SearchWeb( std::string query ) nlohmann::json result; result["title"] = RemoveNewline( title.text().as_string() ); - result["snippet"] = RemoveNewline( snippet.text().as_string() ); + result["preview"] = RemoveNewline( snippet.text().as_string() ); result["url"] = RemoveNewline( url.text().as_string() ); json[i] = result;