How To Use Semantic Kernel Plugins In C#

  Рет қаралды 712

Dev Leader

Dev Leader

Күн бұрын

Пікірлер: 15
@DevLeader
@DevLeader 15 күн бұрын
📌📌📌 Get C# 13 and .NET 9 - Modern Cross-Platform Development Fundamentals: amzn.to/41VKoUI 📌📌📌 🧑‍💼Get Promoted As A Software Engineer: - dometrain.com/course/career-getting-promoted-as-a-software-engineer/?ref=nick-cosentino 🧑‍💼 Nailing The Behavioral Interview: - dometrain.com/course/career-nailing-the-behavioral-interview/?ref=nick-cosentino 💡 Learn how to program in C#: - dometrain.com/course/getting-started-csharp?ref=nick-cosentino 🧠Deep dive on C#: - dometrain.com/course/deep-dive-csharp?ref=nick-cosentino 🎁Zero to Hero C# Bundle: - dometrain.com/bundle/from-zero-to-hero-csharp/?ref=nick-cosentino 🪞Reflection in .NET - dometrain.com/course/from-zero-to-hero-reflection-in-dotnet/?ref=nick-cosentino 💪 Skill up your refactoring: - dometrain.com/course/from-zero-to-hero-refactoring-for-csharp-developers?ref=nick-cosentino ✉ Subscribe to my free software engineering newsletter: - weekly.devleader.ca
@ThatDeveloperDad
@ThatDeveloperDad 15 күн бұрын
Great video! One thing I've learned in the year or so I've been playing with Semantic Kernel, and that I have to chime in with: I cannot stress this enough - The Single Responsibility Principle (The 'S' in SOLID,) is PARAMOUNT when designing functions to be consumed by an LLM in this way. Yes, you CAN create a function that reads a property value from an object, performs some "thinking" and sets another property, but that will break, and quickly, if you register that function in an AI system that isn't directly tied to the specific part of your Domain that you'd originally intended that function for. Have discrete functions to Read, Calculate, and then Set those values, if you're using Semantic Kernel to work on domain objects. This becomes even more important when you get into using the Semantic Kernel's Planner features, which is the road to Agentic AI systems in .Net.
@Beltalowda55
@Beltalowda55 15 күн бұрын
Great point. I experienced the same issues. Great walk-through Nick. Giving the LLM the context for the functions is very important as you pointed out. My first experiments didn't have any context and it frequently didn't work as I expected. I'm not used to the Description tags actually being used other than for the developer's info. I started to think of the LLM as another developer who needs the context for the functions to understand how to use them.
@ThatDeveloperDad
@ThatDeveloperDad 14 күн бұрын
@@Beltalowda55 That's actually a really great way to explain the importance of the Description attributes, not only on the function itself, but also on the parameters for the functions. I'll remember that next time I need to explain what they are, and why they're important to somebody I'm working with. Code documentation and Comments (in whatever form they take,) should always be about improving the audience's understanding of WHY, rather than WHAT is going on in a particular method.
@msdevel
@msdevel 15 күн бұрын
Hi, I would like to ask you if you have any courses in progress for Dometrain. Thank you
@DevLeader
@DevLeader 15 күн бұрын
More career related courses but I'm in discussion with Nick Chapsas about which technical ones might be a good fit to create next
@chadsolomon4187
@chadsolomon4187 7 күн бұрын
I have been trying to recreate this and even found the Microsoft documentation to read and follow. I am confused about where the "result.Role and result.Content" comes from? I realize that we set the result up just before calling "result.Role and result.Content" but I am getting an error still. This gives me an error every time. I am assuming that this is some kind of configuration that is not shown in your video? I can not find this in the Microsoft documentation that covers this example either or in the GitHub that the Microsoft documentation links to. I see when I set up the AzureOpenAI resource in Azure that there are some examples showing how to make an API call to the resource via httpclient and it sets up a role but when using semantic kernel I can not figure this out. Any help, I will greatly appreciate.
@DevLeader
@DevLeader 7 күн бұрын
What's the error you get? Did you use your connection info / API key for the AI service you're trying to use? I suspect the configuration you're missing is the part I didn't show: me copy+pasting that info from the Azure Portal 😉 But let's see what your error is and go from there 💪
@chadsolomon4187
@chadsolomon4187 7 күн бұрын
Yes, I do have the endpoint, key, and model set up and configured with the kernel. The error is a compiler error saying IReadOnlyList does not contain a definition for Role and no accessible extension method and the same thing for Result.Content. That error is definitely why I thought I was missing some kind of configuration. The part you said you copied and pasted from Azure, was from the Azure AI foundry page for the OpenAI deployment then you click the view code and it shows how to set up the HttpClient and configure the payload with the user and system-defined role?
@DevLeader
@DevLeader 7 күн бұрын
@chadsolomon4187 which version of the package are you using? Seems like something is out of date? I know the APIs in code have changed for this stuff over time
@chadsolomon4187
@chadsolomon4187 7 күн бұрын
@@DevLeader for the Microsoft.semanticKernel and Microsoft.semanticKernel.connectors.OpenAI the version is 1.32.0
@chadsolomon4187
@chadsolomon4187 7 күн бұрын
@@DevLeader Did you configure the HttpClient as shown on Azure?
C# Semantic Kernel Plugins: Get YouTube Video Info!
19:19
Dev Leader
Рет қаралды 386
How To Cache In C#: Caching For Beginners
47:16
Dev Leader
Рет қаралды 387
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
What is an object pool, and how to create one in C?
23:14
Jacob Sorber
Рет қаралды 19 М.
Comprehending Proc Macros
47:41
Logan Smith
Рет қаралды 31 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 39 М.
Is C BETTER than C++ for beginners? // Code Review
31:16
The Cherno
Рет қаралды 91 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 341 М.
Use Semantic Kernel to build AI Apps and Agents - a simple intro!
24:49
Beginner's Guide To Semantic Kernel In C#
8:06
Dev Leader
Рет қаралды 1,2 М.
C++ Super Optimization: 1000X Faster
15:33
Dave's Garage
Рет қаралды 332 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 915 М.