更新若干功能
This commit is contained in:
@@ -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 服务商的统一抽象。
|
||||
|
||||
Reference in New Issue
Block a user