Description
PromptTemplateConfig.input_variables supports a default per variable, it is even validated (must be a string) and exposed through get_kernel_parameter_metadata as default_value. But the value is never used when rendering: KernelPromptTemplate.render goes straight to the blocks, and VarBlock.render only reads KernelArguments, returning an empty string for anything missing.
Reproduction
from semantic_kernel import Kernel
from semantic_kernel.prompt_template.kernel_prompt_template import KernelPromptTemplate
from semantic_kernel.prompt_template.prompt_template_config import PromptTemplateConfig
import asyncio
cfg = PromptTemplateConfig(
name="t",
template="Hello {{$name}}!",
template_format="semantic-kernel",
input_variables=[{"name": "name", "description": "who", "default": "STRANGER"}],
)
tpl = KernelPromptTemplate(prompt_template_config=cfg)
print(repr(asyncio.run(tpl.render(Kernel())))) # 'Hello !' -- expected 'Hello STRANGER!'
Expected behavior
A declared default fills in when the caller did not supply the variable; an explicit argument still wins.
Environment
semantic-kernel python 1.44.1, pydantic v2
Description
PromptTemplateConfig.input_variablessupports adefaultper variable, it is even validated (must be a string) and exposed throughget_kernel_parameter_metadataasdefault_value. But the value is never used when rendering:KernelPromptTemplate.rendergoes straight to the blocks, andVarBlock.renderonly readsKernelArguments, returning an empty string for anything missing.Reproduction
Expected behavior
A declared default fills in when the caller did not supply the variable; an explicit argument still wins.
Environment
semantic-kernel python 1.44.1, pydantic v2