From 1276f83b46b38cc241614ebc4401720f5f1fc4ab Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 15 Jan 2026 11:37:02 +0100 Subject: 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. --- pkg/aflow/trajectory/trajectory.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/aflow/trajectory/trajectory.go') 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 { -- cgit mrf-deployment