Skip to main content

No project description provided

Project description

ag-ui-protocol

Python SDK for the Agent-User Interaction (AG-UI) Protocol.

ag-ui-protocol provides Python developers with strongly-typed data structures and event encoding for building AG-UI compatible agent servers. Built on Pydantic for robust validation and automatic camelCase serialization for seamless frontend integration.

Installation

pip install ag-ui-protocol
poetry add ag-ui-protocol
pipenv install ag-ui-protocol

Features

  • 🐍 Python-native – Idiomatic Python APIs with full type hints and validation
  • 📋 Pydantic models – Runtime validation and automatic JSON serialization
  • 🔄 Streaming events – 16 core event types for real-time agent communication
  • High performance – Efficient event encoding for Server-Sent Events

Quick example

from ag_ui.core import TextMessageContentEvent, EventType
from ag_ui.encoder import EventEncoder

# Create a streaming text event
event = TextMessageContentEvent(
    type=EventType.TEXT_MESSAGE_CONTENT,
    message_id="msg_123",
    delta="Hello from Python!"
)

# Encode for HTTP streaming
encoder = EventEncoder()
sse_data = encoder.encode(event)
# Output: data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"msg_123","delta":"Hello from Python!"}\n\n

Packages

  • ag_ui.core – Types, events, and data models for AG-UI protocol
  • ag_ui.encoder – Event encoding utilities for HTTP streaming

Documentation

Contributing

Bug reports and pull requests are welcome! Please read our contributing guide first.

License

MIT © 2025 AG-UI Protocol Contributors

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

ag_ui_protocol-0.1.9a0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

ag_ui_protocol-0.1.9a0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file ag_ui_protocol-0.1.9a0.tar.gz.

File metadata

  • Download URL: ag_ui_protocol-0.1.9a0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.1.0

File hashes

Hashes for ag_ui_protocol-0.1.9a0.tar.gz
Algorithm Hash digest
SHA256 fa67711134dc05bf4d490a715cb03105afdb7cc135436f506542e51c1288c630
MD5 2fd7ff070d1ef73105544e91ebe7e519
BLAKE2b-256 38b5df3a6d5224a627b3b51a961050857b97650448c2a4fc87dd5df16fe6bea7

See more details on using hashes here.

File details

Details for the file ag_ui_protocol-0.1.9a0-py3-none-any.whl.

File metadata

  • Download URL: ag_ui_protocol-0.1.9a0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.1.0

File hashes

Hashes for ag_ui_protocol-0.1.9a0-py3-none-any.whl
Algorithm Hash digest
SHA256 66974a27ae08a424552f4619a6615086c98500f12916f3e5094221c96daed7cb
MD5 27dec5093184bac0c158a5a2b0776e93
BLAKE2b-256 b40d6d8624c4b51b50411204ef9bdc19d68d835fd319f464653564a1eab8073c

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