ag-ui-protocol / ag-ui-protocol/ag-ui

[Feature]: [rust-sdk] Support optional feature flags for core crate to derive protocol types with utoipa + schemars

Đang mở
#1,407 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
15.9k
Fork
1.4k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
163

Mô tả

### Pre-flight Checklist

- [x] I have searched existing issues and this hasn't been requested yet.

### Problem or Motivation

Currently the protocol types in the `ag-ui-core` crate in the Rust SDK are serializable but do not interoperate in presentation layers that depend on utilities like utoipa or schemars. This means those types can not be used directly in those layers, requiring developers to redefine the exact same shapes in their own structs instead of simply reusing the core crate.

### Proposed Solution

It would be ideal if the core crate supported two optional feature flags, `utoipa` and `schemars` that conditionally adds the derives for `utoipa::ToSchema` and `schemars::JsonSchema` to all of the serializable types.

### Alternatives Considered

The only possible workaround is to redefine the exact same types manually in your own project, requiring maintenance time when the protocol changes.

### Additional Context

I am willing to open a PR with these changes as they are very small.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.