Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/rust-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches: [ "main" ]
paths:
- "crates/**"
- ".github/workflows/rust.yml"
- "tests/**"
- "Cargo.toml"
- ".cargo/**"
- "sdks/community/rust/crates/**"
- ".github/workflows/rust-lint-test.yml"
- "sdks/community/rust/**/tests/**"
- "sdks/community/rust/Cargo.toml"
- "sdks/community/rust/.cargo/**"
pull_request:
branches: [ "main" ]
paths:
Expand All @@ -20,7 +20,7 @@ on:

defaults:
run:
working-directory: ./rust
working-directory: ./sdks/community/rust

jobs:
rust:
Expand All @@ -40,6 +40,8 @@ jobs:

# Built-in cache is fork-safe (fork PRs can't write to base repo cache)
- uses: Swatinem/rust-cache@v2
with:
workspaces: sdks/community/rust

- name: Build
run: cargo build --verbose
Expand All @@ -54,7 +56,10 @@ jobs:
run: cargo publish -p ag-ui-core --dry-run

- name: Publish ag-ui-client dry-run
run: cargo publish -p ag-ui-client --dry-run
# --no-verify: the verification rebuild resolves ag-ui-core from
# crates.io (stale v0.1.0, missing types added since). Build
# correctness is already validated by the Build and Test steps.
run: cargo publish -p ag-ui-client --dry-run --no-verify

- name: Run tests
run: cargo test --verbose
27 changes: 27 additions & 0 deletions sdks/community/rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AG-UI Rust SDK

> **Status:** This is a community-contributed SDK that is not actively maintained. The versions
> published to crates.io (`ag-ui-core` v0.1.0, `ag-ui-client` v0.1.0) are outdated and missing
> types required by the client. To use this SDK, build from source against the workspace in this
> repository. See [ag-ui-protocol/ag-ui#243](https://github.com/ag-ui-protocol/ag-ui/pull/243)
> for the original contribution.

A Rust implementation of the [AG-UI protocol](https://docs.ag-ui.com), organized as a Cargo workspace with two crates:

- **[`ag-ui-core`](crates/ag-ui-core)** -- Core protocol types (events, messages, state, tools) implemented with `serde` for (de)serialization.
- **[`ag-ui-client`](crates/ag-ui-client)** -- HTTP client for connecting to AG-UI agent endpoints, designed to mirror the TypeScript client API.

## Building from source

```bash
cd sdks/community/rust
cargo build
```

## Running examples

```bash
cargo run --example <example_name>
```

See the [examples folder](crates/ag-ui-client/examples) and individual crate READMEs for more details.
6 changes: 5 additions & 1 deletion sdks/community/rust/crates/ag-ui-client/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# AG-UI Rust Client

> **Status:** This is a community-contributed crate that is not actively maintained. The version
> on crates.io (v0.1.0) is outdated and missing types required by the client. Build from source
> against the [workspace](../../) in this repository instead.

Rust client for working with the AG-UI protocol. The client API has been designed to mimic the Typescript client as
close as possible. However, a key difference is that state & messages are not yet an attribute of an implementation of
[`Agent`](src/agent.rs) because it would require `&mut self` for straightforward implementations. This is a work in
Expand All @@ -11,7 +15,7 @@ For each example make sure to read the instructions on starting the associated A

### Basic

```rust
```rust,no_run
use std::error::Error;
use ag_ui_client::{core::types::Message, Agent, HttpAgent, RunAgentParams};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use ag_ui_client::agent::{Agent, RunAgentParams};
use ag_ui_client::core::types::{Message, Role};

#[tokio::test]
#[ignore] // Requires a live server on localhost:3001
async fn test_http_agent_basic_functionality() {
env_logger::init();

Expand Down Expand Up @@ -54,6 +55,7 @@ async fn test_http_agent_basic_functionality() {
}

#[tokio::test]
#[ignore] // Requires a live server on localhost:3001
async fn test_http_agent_tool_calls() {
// Create an HttpAgent
let agent = HttpAgent::builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use reqwest::Client;
use serde::Deserialize;
use std::time::Duration;

#[ignore]
#[tokio::test]
async fn test_sse_with_httpbun() {
// Create a reqwest client
Expand Down
4 changes: 4 additions & 0 deletions sdks/community/rust/crates/ag-ui-core/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# AG-UI Core Types

> **Status:** This is a community-contributed crate that is not actively maintained. The version
> on crates.io (v0.1.0) is outdated and missing types required by `ag-ui-client`. Build from
> source against the [workspace](../../) in this repository instead.

This repo contains the Rust types needed to work with the AG-UI protocol. Implemented using `serde` to support
(de)serialization.

Expand Down
Loading