aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/aflow/trajectory/trajectory.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-01-15 11:37:02 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-01-19 09:21:15 +0000
commit1276f83b46b38cc241614ebc4401720f5f1fc4ab (patch)
treeedf8e8d9c9ac313d9457cebf678aea9334804f05 /pkg/aflow/trajectory/trajectory.go
parenta9fc52269b8aab60248b6e4c5366216bc2191101 (diff)
pkg/aflow: add ability to generate several candidate replies for LLM agents
Add LLMAgent.Candidates parameter. If set to a value N>1, then the agent is invoked N times, and all outputs become slices. The results can be later aggregated by another agent, as shown in the test.
Diffstat (limited to 'pkg/aflow/trajectory/trajectory.go')
-rw-r--r--pkg/aflow/trajectory/trajectory.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/aflow/trajectory/trajectory.go b/pkg/aflow/trajectory/trajectory.go
index 12c585815..49e36933b 100644
--- a/pkg/aflow/trajectory/trajectory.go
+++ b/pkg/aflow/trajectory/trajectory.go
@@ -39,12 +39,16 @@ type Span struct {
type SpanType string
+// Note: don't change string values of these consts w/o a good reason.
+// They are stored in the dashboard database as strings.
const (
SpanFlow = SpanType("flow") // always the first outermost span
SpanAction = SpanType("action")
SpanAgent = SpanType("agent")
SpanLLM = SpanType("llm")
SpanTool = SpanType("tool")
+ // Logical grouping of several invocations of the same agent.
+ SpanAgentCandidates = SpanType("agent-candidates")
)
func (span *Span) String() string {