You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Python] as_agent_framework_tool drops parameter defaults (optionals become required) #14481
KernelFunction.as_agent_framework_tool builds an agent-framework InputModel but drops parameter defaults. After assigning a Field(..., default=...) for optional params, the next line unconditionally overwrites the same key with a no-default Field, so every optional becomes required in the JSON schema.
Environment
semantic-kernel==1.44.1 (Python)
Python 3.13
Minimal repro
The bug is in the field-building loop (exact code from as_agent_framework_tool):
(as_agent_framework_tool() itself also needs agent-framework-core; the loop above is the same code path.)
Expected
Optional kernel function parameters with defaults remain optional in the agent-framework InputModel / schema (top_k=5, include_meta=False).
Actual
All included params are required; defaults are discarded. Especially misleading for False/0 because default_value is not None is true, yet the default is still overwritten.
Root cause (pointer)
semantic_kernel/functions/kernel_function.py — as_agent_framework_tool (~field loop): missing else: around the no-default assignment.
Activity
[-][Python] as_agent_framework_tool drops parameter defaults (optionals become required)[/-][+]Python: [Python] as_agent_framework_tool drops parameter defaults (optionals become required)[/+]michaelkillgta commentedon Oct 15, 2026
Thanks — I see #14489 open for this, so I'll leave it there and won't open a competing PR.