Skip to content

Commit c051a10

Browse files
committed
Version bump to 0.2.8 and add raw_content support to TavilyTool search method
1 parent 114b881 commit c051a10

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

praisonai_tools/tools/tavily_tool.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def run(
7272
else:
7373
return {"error": f"Unknown action: {action}"}
7474

75-
def search(self, query: str, max_results: int = 5) -> Dict[str, Any]:
75+
def search(self, query: str, max_results: int = 5, include_raw_content: bool = True) -> Dict[str, Any]:
7676
"""Search the web."""
7777
if not query:
7878
return {"error": "query is required"}
@@ -85,6 +85,7 @@ def search(self, query: str, max_results: int = 5) -> Dict[str, Any]:
8585
query=query,
8686
search_depth=self.search_depth,
8787
include_answer=self.include_answer,
88+
include_raw_content=include_raw_content,
8889
max_results=max_results,
8990
)
9091

@@ -95,12 +96,16 @@ def search(self, query: str, max_results: int = 5) -> Dict[str, Any]:
9596

9697
results = []
9798
for r in response.get("results", []):
98-
results.append({
99+
item = {
99100
"title": r.get("title"),
100101
"url": r.get("url"),
101102
"content": r.get("content"),
102103
"score": r.get("score"),
103-
})
104+
}
105+
# Include raw_content (full page) if available
106+
if r.get("raw_content"):
107+
item["raw_content"] = r.get("raw_content")
108+
results.append(item)
104109
result["results"] = results
105110

106111
return result

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "praisonai-tools"
3-
version = "0.2.7"
3+
version = "0.2.8"
44
description = "Extended tools for PraisonAI Agents"
55
authors = [
66
{name = "Mervin Praison"}

0 commit comments

Comments
 (0)