0xPlaygrounds / 0xPlaygrounds/rig

feat: uniformize Serde enum tagging

オープン
#609 コメント 2 件 リアクション 0 件 担当者 1 名 @joshua-mo-143 が担当を希望しています GitHub で見る
feat
主要言語
Rust
スター
8.6k
フォーク
959
平均マージ
4時間 32分
マージ済み PR(30日)
117

説明

- [x] I have looked for existing issues (including closed) about this

## Feature Request
Enum serialization is a bit all over the place, `UserContent` is inner tag (`#[serde(tag = "type", rename_all = "lowercase")]`) but `AssistantContent` is untagged (`#[serde(untagged)]`). I would suggest picking a pattern, I usually prefer to be more explicit than not (with an inner tag). Untagged will only get you so far.

### Motivation
This is follow-up on #608, since I started looking at storing that data longer term. I have decided to create my own set of structs to have more control, but I would still suggest improving the tagging of enum so it is at least consistent.

### Proposal
Apply an inner tag on all enums.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Look at the Serde enum tagging in the codebase, specifically the `UserContent` and `AssistantContent` enums. Understand the difference between inner tag and untagged serialization. Apply consistent inner tagging across all relevant enums, ensuring serialization/deserialization works correctly. Run existing tests to verify changes.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
backend-api-design
issue の種類
リファクタリング
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。