-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in built-in DuckDuckGoSearchTool #86
Comments
Well spotted @rohitrawat ! Would you be interested to open a PR to fix the description, and change the |
# Why? The description is currently: 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'. But the return value was a Markdown string. As a result the code later was failing trying to access the 'body'/'href' key of the response See issue huggingface#86 # What ? The return value is a list of dict elements. This is as siginificantly different from the return value of the previous version of the tool. Fix huggingface#86
I have try to submit a fix for that: #107 Not sure if it what you have in mind @aymeric-roucher because I needed to change the tool return value from a markdown string to a dictionary. |
I was thinking the opposite @julien-duponchelle 😄 Making it a string is easier for the LLM to process afterwards. |
The
description
andoutput_type
imply that the tool 'returns the top search results as a list of dict elements':While the forward method simply returns a semi-structured string:
This leads to generated code expecting
results
to be a dict when it's really a string:which causes this error:
You're trying to subscript a string with a string index
.The text was updated successfully, but these errors were encountered: