fix(llm): 为 Usage 字段添加反序列化容错,修复缺失子字段导致的响应解析失败

- Usage 结构体加 struct-level #[serde(default)]:子字段缺失默认 0/None

- OpenaiResponseBody.usage 与 OpenaiChatResponse.usage 加 field-level:整 key 缺失默认 Usage::default()

- 覆盖 Responses API 与 Chat Completions 两条 blocking 路径

- 补 9 个反序列化测试覆盖缺失/空/完整/roundtrip 边界

- 升级版本号至 0.3.6
This commit is contained in:
徐涛
2026-07-27 09:46:52 +08:00
parent b7d0a7335f
commit 25238fc357
4 changed files with 167 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "agcore"
version = "0.3.5"
version = "0.3.6"
edition = "2024"
[features]