Skip to main content

Python A2A SDK for Telecom Scenarios

Project description

a2a-t-sdk-python

Python License

Python SDK used to generate task prompts and handle task negotiation flows based on the A2A-T protocol.
基于A2A-T协议用于生成任务提示词并处理任务协商流程的Python SDK。

中文


Project Overview

a2a-t-sdk-python 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, 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.
  • Negotiation types: Includes one built-in negotiation type: information.
  • Resource organization: Built-in prompt resources are located in package_data/prompt_resources, containing prompts, scenarios, slots, and templates.

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 validation and negotiation entry points for A2A-T protocol messages.
  • 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
  • ruff
  • mypy

The recommended minimal development workflow is as follows:

cd {project_path}/a2a-t-sdk-python
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 adaptation layer.
  • 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-center.
  • 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-1.0.0.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-1.0.0-py3-none-any.whl (119.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: a2a_t_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for a2a_t_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 908abf737cd73e5fe5c1fc48bd222b26054feb82db3803c8c7d51608daa02112
MD5 901203ffb660df12db76ad196f9a2467
BLAKE2b-256 cbb797724f26c22fb450576fe9cf3473fddc275685cbb60a53b85d2abf8b3be2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: a2a_t_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 119.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for a2a_t_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0fcaeb3f592f70e80f4c69433974082213be5dc2c3b9b9852a1c93a63a58f18
MD5 6671e319f3bd8146b8cd316a7bc2c09c
BLAKE2b-256 725a41399524fc86ef879b9ca49015de26736f2c5363837519a4ee911efc9d5b

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