Skip to main content

A2A conversion helpers for app-owned Agent Framework hosting.

Project description

agent-framework-hosting-a2a

A2A conversion helpers for app-owned Agent Framework hosting.

The package deliberately does not choose a web framework or wrap the A2A SDK server lifecycle. It provides two conversion functions:

  • a2a_to_run(...) converts a native A2A Message into Agent Framework run arguments.
  • a2a_from_run(...) converts an AgentResponse, Message, or streaming AgentResponseUpdate into native A2A Part values.

Application code keeps ownership of the A2A SDK's AgentExecutor, RequestContext, TaskUpdater, event queue, task store, routes, task state, artifact IDs, authentication, and deployment.

a2a_from_run(...) preserves content-level metadata on each returned part and flattens completed responses in message order. The application decides how to group those parts into A2A messages or artifacts and owns their message-level metadata and boundaries.

run = a2a_to_run(context.message)
session_id = f"a2a:{context.tenant}:{context.context_id}"
session = await state.get_or_create_session(session_id)
result = await agent.run(
    run["messages"],
    session=session,
    options=run["options"],
)
await state.set_session(session_id, session)
parts = a2a_from_run(result)

# Native A2A SDK application code publishes `parts` with TaskUpdater.

The surrounding A2A application may use Starlette, FastAPI, another ASGI framework, or the SDK's own application builders. These helpers do not care.

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

agent_framework_hosting_a2a-1.0.0a260721.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file agent_framework_hosting_a2a-1.0.0a260721.tar.gz.

File metadata

  • Download URL: agent_framework_hosting_a2a-1.0.0a260721.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 agent_framework_hosting_a2a-1.0.0a260721.tar.gz
Algorithm Hash digest
SHA256 4ae183518f0294df504b8bb13dbe05486345b2b781321a0fd73a8dd1c1ea43f5
MD5 57a50b69358a3ee37cacba015446750e
BLAKE2b-256 9904c11ad0c189072859ff85f2e8d935deae9d76ddb9908f4e8b40e892b22208

See more details on using hashes here.

File details

Details for the file agent_framework_hosting_a2a-1.0.0a260721-py3-none-any.whl.

File metadata

  • Download URL: agent_framework_hosting_a2a-1.0.0a260721-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 agent_framework_hosting_a2a-1.0.0a260721-py3-none-any.whl
Algorithm Hash digest
SHA256 72a20f31746e0879b6e85e07b10b3d8d15285bd9e1429d4eb92e29fce9feda34
MD5 41a45f53a78842edf141544591f2f7f2
BLAKE2b-256 9fef108bd437c4107963b1231ae55480c2c207470aca7d53583a645db7b743c7

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