Merge pull request #13 from eltociear/main

Update serper_dev_tool.py
This commit is contained in:
João Moura
2024-05-02 02:28:24 -03:00
committed by GitHub

View File

@@ -31,10 +31,10 @@ class SerperDevTool(BaseTool):
results = response.json()
if 'organic' in results:
results = results['organic']
stirng = []
string = []
for result in results:
try:
stirng.append('\n'.join([
string.append('\n'.join([
f"Title: {result['title']}",
f"Link: {result['link']}",
f"Snippet: {result['snippet']}",
@@ -43,7 +43,7 @@ class SerperDevTool(BaseTool):
except KeyError:
next
content = '\n'.join(stirng)
content = '\n'.join(string)
return f"\nSearch results: {content}\n"
else:
return results