Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Parity between kernel.CreateFunctionFromPrompt( and KernelFunctionFactory.CreateFromPrompt( #4647

Closed
joslat opened this issue Jan 17, 2024 · 3 comments
Assignees
Labels
kernel Issues or pull requests impacting the core kernel stale Issue is stale because it has been open for 90 days with no activity

Comments

@joslat
Copy link
Contributor

joslat commented Jan 17, 2024

the kernel "seems" to expose a lot of functionality, and some of its functions are "almost" on par with the ones provided by KernelFunctionFactory and also some from KernelPluginFactory, but not all. For example, KernelPluginFactory.CreateFromFunctions( is missing on the kernel. At least when I go to use it, see picture:
image

Also one of the methods of KernelFunctionFactory.cs is not exposed by the kernel, but it might be getting deprecated:

public static KernelFunction CreateFromPrompt(
    IPromptTemplate promptTemplate,
    PromptTemplateConfig promptConfig,
    ILoggerFactory? loggerFactory = null)

I find this a bit confusing, not having this parity.

@joslat
Copy link
Contributor Author

joslat commented Jan 17, 2024

Strangely enough, I have checked into KernelExtensions.cs and the extension method is there, in line 182 and 195 of the current code in main...

public static KernelPlugin CreatePluginFromFunctions(this Kernel kernel, string pluginName, IEnumerable<KernelFunction>? functions) =>
    CreatePluginFromFunctions(kernel, pluginName, description: null, functions);

So I am puzzled...

This happened with and I believe I got the package like a few days ago, 4-6 at most.

Doh, just saw 1.1.0 has been released 11 hours ago, I checked the issue list and...
#4549
So it seems it is mostly done 👍 - Great work!!

I mentioned this, this method is not exposed by the kernel, so either is missing or getting deprecated?

In KernelFunctionFactory.cs:
public static KernelFunction CreateFromPrompt(
IPromptTemplate promptTemplate,
PromptTemplateConfig promptConfig,
ILoggerFactory? loggerFactory = null)

@moonbox3 moonbox3 changed the title Parity between kernel.CreateFunctionFromPrompt( and KernelFunctionFactory.CreateFromPrompt( .Net: Parity between kernel.CreateFunctionFromPrompt( and KernelFunctionFactory.CreateFromPrompt( Jan 17, 2024
@matthewbolanos matthewbolanos added the kernel Issues or pull requests impacting the core kernel label Jan 19, 2024
Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale Issue is stale because it has been open for 90 days with no activity label Apr 19, 2024
Copy link

github-actions bot commented May 3, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed May 3, 2024
@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel stale Issue is stale because it has been open for 90 days with no activity
Projects
Archived in project
Development

No branches or pull requests

4 participants