Metadata-Version: 2.4
Name: parallel-google-adk
Version: 0.0.1
Summary: Google ADK FunctionTools and Plugin for Parallel APIs (search, extract, deep research).
Project-URL: Homepage, https://parallel.ai
Project-URL: Documentation, https://github.com/parallel-web/parallel-google-adk#readme
Project-URL: Repository, https://github.com/parallel-web/parallel-google-adk
Project-URL: Issues, https://github.com/parallel-web/parallel-google-adk/issues
Author-email: Parallel <support@parallel.ai>
License: MIT
License-File: LICENSE
Keywords: ai-agents,google-adk,parallel,rag,research,web-search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: google-adk>=1.31
Requires-Dist: parallel-web>=0.5.1
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: respx>=0.20; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# parallel-google-adk

Google [Agent Development Kit](https://adk.dev) (ADK) tools and plugin for [Parallel](https://parallel.ai) — grounded web search, clean extraction, and cited deep research with structured output.

## Install

```bash
pip install parallel-google-adk
export PARALLEL_API_KEY=your-key-here  # get one at https://platform.parallel.ai
```

## Quickstart

```python
import os
from google.adk.agents import LlmAgent
from google.adk.runners import Runner

from parallel_google_adk import (
    web_search, web_fetch, extract,
    deep_research, enrich,
    ParallelTracingPlugin,
)

agent = LlmAgent(
    model="gemini-flash-latest",
    name="research_agent",
    instruction=(
        "You are a research assistant. Use web_search to find sources, "
        "web_fetch or extract for specific URLs, and deep_research for "
        "comprehensive cited reports."
    ),
    tools=[web_search, web_fetch, extract, deep_research, enrich],
)

# Plugins attach to the Runner, not the agent.
runner = Runner(agent=agent, app_name="my-app", plugins=[ParallelTracingPlugin()])
```

## Tools

| Tool | What it does |
|---|---|
| `web_search` | Grounded web search returning citation-aware excerpts. |
| `web_fetch` | Clean content from a single URL. Handles JS and PDFs. |
| `extract` | Batch extraction across 1–20 URLs with optional objective. |
| `deep_research` | Multi-hop investigation with per-claim citations. Returns a markdown report. |
| `enrich` | Structured (JSON-Schema-conforming) enrichment of a list of entities. |

## Plugin

`ParallelTracingPlugin` records latency, citation count, and (when reported) cost for every Parallel tool call. Read the trace from `tool_context.state["_parallel_calls"]`.

## MCP alternative

If you only want Search and don't want a Python dependency, the [Parallel Search MCP](https://docs.parallel.ai/integrations/mcp/search-mcp) works with ADK's `MCPToolset`:

```python
import os
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

MCPToolset(
    connection_params=StreamableHTTPConnectionParams(
        url="https://search.parallel.ai/mcp",
        headers={"Authorization": f"Bearer {os.environ['PARALLEL_API_KEY']}"},
    ),
)
```

This package is the typed-FunctionTool path for users who want fine-grained schemas, hidden polling, structured enrichment, and tracing.

## Examples

See [`examples/research_agent.py`](examples/research_agent.py) for a runnable demo.

## Development

```bash
pip install -e ".[dev]"
pytest                              # unit tests (no network)
pytest tests/integration/           # live API smoke (needs PARALLEL_API_KEY + GOOGLE_API_KEY)
```

## License

MIT
