Generative AI into ANY .NET App with SemanticKernel

  Рет қаралды 39,470

Nick Chapsas

Nick Chapsas

24 күн бұрын

Check out my courses at dometrain.com
Get the source code: mailchi.mp/dometrain/f_hqglt_2e8
Become a Patreon and get special perks: / nickchapsas
Hello, everybody. I'm Nick, and in this video, I will show you how to get started with adding LLMs and Generative AI into any .NET application using C# and the SemanticKernel library.
Workshops: bit.ly/nickworkshops
Don't forget to comment, like and subscribe :)
Social Media:
Follow me on GitHub: github.com/Elfocrash
Follow me on Twitter: / nickchapsas
Connect on LinkedIn: / nick-chapsas
Keep coding merch: keepcoding.shop
#csharp #dotnet

Пікірлер: 92
@Azagatoth
@Azagatoth 22 күн бұрын
Ideally I would want to have a local LLM with our training material/documentation, so the users can access that
@HenningKilset76
@HenningKilset76 21 күн бұрын
You can have a remote LLM and use the rag pattern to make the LLM aware of relevant documents based on user queries.
@Azagatoth
@Azagatoth 21 күн бұрын
​​@HenningKilset76 Remote LLM is not an option. We have customers that are completely off the grid due to security.
@HenningKilset76
@HenningKilset76 21 күн бұрын
Ok - get that. A combination of Semantic Kernel and Kernel Memory can connect to and utilize for instance a local Llama or Phi model as well.
@georgepagotelis
@georgepagotelis 20 күн бұрын
The answer you're looking for is Microsoft Copilot 365 (only seen demo online) and there's an copilot developer kit you can "buy" ie. another 100 subscription and do exactly that. Was thinking this while watching too btw.
@francoislepron2301
@francoislepron2301 18 күн бұрын
Is it possible with Mistral and train it with my data ?
@paulguk
@paulguk 22 күн бұрын
Would be interested in follow up videos that explore interacting with data (eg via SQL) to obtain data relevant to questions asked by the user.
@MaQy
@MaQy 22 күн бұрын
Semantic Kernel makes it easy to use RAGs with Azure Search and other DBs. You can also build chat completion tools that the model can choose to call. The example you are going to find everything is a tool that provides the weather.
@lucaciandrei
@lucaciandrei 22 күн бұрын
Interesting, but costly.
@LoganDunning
@LoganDunning 22 күн бұрын
Agreed, calling Open AI Apis ditectly is HUGE cost savings compared to Azure Open AI.
@cheronecom
@cheronecom 22 күн бұрын
I should note, ollama doesn't require a GPU, but you will want to use a small model if you use CPU - like tinyllama or phi3:mini
@geraldmaale
@geraldmaale 22 күн бұрын
@@LoganDunning Check again, both are the same. (input = $0.005/1k tokens, output = $0.15/1k tokens)
@rogeriobarretto
@rogeriobarretto 22 күн бұрын
It all depends on the underlying AI Service you want to use, SK works as an abstraction regardless of the service you are using. So if you decide to use it for Local Models you have virtually has no cost.
@HenningKilset76
@HenningKilset76 21 күн бұрын
@@LoganDunning It's the same price. GPT-4o 1.5 cents / 1000 input tokens and 3 cents / 1000 output tokens.
@alfany6252
@alfany6252 22 күн бұрын
It would be better if you told about running local LLM with C#
@nickchapsas
@nickchapsas 22 күн бұрын
It’s coming
@KibbleWhite
@KibbleWhite 22 күн бұрын
@@nickchapsas Yes please buddy, loving this insight so far! 💖
@irql2
@irql2 22 күн бұрын
Its very easy, just get LM Studio. It exposes an API endpoint you can call in C#. This is what Nick will probably show in the next video because its the easiest to do by far imo.
@alfany6252
@alfany6252 22 күн бұрын
@@irql2 I want it to be only in my app. I dont want to run other program, run server...
@maskettaman1488
@maskettaman1488 22 күн бұрын
It wouldn't be "better", running locally is a totally different scenario for a totally different use case.
@HenryETaylor
@HenryETaylor 20 күн бұрын
Directly exposing AI features to my customers would only make sense if it generated higher revenues from existing clients or accelerated the sales cycle (allowing me to grow a bigger customer base), but integrating AI features into the tools I write for myself to generate synthetic data, categorize and analyze server traffic and cloud costs... Yes! That I will start doing immediately!
@nitrovent
@nitrovent 11 күн бұрын
The most fascinating feature of the semantic kernel for me was the kernel plugins that allow you to give the AI access to local function to reach the goal you specify in chat. You decorate your plugin functions with a description in plain text and the semantic kernel uses it to orchestrate function calls. This way you can access local data that is highly dynamic (local time, user's todo list, whatever) but it will also call functions to create content or control the app. That really blew my mind.
@danclarkeuk
@danclarkeuk 22 күн бұрын
Nice. I've got some dotnet code that's interacting with OpenAI via their REST API - but I might convert that over to Semantic Kernel after seeing this.
@danclarkeuk
@danclarkeuk 22 күн бұрын
Well that was easy! I've just converted it over and it took about 5 minutes and just worked! Thanks for the video! 😊🙏
@vincenthamelin6115
@vincenthamelin6115 20 күн бұрын
@@danclarkeuk Although your post is relatively new, have you seen a cost difference? I've read that using Azure OpenAI Service is MORE expensive than using OpenAI APIs directly. What are your thoughts?
@danclarkeuk
@danclarkeuk 19 күн бұрын
@@vincenthamelin6115 Ah sorry - I probably wasn't clear about what I'd changed. I haven't switched to the Azure OpenAI service. I just changed my implementation from talking to OpenAI manually via their REST API, to instead using the Semantic Kernel nuget package.
@RoySalisbury
@RoySalisbury 22 күн бұрын
Would be cool to see a demo on feeding it some SQL table creation statements or some c# objects (perhaps your MovieDB example) and have it generate the code for you. Then ask it to do thinks with the code like "Add the necessary error handling".
@sergeyz.5845
@sergeyz.5845 22 күн бұрын
didn’t know about that lib. Thank you
@zachemny
@zachemny 22 күн бұрын
Also an example of embedding documents with SK into a local model would be very interesting.
@jorgeserrano4226
@jorgeserrano4226 22 күн бұрын
@Nick can we use same code when targeting OpenAI instead of AzureOpenAI ? if not, what would be the diffrence ?
@TheMannihilator
@TheMannihilator 22 күн бұрын
Thank you for the demo. Maybe you could use another LLM instead of OpenAI stuff.
@Chatlan
@Chatlan 21 күн бұрын
Thanks for the video. It would be interesting to see how to use RAG as well
@nick066hu
@nick066hu 22 күн бұрын
Is there any reason why should we use OpenAI thru Azure ? The Open AI api is also directly available. Can someone with some experience with both pls help me compare these two approaches: Pro/Con /Pricing
@DaminGamerMC
@DaminGamerMC 22 күн бұрын
I have some experience with Azure Open AI. By itself it is also very very cheap. However, as soon as you want to add you own data (like for making a support service for a company) it gets very expensive because you need AI search. A big issue is that you need to be allowed to use the service by Microsoft meaning you might have to wait between a week and a month to really be able to use it.
@MetehanG
@MetehanG 22 күн бұрын
For my scenario, my company already has access to Azure and we have some free monthly Azure credits. These credits also available on Azure Open AI so it was basically free for us. Why would we pay for OpenAI API while we have that? Other than that, there is practically no difference as far as I know.
@ThaGuus
@ThaGuus 22 күн бұрын
Pro of Azure OpenAI: Runs on Azure so more "secure", Already known SLA, VNET support & private endpoints, if you want to "train it" then the files are on Azure which is a pre. Con of Azure OpenAI: You need to have a business Azure Account with domain and request access, Streaming doesn't work fully like it will stream in parts but not letter for letter like the normal OpenAI API, It's slower
@PticostaricaGS
@PticostaricaGS 22 күн бұрын
Azure OpenAI is designed having data security in mind. And has easy integration with other Azure AI services. So, for companies internal tools, Azure OpenAI is more suitable.
@nick066hu
@nick066hu 22 күн бұрын
Thank you to all who replied and also those who are going to. For a proof of concept evaluation I might try the direct OpenAI api first. (I am not very experienced in programming Azure, learning two things at a time might be unnecessarily steep, although the free monthly credits are also tempting) My end goal is to program a technical support service assistant, with knowledge from uploaded manuals and other documents. First in a chat-window text based, in some later phase in voice mode. @DaminGamerMC What do you mean by 'allowed ....and wait a week/month' ? Am I right with assuming, that in this scenario I pay for the uploaded (they call it 'embedded', if I got it right) documents, - I need these the AI assistant find the replies in -, only once, per tokens in the document, and for all subsequent (customer) queries I pay only for the tokens actually in the query and the replies?
@sushilb7994
@sushilb7994 22 күн бұрын
Very nice!
@mingyingxue6815
@mingyingxue6815 17 күн бұрын
hi, Nick, what is the ide you used in this video? tkx
@abdulkadirbener
@abdulkadirbener 22 күн бұрын
Gpt4 supports some training functions with limitations. Is there a way to upload our knowledge and train the AI with SemanticKernel?
@HenningKilset76
@HenningKilset76 21 күн бұрын
Yes - I'd look into the combination of Semantic Kernel and Kernel Memory - another MS open-source library.
@tyomidi
@tyomidi 22 күн бұрын
Would have been cool it is was with Llama but I dont see any good way with Dotnet?
@Craxmerax
@Craxmerax 22 күн бұрын
How would I use this to stream the response to a frontend application and get the same sort of feel where the chat bot is writing in the response like in the CLI?
@ferd1775
@ferd1775 22 күн бұрын
Yield return
@ferd1775
@ferd1775 22 күн бұрын
You could also use llama3 locally and ask it 😉
@neociber24
@neociber24 22 күн бұрын
AsyncIterator?
@ferd1775
@ferd1775 22 күн бұрын
@@neociber24 oh yea. Forgot all about that, I have no use for it generally. Way better solution
@bogdanbanciu1781
@bogdanbanciu1781 21 күн бұрын
I also posted a tweet about the behavior of await foreach while building an API to do some AI work. Did you try using await Task.Yield() instead of the Delay(100)? Something fishy is happening over there
@alexanderpoplooukhin7448
@alexanderpoplooukhin7448 20 күн бұрын
What's a benefit to use chatgpt through MS Azure instead of using chatgpt's API?
@francescogranozio2780
@francescogranozio2780 21 күн бұрын
could you make a video that shows the “chat with your files” feature?
@igorsolomatov4743
@igorsolomatov4743 22 күн бұрын
Why not use existing ai agent frameworks here? I think the most critical is how do we get grounding of ai. For example I want it to be able to run my functions. So that it will actually integrate
@Grumpicles
@Grumpicles 18 күн бұрын
That's great. But how much does it cost?
@shabanelmogy7912
@shabanelmogy7912 20 күн бұрын
we need big tutorial about blazor and what your opinion in it ?
@Kotz_en
@Kotz_en 20 күн бұрын
Does this work with Ollama, or is it just Azure?
@Luke-me9qe
@Luke-me9qe 18 күн бұрын
Yes. You would need another connector. And it is available
@Sztormus
@Sztormus 22 күн бұрын
Cool video as always! But now we want a stream from World of Warcraft 😂
@nickchapsas
@nickchapsas 22 күн бұрын
This has happened already when Dragonflight launched 😂
@JustArion
@JustArion 22 күн бұрын
@@nickchapsas Nick the Gamer. Would love to see more of those
@davidjsutherland
@davidjsutherland 19 күн бұрын
We live in a wild and crazy time.
@FraserMcLean81
@FraserMcLean81 20 күн бұрын
I've been playing around with Azure Open AI but was just using the Azure.AI.OpenAI packages. Didn't know about this Symantic kernel thing.
@neociber24
@neociber24 22 күн бұрын
This make me notice I have never streamed content to a client side app in C#.
@craigmcinnes1212
@craigmcinnes1212 22 күн бұрын
Maybe I have this VERY wrong, but what has this to do with Semantic Kernel? I thought SK was about providing automation to an AI, so that it could invoke functionality within your app. example, my app is a ride booking service, so I provide a "request ride" "feature" and now the general AI knows about that specific "ability" and how to invoke it within my app during a general chat style session?
@etiennebaudoux135
@etiennebaudoux135 22 күн бұрын
You can do exactly this with Semantic Kernel, but Nick only scratches the surface and likely focused on the basic ChatGPT conversation because that's probably what people are the most familiar with when it comes to AI nowadays.
@irql2
@irql2 18 күн бұрын
Honestly all of that can be done without the Semantic kernel. You can define functions in your app and tell the LLM they're available to call. They call it "Function calling" because they're really good at creatively naming stuff lol.
@KarmCraft
@KarmCraft 22 күн бұрын
How to add your domain logic/knowledge?
@nickchapsas
@nickchapsas 22 күн бұрын
I’ll show that in a future video but it gets pricy
@irql2
@irql2 22 күн бұрын
@@nickchapsas Will be interesting to see what you mean by pricy. The technology to do it is openly available.
@macoson
@macoson 22 күн бұрын
Recommend Autogen which is also available for .NET
@andreyz3133
@andreyz3133 22 күн бұрын
WoW streams wen ser?
@T___Brown
@T___Brown 22 күн бұрын
I worked with SK like 4 months ago. I couldnt use because of so many bugs. Maybe better now but I have already gone to python.
@Biker322
@Biker322 22 күн бұрын
We have a cloud platform , clients all scream we want AI. But none can tell me exactly what they want AI to do. Got. POC working with aws bedrock, but still, can’t think of a single use case for it. Our clients want to say they have something AI, seems to pretty much be it.
@Radictor44
@Radictor44 19 күн бұрын
Where's the kill switch 😂
@vyteniskajackas7579
@vyteniskajackas7579 22 күн бұрын
Oh I wish you would have said for AI generated title at the start "this title is terrible" but still use it on this video as a joke
@mihaimyh
@mihaimyh 19 күн бұрын
WoW FTW!
@scf0carbonete
@scf0carbonete 22 күн бұрын
It's great. Sugestion made a Maui, Onxx, PHI-3 small or Gemini nano , multiple OS's example.
@devincarlson8866
@devincarlson8866 22 күн бұрын
Someone has been playing Cataclysm Classic recently and misses Wrath haven’t they…
@nickchapsas
@nickchapsas 22 күн бұрын
🥲
@ronnyek4242
@ronnyek4242 22 күн бұрын
Not that open implies free... But I find the trend of hosting AI models and charging fees for consumption problematic. Most of the examples I've seen really couldn't be incorporated into real world apps without losing money. I hate that Microsoft kind of pushes people to cloud vendor lockin. I see azure specific stuff and automatically rule it out as a solution
@mekowgli
@mekowgli 21 күн бұрын
They require serious compute, so it's only fair to charge money for it. Although Azure pricing is, as usual, pretty wild. But the good thing is that, from what I understand, the API schemas are pretty much shared between different providers (including local ones) so you can use the same libraries to connect to different services.
@mostrealtutu
@mostrealtutu 22 күн бұрын
No
@demarcorr
@demarcorr 22 күн бұрын
i dont wanna and you cant make me.
"I Lost a Job Because of This Codebase"
14:08
Nick Chapsas
Рет қаралды 45 М.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 44 М.
Watermelon Cat?! 🙀 #cat #cute #kitten
00:56
Stocat
Рет қаралды 45 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 8 МЛН
Why did the angel disappear?#Short #Officer Rabbit #angel
00:38
兔子警官
Рет қаралды 5 МЛН
What Makes A Great Developer
27:12
ThePrimeTime
Рет қаралды 142 М.
Make Your LINQ Up to 10x Faster!
11:08
Nick Chapsas
Рет қаралды 53 М.
Why Startups Hate .NET and C#
10:38
Nick Chapsas
Рет қаралды 248 М.
Brutally honest advice for new .NET Web Developers
7:19
Ted's Tech
Рет қаралды 61 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 47 М.
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 16 М.
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
Why Developers Hate "Clean Code"?
14:39
Nick Chapsas
Рет қаралды 54 М.
The Blazor Competitor is Here!
15:08
Nick Chapsas
Рет қаралды 61 М.
AMD is About to CRUSH Intel… Just Like I Predicted
9:34
Linus Tech Tips
Рет қаралды 1,2 МЛН
Watermelon Cat?! 🙀 #cat #cute #kitten
00:56
Stocat
Рет қаралды 45 МЛН