Generative AI into ANY .NET App with SemanticKernel

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024
  • Check out my courses at dometrain.com
    Get the source code: mailchi.mp/dom...
    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/nickwor...
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: github.com/Elf...
    Follow me on Twitter: / nickchapsas
    Connect on LinkedIn: / nick-chapsas
    Keep coding merch: keepcoding.shop
    #csharp #dotnet

ความคิดเห็น • 100

  • @nitrovent
    @nitrovent 3 หลายเดือนก่อน +2

    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.

  • @Azagatoth
    @Azagatoth 4 หลายเดือนก่อน +48

    Ideally I would want to have a local LLM with our training material/documentation, so the users can access that

    • @HenningKilset76
      @HenningKilset76 3 หลายเดือนก่อน

      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 3 หลายเดือนก่อน +2

      ​​@HenningKilset76
      Remote LLM is not an option. We have customers that are completely off the grid due to security.

    • @HenningKilset76
      @HenningKilset76 3 หลายเดือนก่อน

      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 3 หลายเดือนก่อน

      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 3 หลายเดือนก่อน

      Is it possible with Mistral and train it with my data ?

  • @paulguk
    @paulguk 4 หลายเดือนก่อน +33

    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 3 หลายเดือนก่อน +1

      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.

  • @alfany6252
    @alfany6252 4 หลายเดือนก่อน +46

    It would be better if you told about running local LLM with C#

    • @nickchapsas
      @nickchapsas  4 หลายเดือนก่อน +77

      It’s coming

    • @KibbleWhite
      @KibbleWhite 4 หลายเดือนก่อน

      @@nickchapsas Yes please buddy, loving this insight so far! 💖

    • @irql2
      @irql2 4 หลายเดือนก่อน +2

      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 4 หลายเดือนก่อน

      @@irql2 I want it to be only in my app. I dont want to run other program, run server...

    • @maskettaman1488
      @maskettaman1488 4 หลายเดือนก่อน +3

      It wouldn't be "better", running locally is a totally different scenario for a totally different use case.

  • @danclarkeuk
    @danclarkeuk 4 หลายเดือนก่อน +12

    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 4 หลายเดือนก่อน +4

      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 3 หลายเดือนก่อน

      @@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 3 หลายเดือนก่อน +3

      @@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.

    • @elpe21
      @elpe21 หลายเดือนก่อน

      @@vincenthamelin6115 2 months from your message so not sure if something has changed or not, but it looks like prices are the same . The difference is, Azure page shows prices per 1000 tokens whereas OpenAI page shows per 1_000_000. After watching this video started to think about similar change as @danclerkeuk

  • @HenryETaylor
    @HenryETaylor 3 หลายเดือนก่อน +2

    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!

  • @RoySalisbury
    @RoySalisbury 4 หลายเดือนก่อน +4

    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".

  • @lucaciandrei
    @lucaciandrei 4 หลายเดือนก่อน +57

    Interesting, but costly.

    • @LoganDunning
      @LoganDunning 4 หลายเดือนก่อน +20

      Agreed, calling Open AI Apis ditectly is HUGE cost savings compared to Azure Open AI.

    • @cheronecom
      @cheronecom 4 หลายเดือนก่อน +5

      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 4 หลายเดือนก่อน

      @@LoganDunning Check again, both are the same. (input = $0.005/1k tokens, output = $0.15/1k tokens)

    • @rogeriobarretto
      @rogeriobarretto 4 หลายเดือนก่อน +4

      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 3 หลายเดือนก่อน

      @@LoganDunning It's the same price. GPT-4o 1.5 cents / 1000 input tokens and 3 cents / 1000 output tokens.

  • @zachemny
    @zachemny 3 หลายเดือนก่อน +1

    Also an example of embedding documents with SK into a local model would be very interesting.

  • @TheMannihilator
    @TheMannihilator 4 หลายเดือนก่อน +3

    Thank you for the demo. Maybe you could use another LLM instead of OpenAI stuff.

  • @sergeyz.5845
    @sergeyz.5845 4 หลายเดือนก่อน +1

    didn’t know about that lib. Thank you

  • @Grumpicles
    @Grumpicles 3 หลายเดือนก่อน +1

    That's great. But how much does it cost?

  • @nick066hu
    @nick066hu 4 หลายเดือนก่อน +5

    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 4 หลายเดือนก่อน +3

      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 4 หลายเดือนก่อน +2

      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 4 หลายเดือนก่อน +3

      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 4 หลายเดือนก่อน +2

      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 4 หลายเดือนก่อน

      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?

  • @Chatlan
    @Chatlan 3 หลายเดือนก่อน

    Thanks for the video. It would be interesting to see how to use RAG as well

  • @Sztormus
    @Sztormus 4 หลายเดือนก่อน +2

    Cool video as always! But now we want a stream from World of Warcraft 😂

    • @nickchapsas
      @nickchapsas  4 หลายเดือนก่อน +2

      This has happened already when Dragonflight launched 😂

    • @JustArion
      @JustArion 4 หลายเดือนก่อน +1

      @@nickchapsas Nick the Gamer. Would love to see more of those

  • @davestorm6718
    @davestorm6718 2 หลายเดือนก่อน

    How would you code this to upload an image to AzureAI or ChatGPT and have it process the image?

  • @flybyw
    @flybyw 2 หลายเดือนก่อน

    I was expecting to see Nick discovering that "Nick: " is not in the loop, but he Ctrl+C'ed early every time.

  • @davidjsutherland
    @davidjsutherland 3 หลายเดือนก่อน

    We live in a wild and crazy time.

  • @jorgeserrano4226
    @jorgeserrano4226 3 หลายเดือนก่อน

    @Nick can we use same code when targeting OpenAI instead of AzureOpenAI ? if not, what would be the diffrence ?

  • @craigmcinnes1212
    @craigmcinnes1212 4 หลายเดือนก่อน +7

    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 4 หลายเดือนก่อน +2

      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 3 หลายเดือนก่อน

      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.

  • @shabanelmogy7912
    @shabanelmogy7912 3 หลายเดือนก่อน

    we need big tutorial about blazor and what your opinion in it ?

  • @francescogranozio2780
    @francescogranozio2780 3 หลายเดือนก่อน

    could you make a video that shows the “chat with your files” feature?

  • @tyomidi
    @tyomidi 3 หลายเดือนก่อน +1

    Would have been cool it is was with Llama but I dont see any good way with Dotnet?

  • @alexanderpoplooukhin7448
    @alexanderpoplooukhin7448 3 หลายเดือนก่อน

    What's a benefit to use chatgpt through MS Azure instead of using chatgpt's API?

    • @elpe21
      @elpe21 หลายเดือนก่อน

      Was wondering the same. Looks like MS is not specyfing any limits on requests / token per minute

  • @neociber24
    @neociber24 4 หลายเดือนก่อน

    This make me notice I have never streamed content to a client side app in C#.

  • @sushilb7994
    @sushilb7994 4 หลายเดือนก่อน

    Very nice!

  • @Radictor44
    @Radictor44 3 หลายเดือนก่อน +1

    Where's the kill switch 😂

  • @macoson
    @macoson 4 หลายเดือนก่อน

    Recommend Autogen which is also available for .NET

  • @KarmCraft
    @KarmCraft 4 หลายเดือนก่อน +1

    How to add your domain logic/knowledge?

    • @nickchapsas
      @nickchapsas  4 หลายเดือนก่อน +1

      I’ll show that in a future video but it gets pricy

    • @irql2
      @irql2 4 หลายเดือนก่อน +1

      @@nickchapsas Will be interesting to see what you mean by pricy. The technology to do it is openly available.

  • @vyteniskajackas7579
    @vyteniskajackas7579 4 หลายเดือนก่อน +3

    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

  • @Kotz_en
    @Kotz_en 3 หลายเดือนก่อน

    Does this work with Ollama, or is it just Azure?

    • @Luke-me9qe
      @Luke-me9qe 3 หลายเดือนก่อน

      Yes. You would need another connector. And it is available

  • @scf0carbonete
    @scf0carbonete 4 หลายเดือนก่อน +1

    It's great. Sugestion made a Maui, Onxx, PHI-3 small or Gemini nano , multiple OS's example.

  • @T___Brown
    @T___Brown 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

    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.

  • @mihaimyh
    @mihaimyh 3 หลายเดือนก่อน

    WoW FTW!

  • @ronnyek4242
    @ronnyek4242 3 หลายเดือนก่อน

    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 3 หลายเดือนก่อน

      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 4 หลายเดือนก่อน +1

    No

  • @octaviandobre
    @octaviandobre 3 หลายเดือนก่อน

    Lol you cant just easily create this resource on Azure. You have to create a form to request access. And you need company details, you cant just do this as a normal person with personal email. !!!!!!!!!!!!!

  • @demarcorr
    @demarcorr 4 หลายเดือนก่อน

    i dont wanna and you cant make me.

  • @shikhartomar1459
    @shikhartomar1459 2 หลายเดือนก่อน

    You might want to add line 32 and 33 in the while loop to have a conversation else it will take previous input as next prompt.

    • @elpe21
      @elpe21 หลายเดือนก่อน

      Not sure if I understand this, however you want to resend the history to keep the context otherwise it will loose it.

  • @andreyz3133
    @andreyz3133 4 หลายเดือนก่อน +1

    WoW streams wen ser?

  • @bogdanbanciu1781
    @bogdanbanciu1781 3 หลายเดือนก่อน

    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

  • @igorsolomatov4743
    @igorsolomatov4743 4 หลายเดือนก่อน

    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

  • @dinamohamed13600
    @dinamohamed13600 2 หลายเดือนก่อน

    Thank you , waiting for other AI videos

  • @mingyingxue6815
    @mingyingxue6815 3 หลายเดือนก่อน

    hi, Nick, what is the ide you used in this video? tkx

  • @FraserMcLean81
    @FraserMcLean81 3 หลายเดือนก่อน

    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.

    • @elpe21
      @elpe21 หลายเดือนก่อน

      Can you tell more ? Thinking about switching from OpenAI RestApi

  • @devincarlson8866
    @devincarlson8866 4 หลายเดือนก่อน

    Someone has been playing Cataclysm Classic recently and misses Wrath haven’t they…

  • @Craxmerax
    @Craxmerax 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

      Yield return

    • @ferd1775
      @ferd1775 4 หลายเดือนก่อน

      You could also use llama3 locally and ask it 😉

    • @neociber24
      @neociber24 4 หลายเดือนก่อน

      AsyncIterator?

    • @ferd1775
      @ferd1775 4 หลายเดือนก่อน

      @@neociber24 oh yea. Forgot all about that, I have no use for it generally. Way better solution