| 1 | package responses |
| 2 | |
| 3 | import "reasonix/internal/provider" |
| 4 | |
| 5 | // OutputBudget reports the default total output budget sent by this client. |
| 6 | func (c *client) OutputBudget() int { return c.maxOutputTokens } |
| 7 | |
| 8 | // SharesContextWindow is true only for the official DeepSeek vendor mode. |
| 9 | func (c *client) SharesContextWindow() bool { return c.vendor == "deepseek" } |
| 10 | |
| 11 | func (c *client) ContextBudgetPolicy() provider.ContextBudgetPolicy { |
| 12 | if lim, ok := provider.LookupOfficialOpenCodeGo("responses", c.baseURL, c.model); ok { |
| 13 | return provider.ContextBudgetPolicy{ |
| 14 | WindowMode: provider.ContextWindowShared, |
| 15 | AutoOutputTokens: lim.MaxOutput, |
| 16 | MaxOutputTokens: lim.MaxOutput, |
| 17 | LimitMode: provider.OutputLimitAlways, |
| 18 | } |
| 19 | } |
| 20 | if c.vendor == "deepseek" { |
| 21 | return provider.ContextBudgetPolicy{ |
| 22 | WindowMode: provider.ContextWindowShared, |
| 23 | AutoOutputTokens: provider.DeepSeekMaxOutputTokens, |
| 24 | MaxOutputTokens: provider.DeepSeekMaxOutputTokens, |
| 25 | LimitMode: provider.OutputLimitOmitWhenSafe, |
| 26 | } |
| 27 | } |
| 28 | return provider.ContextBudgetPolicy{WindowMode: provider.ContextWindowUnknown, LimitMode: provider.OutputLimitOmitWhenSafe} |
| 29 | } |
| 30 | |
| 31 | // SharedWindowInputPolicy reports the Responses-only history items that the |
| 32 | // official DeepSeek adapter replays into later requests. |
| 33 | func (c *client) SharedWindowInputPolicy() provider.SharedWindowInputPolicy { |
| 34 | replay := c.vendor == "deepseek" |
| 35 | return provider.SharedWindowInputPolicy{ |
| 36 | ReplaysOrdinaryReasoning: replay, |
| 37 | ReplaysResponsesItems: replay, |
| 38 | } |
| 39 | } |
| 40 |