Skip to content
tair-opensourcePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

a2a-tair

Tair-backed storage for the Agent2Agent Python SDK.

Install

pip install a2a-tair

Requires Python 3.10+, a2a-sdk>=1.1.2,<2, and a Redis protocol-compatible Tair endpoint.

Components

Component Backend A2A interface
TaskRepository Tair Hash TaskStore
JsonTaskRepository TairJSON TaskStore
NotificationRegistry Tair Hash PushNotificationConfigStore

Task repositories live in a2a_tair.tasks; notification registration lives in a2a_tair.notifications. The previous names HashTaskStorage, JsonTaskStorage and PushConfigStorage remain compatibility aliases at the package root and in a2a_tair.storage. Existing data and constructor arguments are unchanged.

Usage

import os

from a2a.server.request_handlers import DefaultRequestHandler
from a2a_tair import NotificationRegistry, TaskRepository, connect

client = connect(os.environ["TAIR_URL"])

request_handler = DefaultRequestHandler(
    agent_executor=agent_executor,
    agent_card=agent_card,
    task_store=TaskRepository(client),
    push_config_store=NotificationRegistry(client),
)

Use JsonTaskRepository(client) when the endpoint supports TairJSON. Close the client during application shutdown:

await client.aclose()

The stores follow the A2A SDK's owner scope, filtering, sorting, and page-token pagination. Unauthenticated requests share the default empty owner scope; use authentication or a custom owner_resolver for tenant isolation. The default key prefix is a2a:tair:. connect() uses binary responses because Task and Push configuration values contain Protobuf data.

Demo

The wheel includes an optional Google ADK Demo using an OpenAI-compatible model API:

uvx --from "a2a-tair[demo]" a2a-tair-demo server --skill-dir ./alibabacloud-tair-devtoolset

In another terminal:

uvx --from "a2a-tair[demo]" a2a-tair-demo client

See examples/tair_guide_agent/README.md in the source repository for Skill download and environment configuration.

Development

uv sync --all-groups --extra demo
uv run ruff check .
uv run ruff format --check .
uv run ty check src tests
uv run pytest -q -W error
uv build

Set TEST_REDIS_URL for the Redis protocol smoke test, TAIR_URL for the Tair smoke test, and TAIR_JSON_URL for the TairJSON smoke test.

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages