extractContextWindowConfig 提取上下文窗口配置
()
| 759 | |
| 760 | // extractContextWindowConfig 提取上下文窗口配置 |
| 761 | func (a *Agent) extractContextWindowConfig() *struct { |
| 762 | MaxTokens int |
| 763 | Strategy string |
| 764 | } { |
| 765 | if a.config.Context == nil { |
| 766 | return nil |
| 767 | } |
| 768 | |
| 769 | return &struct { |
| 770 | MaxTokens int |
| 771 | Strategy string |
| 772 | }{ |
| 773 | MaxTokens: a.config.Context.MaxTokens, |
| 774 | Strategy: "auto", // 可以从配置中读取 |
| 775 | } |
| 776 | } |
| 777 | |
| 778 | // injectToolManual 注入工具手册到系统提示词 |
| 779 | // Deprecated: 使用 buildSystemPrompt 替代 |