microsoft / chat-copilot

MIT License
2.06k stars 701 forks source link

Documentation on Adding Custom Plugins/Skills #499

Open patelfagun98 opened 1 year ago

patelfagun98 commented 1 year ago

I was trying to add a custom Plugin/Skills based on this doc (https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/plugins/native-functions/using-the-skfunction-decorator?tabs=Csharp) and was curious if the team could provide some documentation on how to integrate these plugins with the chat copilot code. I understand the support for OpenAPI standard plugins exists already but I wanted to add plugins that are added to the kernel out-of-the-box.

I can see that the OpenAPI standard plugins are registered with the kernel in ChatController.cs but wasn't sure where in the codebase my custom skill would get registered.

Let me know if I can provide more context on my request. Thanks!

H-JonathanLoise commented 7 months ago

@patelfagun98 You have to add it in this method: private static Task RegisterChatCopilotFunctionsAsync(IServiceProvider sp, Kernel kernel) but it's not working, there is already the timeplugin but if you ask "what time is it" the chat respond that was not able to retrieve the information. Tried in an external project and it works.