refactor: Update ClaudeResponse error handling to use pointer for ClaudeError and improve nil checks in response processing

This commit is contained in:
1808837298@qq.com
2025-03-16 23:14:45 +08:00
parent 962e803d8a
commit 8c7c39550c
2 changed files with 3 additions and 3 deletions

View File

@@ -183,7 +183,7 @@ type ClaudeResponse struct {
Completion string `json:"completion,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
Model string `json:"model,omitempty"`
Error ClaudeError `json:"error,omitempty"`
Error *ClaudeError `json:"error,omitempty"`
Usage *ClaudeUsage `json:"usage,omitempty"`
Index *int `json:"index,omitempty"`
ContentBlock *ClaudeMediaMessage `json:"content_block,omitempty"`