feat(summary): send complete articles within user budget (#39)
This commit is contained in:
@ -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},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user