Change DuckDuckGoSearchTool output_type to string (#116)

* Change DuckDuckGoSearchTool output_type to string and update description accordingly
This commit is contained in:
Aymeric Roucher 2025-01-08 09:59:58 +01:00 committed by GitHub
parent 681758ae84
commit e5d879feab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -146,12 +146,11 @@ class UserInputTool(Tool):
class DuckDuckGoSearchTool(Tool):
name = "web_search"
description = """Performs a duckduckgo web search based on your query (think a Google search) then returns the top search results as a list of dict elements.
Each result has keys 'title', 'href' and 'body'."""
description = """Performs a duckduckgo web search based on your query (think a Google search) then returns the top search results."""
inputs = {
"query": {"type": "string", "description": "The search query to perform."}
}
output_type = "any"
output_type = "string"
def __init__(self, *args, max_results=10, **kwargs):
super().__init__(*args, **kwargs)

View File

@ -35,9 +35,7 @@ def pull_messages_from_step(step_log: AgentStep, test_mode: bool = True):
content=str(content),
)
if step_log.observations is not None:
yield gr.ChatMessage(
role="assistant", content=step_log.observations
)
yield gr.ChatMessage(role="assistant", content=step_log.observations)
if step_log.error is not None:
yield gr.ChatMessage(
role="assistant",