Show more specific warning to llm on duplicate tool use during research

This commit is contained in:
Debanjum
2025-08-15 14:17:35 -07:00
parent caf0b994e8
commit 4274f58dbd
2 changed files with 2 additions and 2 deletions

View File

@@ -197,7 +197,7 @@ async def apick_next_tool(
if i.warning is None and isinstance(i.query, ToolCall) if i.warning is None and isinstance(i.query, ToolCall)
} }
if (parsed_response.name, dict_to_tuple(parsed_response.args)) in previous_tool_query_combinations: if (parsed_response.name, dict_to_tuple(parsed_response.args)) in previous_tool_query_combinations:
warning = "Repeated tool, query combination detected. Skipping iteration. Try something different." warning = f"Repeated tool, query combination detected. You've already called {parsed_response.name} with args: {parsed_response.args}. Try something different."
# Only send client status updates if we'll execute this iteration and model has thoughts to share. # Only send client status updates if we'll execute this iteration and model has thoughts to share.
elif send_status_func and not is_none_or_empty(response.thought): elif send_status_func and not is_none_or_empty(response.thought):
async for event in send_status_func(response.thought): async for event in send_status_func(response.thought):

View File

@@ -588,7 +588,7 @@ tools_for_research_llm = {
description=dedent( description=dedent(
""" """
To have the tool AI semantic search through the user's knowledge base. To have the tool AI semantic search through the user's knowledge base.
Helpful to answer questions for which finding some relevant notes or documents can complete the search. Example: "When was Tom born?" Helpful to answer questions for which finding some relevant notes or documents can be useful. Example: "When was Tom born?"
This tool AI cannot find all relevant notes or documents, only a subset of them. This tool AI cannot find all relevant notes or documents, only a subset of them.
It is a good starting point to find keywords, discover similar topics or related concepts and some relevant notes or documents. It is a good starting point to find keywords, discover similar topics or related concepts and some relevant notes or documents.
For a given query, the tool AI can perform a maximum of {max_search_queries} semantic search subqueries per iteration. For a given query, the tool AI can perform a maximum of {max_search_queries} semantic search subqueries per iteration.