Fix Anthropic requests failing due to missing MaxTokens in agent configuration

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-13 18:24:02 +01:00
parent 356de5ab19
commit 7c77c217c7
14 changed files with 29 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -20,12 +20,13 @@ import (
)
type Agent struct {
l *log.Logger
client *llm.Client
model string
temp float64
l *log.Logger
client *llm.Client
model string
temp float64
maxTokens int
}
func NewAgent(l *log.Logger, client *llm.Client, model string, temp float64) *Agent {
return &Agent{l: l, client: client, model: model, temp: temp}
func NewAgent(l *log.Logger, client *llm.Client, model string, temp float64, maxTokens int) *Agent {
return &Agent{l: l, client: client, model: model, temp: temp, maxTokens: maxTokens}
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -55,6 +55,7 @@ func (a *Agent) GenerateChangelog(ctx context.Context, oldContent string, newCon
agent.WithInstructions(changelogGeneratorSystemPrompt),
agent.WithModel(a.model),
agent.WithTemperature(a.temp),
agent.WithMaxTokens(a.maxTokens),
)
result, err := ag.Run(

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -128,6 +128,7 @@ func (a *Agent) AssessVendor(ctx context.Context, websiteURL string) (*vendorInf
agent.WithInstructions(assessVendorSystemPrompt),
agent.WithModel(a.model),
agent.WithTemperature(a.temp),
agent.WithMaxTokens(a.maxTokens),
)
typedResult, err := agent.RunTyped[vendorInfo](