-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Add duckduckgo search tool #32882
Add duckduckgo search tool #32882
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, clean! Cool that it doesn't require an API key 😁
code = "vendor = {'revenue': 31000, 'rent': 50312}; vendor['ratio'] = round(vendor['revenue'] / vendor['rent'], 2)" | ||
|
||
state = {} | ||
evaluate_python_code(code, {"min": min, "print": print, "round": round}, state=state) | ||
assert state["vendor"] == {"revenue": 31000, "rent": 50312, "ratio": 0.62} | ||
|
||
code = """ | ||
search_results = "[{'title': 'Paris, Ville de Paris, France Weather Forecast | AccuWeather', 'href': 'https://www.accuweather.com/en/fr/paris/623/weather-forecast/623', 'body': 'Get the latest weather forecast for Paris, Ville de Paris, France , including hourly, daily, and 10-day outlooks. AccuWeather provides you with reliable and accurate information on temperature ...'}]" | ||
for result in search_results: | ||
if 'current' in result['title'].lower() or 'temperature' in result['title'].lower(): | ||
current_weather_url = result['href'] | ||
print(current_weather_url) | ||
break""" | ||
with pytest.raises(InterpreterError) as e: | ||
evaluate_python_code(code, BASE_PYTHON_TOOLS, state={}) | ||
assert "You're trying to subscript a string with a string index" in e | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually this would benefit from being split so that individual failures don't impact other failures as much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I had bundled the tests by topic but I'll separate them again for a more granular evaluation.
0a52eca
to
c370365
Compare
1e4c817
to
d3948eb
Compare
* Add duckduckgo search tool
What does this PR do?
Add a search tool based on Duckduckgo API (does not need an API key).