Skip to content

Commit 7ec7e94

Browse files
Add UI formatting for tavily_search and parallel_search tool displays
1 parent 76bfe39 commit 7ec7e94

File tree

1 file changed

+23
-1
lines changed
  • libs/deepagents-cli/deepagents_cli

1 file changed

+23
-1
lines changed

libs/deepagents-cli/deepagents_cli/ui.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,34 @@ def abbreviate_path(path_str: str, max_length: int = 60) -> str:
8080
return f"{tool_name}({path})"
8181

8282
elif tool_name == "web_search":
83-
# Web search: show the query string
83+
# Web search: show the query string (backward compatibility)
8484
if "query" in tool_args:
8585
query = str(tool_args["query"])
8686
query = truncate_value(query, 100)
8787
return f'{tool_name}("{query}")'
8888

89+
elif tool_name == "tavily_search":
90+
# Tavily search: show the query string
91+
if "query" in tool_args:
92+
query = str(tool_args["query"])
93+
query = truncate_value(query, 100)
94+
return f'{tool_name}("{query}")'
95+
96+
elif tool_name == "parallel_search":
97+
# Parallel search: show the queries list
98+
if "queries" in tool_args:
99+
queries = tool_args["queries"]
100+
if isinstance(queries, list):
101+
# Show first query + count if multiple
102+
if len(queries) == 1:
103+
return f'{tool_name}("{queries[0]}")'
104+
else:
105+
first = truncate_value(str(queries[0]), 80)
106+
return f'{tool_name}("{first}" + {len(queries)-1} more)'
107+
else:
108+
queries_str = truncate_value(str(queries), 100)
109+
return f'{tool_name}({queries_str})'
110+
89111
elif tool_name == "grep":
90112
# Grep: show the search pattern
91113
if "pattern" in tool_args:

0 commit comments

Comments
 (0)