返回 DeepSeek-Reasonix
output_budget.go
根目录 / internal / provider / anthropic / output_budget.go
1 package anthropic
2
3 import "reasonix/internal/provider"
4
5 // OutputBudget reports the mandatory max_tokens default used by this client.
6 func (c *client) OutputBudget() int { return c.defaultMaxTokens }
7
8 // SharesContextWindow is true only for the official DeepSeek endpoint mode.
9 func (c *client) SharesContextWindow() bool { return c.deepseek }
10
11 func (c *client) ContextBudgetPolicy() provider.ContextBudgetPolicy {
12 if lim, ok := provider.LookupOfficialOpenCodeGo("anthropic", c.baseURL, c.model); ok {
13 return provider.ContextBudgetPolicy{
14 WindowMode: provider.ContextWindowShared,
15 AutoOutputTokens: lim.MaxOutput,
16 MaxOutputTokens: lim.MaxOutput,
17 LimitMode: provider.OutputLimitRequired,
18 }
19 }
20 if c.deepseek {
21 return provider.ContextBudgetPolicy{
22 WindowMode: provider.ContextWindowShared,
23 AutoOutputTokens: provider.DeepSeekMaxOutputTokens,
24 MaxOutputTokens: provider.DeepSeekMaxOutputTokens,
25 LimitMode: provider.OutputLimitRequired,
26 }
27 }
28 return provider.ContextBudgetPolicy{WindowMode: provider.ContextWindowUnknown, LimitMode: provider.OutputLimitRequired}
29 }
30
30 lines GO