Update tools.py
Browse filesfix " problem
tools.py
CHANGED
|
@@ -44,8 +44,8 @@ def web_search(query: str) -> str:
|
|
| 44 |
search_docs = TavilySearch(max_results=3).invoke(input=query)
|
| 45 |
formatted_search_docs = "\n\n---\n\n".join(
|
| 46 |
[
|
| 47 |
-
f'<Document title="{doc["title"]}" url="{doc[
|
| 48 |
-
for doc in search_docs[
|
| 49 |
]
|
| 50 |
)
|
| 51 |
return {"web_results": formatted_search_docs}
|
|
|
|
| 44 |
search_docs = TavilySearch(max_results=3).invoke(input=query)
|
| 45 |
formatted_search_docs = "\n\n---\n\n".join(
|
| 46 |
[
|
| 47 |
+
f'<Document title="{doc["title"]}" url="{doc["url"]}" confidence score="{doc["score"]}"/>\n</Document>{doc["content"]}\n</Document>\n'
|
| 48 |
+
for doc in search_docs["results"]
|
| 49 |
]
|
| 50 |
)
|
| 51 |
return {"web_results": formatted_search_docs}
|