From 7ed63f68fed04b7927c45952e836398639ea18e4 Mon Sep 17 00:00:00 2001 From: ymuichiro Date: Thu, 23 Oct 2025 01:04:45 +0900 Subject: [PATCH 1/2] Python: Add text option to options if it exists in merged response --- .../agents/open_ai/responses_agent_thread_actions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py b/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py index d2375a9f3ce4..c44e38c55cd1 100644 --- a/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py +++ b/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py @@ -1185,6 +1185,10 @@ def _generate_options(cls: type[_T], **kwargs: Any) -> dict[str, Any]: "parallel_tool_calls": parallel_tool_calls, } + # Add text option if it exists + if merged.get("text") is not None: + options["text"] = merged.get("text") + # Add reasoning to the options if it is provided. # Note that non-reasoning capable models will throw an error if this is set. if reasoning is not None: From 69fa14c9eaba5891c4d2170ad493c9a55f076277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81=E3=83=BC?= <47295014+ymuichiro@users.noreply.github.com> Date: Thu, 23 Oct 2025 01:29:57 +0900 Subject: [PATCH 2/2] Update python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../agents/open_ai/responses_agent_thread_actions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py b/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py index c44e38c55cd1..ac06cc91077b 100644 --- a/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py +++ b/python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py @@ -1186,8 +1186,9 @@ def _generate_options(cls: type[_T], **kwargs: Any) -> dict[str, Any]: } # Add text option if it exists - if merged.get("text") is not None: - options["text"] = merged.get("text") + text = merged.get("text") + if text is not None: + options["text"] = text # Add reasoning to the options if it is provided. # Note that non-reasoning capable models will throw an error if this is set.