Open
Description
Describe the bug
agent-templates create agent,function_choice_behavior not work.
To Reproduce
yaml
execution_settings:
default:
temperature: 0.0
top_p: 0.0
top_k: 1
function_choice_behavior:
type: auto
Expected behavior
PromptTemplateConfig templateConfig = KernelFunctionYaml.ToPromptTemplateConfig(yamlContent);
ChatCompletionAgent chatCompletionAgent =
new ChatCompletionAgent(templateConfig, new KernelPromptTemplateFactory())
{
Kernel = _kernel,
Arguments = new KernelArguments
{
{ "global_analysis_guidelines", globalGuidelines },
}
};
chatCompletionAgent InvokeAsync can not call function,Change to the following writing style
PromptTemplateConfig templateConfig = KernelFunctionYaml.ToPromptTemplateConfig(yamlContent);
var promptExecutionSettings = new OpenAIPromptExecutionSettings()
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(options: new()
{
AllowParallelCalls = true,
AllowStrictSchemaAdherence = true,
RetainArgumentTypes = true
})
};
ChatCompletionAgent chatCompletionAgent =
new ChatCompletionAgent(templateConfig, new KernelPromptTemplateFactory())
{
Kernel = _kernel,
Arguments = new KernelArguments
{
{ "global_analysis_guidelines", globalGuidelines },
}
};
it work,why?
Platform
- Language: [C#]
- Source: [1.56.0]
- AI model: [Qwen3-32B]
- IDE: [Visual Studio,]
- OS: [Windows]
Metadata
Metadata
Assignees
Type
Projects
Status
Bug