Skip to main content

Python A2A SDK for Telecom Scenarios

Project description

a2a-t-sdk

Project Overview

a2a-t-sdk is a Python SDK targeting telecom scenarios, used to generate task prompts and handle task negotiation flows.

This SDK is primarily aimed at two types of users:

  • Client: Generates task prompts based on user input, and initiates, receives, and advances negotiation flows.
  • Server: Validates processed task prompts that conform to the SDK format, and initiates, receives, and advances negotiation flows.

Core Capabilities

  • Task prompt generation pipeline: Covers input normalization, scenario recognition, slot extraction, slot validation, and task prompt rendering.
  • Client API: Provides a task prompt generation result stream, along with negotiation entry points such as start_negotiation, receive_negotiation, and continue_negotiation.
  • Server validation API: Targets processed task prompts that conform to the SDK format, performing metadata parsing, slot extraction, and slot validation, with support for optional guardrail hooks.
  • Negotiation types: Includes four built-in negotiation types: information, clarification, feasibility, and fulfillment.
  • Resource organization: Built-in prompt resources are located in package_data/prompt_resources, containing prompts, scenarios, slots, and templates.
  • Built-in example scenario: The current package only provides subscribe_incident.

Project Structure

The core code of the repository is located in src/a2a_t, with the main modules as follows:

  • client: Client wrapper, providing task prompt generation and negotiation entry points.
  • server: Server wrapper, providing processed task prompt validation and negotiation entry points.
  • common: Shared prompt resource loading and common runtime capabilities.
  • config: Model-related configuration and its loading logic.
  • llm: LLM adaptation layer, client, and session storage abstraction.
  • negotiation: Negotiation types, runtime processing, and state storage.
  • prompt: Capabilities related to task prompt formatting, analysis, rendering, and validation.

Installation and Environment Requirements

  • Python requirement: >=3.12
  • Package name: a2a-t-sdk
  • License: Apache-2.0
  • Build backend: uv_build

Before getting started, it is recommended to first copy package_data/env.example to package_data/.env.

Development and Testing

The project uses uv_build as its build backend. Development dependencies include:

  • pytest
  • pytest-asyncio
  • pytest-cov
  • ruff
  • mypy

The recommended minimal development workflow is as follows:

uv sync --dev
uv run pytest
uv run ruff check .
uv run mypy src

The tests/ directory contains test cases for client prompt generation, server validation, negotiation runtime, prompt resources, and LLM adaptation. For external contributors, it is recommended to prioritize running the tests and static checks relevant to the current change.

Current Scope of Support

Before use, it is recommended to confirm the following limitations:

  • The built-in LLM invocation chain is unified externally as an OpenAI-compatible adaptation layer.
  • The built-in guardrail mechanism currently only provides noop.
  • Prompt resources currently only support local files.
  • Negotiation state storage currently only provides an in-memory implementation and does not guarantee persistence.
  • The bundled resources and language coverage are limited, and do not include remote resource loading capabilities such as registry.
  • This document primarily introduces the SDK itself, and does not cover the CLI, hosted services, deployment processes, or ready-to-use application solutions.

License

This project is licensed under the Apache-2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2a_t_sdk-0.1.9.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2a_t_sdk-0.1.9-py3-none-any.whl (119.7 kB view details)

Uploaded Python 3

File details

Details for the file a2a_t_sdk-0.1.9.tar.gz.

File metadata

  • Download URL: a2a_t_sdk-0.1.9.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for a2a_t_sdk-0.1.9.tar.gz
Algorithm Hash digest
SHA256 27d13427f236bfc8290db91d94f515b107751c8d55b80532f76b05e15ee8a1ce
MD5 1f2141efb2077ba6f8636a16747bcfbf
BLAKE2b-256 ef4d9e6b4288144a69056ecd9df39361b8dd7e4be0bf935fea1802169a2609c7

See more details on using hashes here.

File details

Details for the file a2a_t_sdk-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: a2a_t_sdk-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 119.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for a2a_t_sdk-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1225d008b0d0d3f6f47e74d0ddc9a8918868da29cf122bcbae6a05153734b804
MD5 1020d8cf9a7ce302d08639e2b5601cb5
BLAKE2b-256 450953f9974bdb279463ed5f6505562301b66e4014a5447d72af1eab5722dee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page