🔧 refactor(dto): update BudgetTokens handling in Thinking struct

This commit is contained in:
CaIon
2025-06-16 18:29:49 +08:00
parent 3ac02879de
commit b77574dad5
4 changed files with 12 additions and 5 deletions

View File

@@ -178,7 +178,14 @@ type ClaudeRequest struct {
type Thinking struct {
Type string `json:"type"`
BudgetTokens int `json:"budget_tokens"`
BudgetTokens *int `json:"budget_tokens,omitempty"`
}
func (c *Thinking) GetBudgetTokens() int {
if c.BudgetTokens == nil {
return 0
}
return *c.BudgetTokens
}
func (c *ClaudeRequest) IsStringSystem() bool {