Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 61 additions & 119 deletions README.md

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions cookbook/agno/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ def main() -> None:
web_search(
provider="agno",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
news_search(
provider="agno",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
shopping_search(
provider="agno",
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
],
Expand Down
5 changes: 3 additions & 2 deletions cookbook/autogen/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ async def main() -> None:
web_search(
provider="autogen",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
news_search(
provider="autogen",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
),
],
reflect_on_tool_use=True,
Expand Down
5 changes: 3 additions & 2 deletions cookbook/claude-agent-sdk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ async def main() -> None:
web_search(
provider="claude-agent-sdk",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
news_search(
provider="claude-agent-sdk",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
),
],
)
Expand Down
5 changes: 3 additions & 2 deletions cookbook/google-adk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ async def main() -> None:
web_search(
provider="google-adk",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
news_search(
provider="google-adk",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
],
Expand Down
5 changes: 3 additions & 2 deletions cookbook/haystack/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def main() -> None:
tools=[
news_search(
provider="haystack",
default_params={"num": "7", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=7,
),
web_search(
provider="haystack",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
],
max_agent_steps=8,
Expand Down
5 changes: 3 additions & 2 deletions cookbook/langchain/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ def main() -> None:
web_search(
provider="langchain",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
news_search(
provider="langchain",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
],
Expand Down
7 changes: 4 additions & 3 deletions cookbook/langgraph/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ def main() -> None:
web_search(
provider="langgraph",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
news_search(
provider="langgraph",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
),
shopping_search(
provider="langgraph",
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
]
model = ChatOpenAI(
Expand Down
2 changes: 1 addition & 1 deletion cookbook/llamaindex/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def main() -> None:
web_search(
provider="llamaindex",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
api_key=api_key,
),
maps_search(
Expand Down
5 changes: 3 additions & 2 deletions cookbook/microsoft-agent-framework/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ async def main() -> None:
tools=[
news_search(
provider="microsoft-agent-framework",
default_params={"num": "8", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=8,
),
web_search(
provider="microsoft-agent-framework",
allowed_engines=["google_light", "bing"],
default_params={"num": "6", "hl": "en", "gl": "us"},
result_limit=6,
),
],
)
Expand Down
5 changes: 3 additions & 2 deletions cookbook/openai-agents/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ async def main() -> None:
web_search(
provider="openai-agents",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
news_search(
provider="openai-agents",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
),
],
)
Expand Down
5 changes: 3 additions & 2 deletions cookbook/pydantic-ai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def main() -> None:
tools=[
images_search(
provider="pydantic-ai",
default_params={"num": "5", "hl": "en", "gl": "us", "safe": "active"},
default_params={"hl": "en", "gl": "us", "safe": "active"},
result_limit=5,
),
maps_search(
provider="pydantic-ai",
Expand All @@ -68,7 +69,7 @@ def main() -> None:
web_search(
provider="pydantic-ai",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
],
)
Expand Down
5 changes: 3 additions & 2 deletions cookbook/semantic-kernel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ async def main() -> None:
web_search(
provider="semantic-kernel",
allowed_engines=["google_light", "bing"],
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
),
news_search(
provider="semantic-kernel",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
),
],
)
Expand Down
8 changes: 5 additions & 3 deletions cookbook/smolagents/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ def main() -> None:
tools=[
shopping_search(
provider="smolagents",
default_params={"num": "5", "hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
images_search(
provider="smolagents",
default_params={"num": "5", "hl": "en", "gl": "us", "safe": "active"},
default_params={"hl": "en", "gl": "us", "safe": "active"},
result_limit=5,
include_examples=False,
),
videos_search(
provider="smolagents",
default_params={"num": "5", "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
),
],
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk_examples/agno.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ main trade-offs.”
products = shopping_search(
allowed_engines=["google_shopping", "amazon"],
default_engine="google_shopping",
default_params={"num": 3, "hl": "en", "gl": "us"},
result_limit=3,
)
```

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk_examples/autogen.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ trend.”

```python
current_news = news_search(
default_params={"num": 3, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=3,
include_examples=False,
)
```
Expand Down
3 changes: 2 additions & 1 deletion docs/sdk_examples/claude_agent_sdk.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ what changed.

```python
current_news = news_search(
default_params={"num": 3, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=3,
name="current_news",
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk_examples/crewai.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ practical impact of each.
products = shopping_search(
allowed_engines=["google_shopping", "amazon"],
default_engine="google_shopping",
default_params={"num": 3, "hl": "en", "gl": "us"},
result_limit=3,
)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk_examples/google_adk.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ useful features.”
products = shopping_search(
allowed_engines=["google_shopping", "walmart"],
default_engine="google_shopping",
default_params={"num": 3, "hl": "en", "gl": "us"},
result_limit=3,
include_examples=False,
)
```
2 changes: 1 addition & 1 deletion docs/sdk_examples/langgraph.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ checklist.”
multi_source_search = web_search(
allowed_engines=["google", "bing", "duckduckgo"],
default_engine="google",
default_params={"num": 5, "hl": "en"},
result_limit=5,
)
```

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk_examples/microsoft_agent_framework.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ important company claims, and cite the original sources.”
```python
current_news = news_search(
provider="microsoft-agent-framework",
default_params={"num": 5, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
)
```
Expand Down
3 changes: 2 additions & 1 deletion docs/sdk_examples/openai_agents.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ one matters.”

```python
current_news = news_search(
default_params={"num": 3, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=3,
)
```

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk_examples/pydantic_ai.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ themes.”

```python
image_search = images_search(
default_params={"num": 5, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
include_examples=False,
)
```
Expand Down
1 change: 0 additions & 1 deletion docs/sdk_examples/semantic_kernel.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ first three Google results.
privacy_search = web_search(
allowed_engines=["duckduckgo", "bing"],
default_engine="duckduckgo",
default_params={"hl": "en"},
include_examples=False,
name="privacy_search",
)
Expand Down
5 changes: 1 addition & 4 deletions docs/user_guide/01-introduction.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ response = json.loads(search(query="Python packaging"))
print(response.get("organic_results", []))
```

Every tool returns compact JSON text by default: only its primary result
families, bounded to five entries, plus useful web answer sections. Application
code can opt into the untouched response with
`mode=SearchResultMode.FULL`.
Every tool returns compact JSON text by default, including its main result sections and useful web answer sections. `result_limit` controls how many items are kept in each result list in compact and full modes. Set `mode=SearchResultMode.FULL` and `result_limit=None` when application code needs every response section, field, and returned result.

## Next steps

Expand Down
3 changes: 2 additions & 1 deletion docs/user_guide/02-quickstart.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ from serpapi_search_tools import web_search

tool = web_search(
allowed_engines=["google_light"],
default_params={"num": 5, "hl": "en", "gl": "us"},
default_params={"hl": "en", "gl": "us"},
result_limit=5,
name="current_web_research",
)
```
Expand Down
Loading
Loading