From 7ba18de474244863ff2488cdd7862a64ae8ebc34 Mon Sep 17 00:00:00 2001 From: Varun Nuthalapati Date: Fri, 1 May 2026 15:17:15 -0700 Subject: [PATCH] =?UTF-8?q?docs(llmagent):=20correct=20OutputSchema=20comm?= =?UTF-8?q?ent=20=E2=80=94=20tools=20still=20work=20via=20set=5Fmodel=5Fre?= =?UTF-8?q?sponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous comment incorrectly stated that OutputSchema prevents the use of tools. The framework injects a set_model_response tool transparently so all tool types (function tools, RAG, agent transfer) continue to work alongside structured output. Updated the comment to reflect actual behavior. Fixes #756 --- agent/llmagent/llmagent.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/llmagent/llmagent.go b/agent/llmagent/llmagent.go index fab84e6ca..6746ca683 100644 --- a/agent/llmagent/llmagent.go +++ b/agent/llmagent/llmagent.go @@ -254,8 +254,10 @@ type Config struct { InputSchema *genai.Schema // The output schema when agent replies. // - // NOTE: when this is set, agent can only reply and cannot use any tools, - // such as function tools, RAGs, agent transfer, etc. + // When OutputSchema is set, the framework transparently injects a + // set_model_response tool so the model can still invoke other tools + // (function tools, RAG, agent transfer, etc.) while producing structured + // output. See internal/llminternal/outputschema_processor.go for details. OutputSchema *genai.Schema // Callbacks are executed in the order they are provided.