更新若干功能

This commit is contained in:
李琦
2026-08-15 17:18:00 +08:00
parent 4954295961
commit 6a81e479ef
77 changed files with 8165 additions and 2372 deletions

View File

@@ -11,9 +11,18 @@ type Message struct {
}
// Chunk 是流式返回的一段增量内容;Err 非空表示流异常中止。
// Usage 在流结束时可选附带 token 用量(若服务商提供)。
type Chunk struct {
Content string
Err error
Usage *Usage
}
// Usage 一次调用的 token 用量。
type Usage struct {
PromptTokens int64
CompletionTokens int64
Estimated bool
}
// Provider 是 AI 服务商的统一抽象。