Fix Anthropic requests failing due to missing MaxTokens in agent configuration
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -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}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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](
|
||||
|
||||
Reference in New Issue
Block a user