🎨 优化上游ai兼容性,修复newapi返回token为空的问题
This commit is contained in:
@@ -10,6 +10,8 @@ type ClaudeMessageResponse struct {
|
||||
StopReason string `json:"stop_reason,omitempty"` // end_turn, max_tokens, stop_sequence
|
||||
StopSequence string `json:"stop_sequence,omitempty"`
|
||||
Usage ClaudeUsage `json:"usage"`
|
||||
// 统一格式的用量统计(与 OpenAI chat.completions 对齐)
|
||||
StandardUsage *ChatCompletionUsage `json:"standard_usage,omitempty"`
|
||||
}
|
||||
|
||||
type ClaudeContentBlock struct {
|
||||
|
||||
@@ -8,6 +8,8 @@ type ChatCompletionResponse struct {
|
||||
Model string `json:"model"`
|
||||
Choices []ChatCompletionChoice `json:"choices"`
|
||||
Usage ChatCompletionUsage `json:"usage"`
|
||||
// 统一格式的用量统计(用于各种上游的标准化)
|
||||
StandardUsage *ChatCompletionUsage `json:"standard_usage,omitempty"`
|
||||
// 扩展字段:正则脚本执行日志
|
||||
RegexLogs *RegexExecutionLogs `json:"regex_logs,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user