From 4dc35ec28780d6a78e8afcf2650d4ada4fcd245c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 16 Jan 2026 20:48:47 +0100 Subject: pkg/aflow: handle common LLM mis-behaviors wrt tool calling Gracefully handle (reply to LLM with error): - incorrect tool name - incorrect tool arg type - missing tool arg Silently handle: - more than one call to set-results - excessive tool args Fixes #6604 --- pkg/aflow/flow.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/aflow/flow.go') diff --git a/pkg/aflow/flow.go b/pkg/aflow/flow.go index a391f5a01..d1bbe4c69 100644 --- a/pkg/aflow/flow.go +++ b/pkg/aflow/flow.go @@ -57,12 +57,12 @@ func register[Inputs, Outputs any](typ ai.WorkflowType, description string, Type: typ, Description: description, checkInputs: func(inputs map[string]any) error { - _, err := convertFromMap[Inputs](inputs, false) + _, err := convertFromMap[Inputs](inputs, false, false) return err }, extractOutputs: func(state map[string]any) map[string]any { // Ensure that we actually have all outputs. - tmp, err := convertFromMap[Outputs](state, false) + tmp, err := convertFromMap[Outputs](state, false, false) if err != nil { panic(err) } -- cgit mrf-deployment