Implementation of the AG-UI protocol for Langroid.
Project description
ag-ui-langroid
Implementation of the AG-UI protocol for Langroid.
Provides a complete Python integration for Langroid agents with the AG-UI protocol, including FastAPI endpoint creation and comprehensive event streaming.
Installation
pip install ag-ui-langroid
Usage
from langroid import Agent
from langroid.language_models import OpenAIChatModel
from ag_ui_langroid import LangroidAgent, create_langroid_app
# Create a Langroid agent
model = OpenAIChatModel()
agent = Agent(
name="assistant",
system_message="You are a helpful assistant.",
llm=model,
)
# Wrap with AG-UI adapter
agui_agent = LangroidAgent(
agent=agent,
name="agentic_chat",
description="Conversational Langroid agent with AG-UI streaming",
)
# Create FastAPI app
app = create_langroid_app(agui_agent, "/")
Features
- Native Langroid integration – Direct support for Langroid agents and tools
- FastAPI endpoint creation – Automatic HTTP endpoint generation with proper event streaming
- Advanced event handling – Comprehensive support for all AG-UI events including tool calls and state updates
- Message translation – Seamless conversion between AG-UI and Langroid message formats
Examples
See the examples/ directory for complete working examples demonstrating:
- Agentic chat
- Tool-based generative UI
- Backend tool rendering
- Shared state management
- Human-in-the-loop interactions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ag_ui_langroid-0.1.1.tar.gz.
File metadata
- Download URL: ag_ui_langroid-0.1.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b51999c12d7557d35a45830cd13e816f00ca4a3fcfeef0514aa324e70e5a53c
|
|
| MD5 |
6418be02f9e55c48c5daba5503cfa95e
|
|
| BLAKE2b-256 |
af58051fde1251956032eeb094107ce3793ba89f13d9d15c23748683ebfaaaf6
|
File details
Details for the file ag_ui_langroid-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ag_ui_langroid-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098ef19dce80f79a58b363f6b6dcf52783f2a82a47f2b909a0998837dec3549c
|
|
| MD5 |
d14e0f88c5a0e65d183049a8df21ff61
|
|
| BLAKE2b-256 |
f29128fe520efe9fd88549dd5ba437a7774344413e0c2e2ae4517f295597fca6
|