How to use Templatefactory Properly in AgentCreation from templates? #11181
Replies: 1 comment
-
Issue Resolved |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Earlier ChatCompletionAgent Method requires only the "templateConfig" but now it also requires "templateFactory". In the below code I can create or use this templateFactoryParameter
public ChatCompletionAgent CreateAgent(string templateFileName)
{
string templateContent = File.ReadAllText(Path.Combine(_templatesPath, templateFileName));
var config = KernelFunctionYaml.ToPromptTemplateConfig(templateContent);
}
Earlier I am using Semantic Kernel 1.37.0 which as the requirements as below:

But, Now, I have shifted to Semantic Kernel 1.42.0 which shows as below:

Earlier this KernelPromptTemplateFactory is used by Default, so now How I can make my above code working.
In the Official Documentation https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-templates?pivots=programming-language-csharp, it is also guided to use Single Parameter:
Beta Was this translation helpful? Give feedback.
All reactions