Change DuckDuckGoSearchTool output_type to string (#116)
* Change DuckDuckGoSearchTool output_type to string and update description accordingly
This commit is contained in:
		
							parent
							
								
									681758ae84
								
							
						
					
					
						commit
						e5d879feab
					
				|  | @ -146,12 +146,11 @@ class UserInputTool(Tool): | ||||||
| 
 | 
 | ||||||
| class DuckDuckGoSearchTool(Tool): | class DuckDuckGoSearchTool(Tool): | ||||||
|     name = "web_search" |     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. |     description = """Performs a duckduckgo web search based on your query (think a Google search) then returns the top search results.""" | ||||||
|     Each result has keys 'title', 'href' and 'body'.""" |  | ||||||
|     inputs = { |     inputs = { | ||||||
|         "query": {"type": "string", "description": "The search query to perform."} |         "query": {"type": "string", "description": "The search query to perform."} | ||||||
|     } |     } | ||||||
|     output_type = "any" |     output_type = "string" | ||||||
| 
 | 
 | ||||||
|     def __init__(self, *args, max_results=10, **kwargs): |     def __init__(self, *args, max_results=10, **kwargs): | ||||||
|         super().__init__(*args, **kwargs) |         super().__init__(*args, **kwargs) | ||||||
|  |  | ||||||
|  | @ -35,9 +35,7 @@ def pull_messages_from_step(step_log: AgentStep, test_mode: bool = True): | ||||||
|                 content=str(content), |                 content=str(content), | ||||||
|             ) |             ) | ||||||
|         if step_log.observations is not None: |         if step_log.observations is not None: | ||||||
|             yield gr.ChatMessage( |             yield gr.ChatMessage(role="assistant", content=step_log.observations) | ||||||
|                 role="assistant", content=step_log.observations |  | ||||||
|             ) |  | ||||||
|         if step_log.error is not None: |         if step_log.error is not None: | ||||||
|             yield gr.ChatMessage( |             yield gr.ChatMessage( | ||||||
|                 role="assistant", |                 role="assistant", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue