feat(summary): send complete articles within user budget (#39)

This commit is contained in:
2026-11-24 17:39:26 +01:00
parent d0c7cb7cae
commit 79953ce49f
73 changed files with 1688 additions and 288 deletions

View File

@ -29,10 +29,14 @@ func newAnthropic(apiKey, model string) *anthropicProvider {
func (p *anthropicProvider) Name() string { return "anthropic" }
func (p *anthropicProvider) Summarize(ctx context.Context, prompt string, _ GenOptions) (string, error) {
func (p *anthropicProvider) Summarize(ctx context.Context, prompt string, opts GenOptions) (string, error) {
maxTokens := opts.MaxOutputTokens
if maxTokens <= 0 {
maxTokens = 4096
}
body := map[string]interface{}{
"model": p.model,
"max_tokens": 4096,
"max_tokens": maxTokens,
"messages": []map[string]string{
{"role": "user", "content": prompt},
},