GitHunt
JA

Jacksunwei/adkx-python

Extensions and utilities for Google ADK

adkx - Extensions for Google ADK

PyPI status
PyPI version
Python Versions
License

Tests
Lint
pre-commit

Production-ready extensions and experimental features for Google's Agent Development Kit

This package provides production-ready extensions and utilities built on top of Google ADK. It also serves as a testing ground for experimental features that may introduce breaking changes to ADK 1.x. Successful features may be upstreamed to the official ADK.

Status

๐Ÿšง Early Development - APIs are subject to change

Features

Multi-Model Support

  • Gemini Models - Enhanced Gemini integration with streaming support
  • OpenAI-Compatible Providers - Unified interface for:
    • OpenAI (GPT-4o, GPT-4 Turbo)
    • Local Ollama (Qwen, Llama, etc.)
    • Ollama on Google Cloud Run

Advanced Tool System

  • FunctionTool - Convert Python functions to ADK tools with automatic schema generation
  • Multi-Modal Responses - Tools can return images, files, and structured data (ADR-0002)

Developer Experience

  • Type Safety - Full type hints and Pydantic models throughout
  • Async First - Built for async/await workflows
  • Streaming - Efficient streaming for all supported models

Installation

pip install adkx

Quick Start

Simple Weather Agent

from adkx.agents.agent import Agent
from adkx.tools.function_tool import FunctionTool, ToolResult


async def get_weather(location: str) -> ToolResult:
    """Get current weather for a location."""
    # Your weather API logic here
    return ToolResult(details=[f"Weather in {location}: Sunny, 72ยฐF"])


agent = Agent(
    model="gemini-2.0-flash-exp",
    name="WeatherBot",
    description="A helpful weather assistant",
    tools=[FunctionTool(get_weather)],
)

Multi-Modal Image Generation

from google.genai import types
from adkx.tools.function_tool import FunctionTool, ToolResult


async def create_image(prompt: str) -> ToolResult:
    """Generate an image from a text description."""
    # Generate image using Gemini
    response = await client.aio.models.generate_content(
        model="gemini-2.5-flash-image",
        contents=prompt,
        config=types.GenerateContentConfig(response_modalities=["IMAGE"]),
    )

    image_data = response.candidates[0].content.parts[0].inline_data.data

    return ToolResult(
        details=[
            f"Generated image for: {prompt}",
            types.Blob(data=image_data, mime_type="image/jpeg"),
        ]
    )

Using OpenAI-Compatible Models

from adkx.agents.agent import Agent
from adkx.models.openai_compatible_providers import OpenAI, Ollama

# OpenAI
agent = Agent(model=OpenAI(model="gpt-4o"), tools=[...])

# Local Ollama
agent = Agent(model=Ollama(model="qwen3:8b"), tools=[...])

Samples

Complete working examples are available in the samples/ directory:

Documentation

Model Compatibility

Provider Models Streaming Function Calling
Gemini 2.0 Flash, 2.5 Flash, Pro โœ… โœ…
OpenAI GPT-4o, GPT-4 Turbo, GPT-4o mini โœ… โœ…
Ollama (Local) Qwen, Llama, Mistral, DeepSeek โœ… โœ…
Ollama (Cloud) Same as local, hosted on GCP โœ… โœ…

Development

# Clone repository
git clone https://github.com/Jacksunwei/adkx-python.git
cd adkx-python

# Setup environment
uv venv --python python3.11 .venv
source .venv/bin/activate

# Install dependencies
uv sync --all-extras

# Install pre-commit hooks
pre-commit install

# Run tests
pytest tests/

# Format code
./autoformat.sh

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for:

  • Development setup
  • Code style requirements
  • Testing guidelines
  • PR submission process

Feedback

License

Apache 2.0 - See LICENSE

Jacksunwei/adkx-python | GitHunt