<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dhilip S on Medium]]></title>
        <description><![CDATA[Stories by Dhilip S on Medium]]></description>
        <link>https://medium.com/@dhilip2002?source=rss-8e493a965d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*77nss28b42WrnVlqBxv0SA.png</url>
            <title>Stories by Dhilip S on Medium</title>
            <link>https://medium.com/@dhilip2002?source=rss-8e493a965d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 02:42:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhilip2002/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to C#, .NET, Semantic Kernel, and AI: A Beginner’s Guide]]></title>
            <link>https://dhilip2002.medium.com/introduction-to-c-net-semantic-kernel-and-ai-a-beginners-guide-cea3a20a5cd1?source=rss-8e493a965d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cea3a20a5cd1</guid>
            <category><![CDATA[microsoft-semantic-kernel]]></category>
            <category><![CDATA[semantic-kernel]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Dhilip S]]></dc:creator>
            <pubDate>Sun, 08 Dec 2024 15:02:34 GMT</pubDate>
            <atom:updated>2024-12-08T15:02:34.161Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to C#, .NET, Semantic Kernel, and AI: A Beginner’s Guide</h3><p>Programming can be tricky when you’re starting out, but don’t worry! In this guide, we will break down important concepts like C#, the .NET framework, CLI (Common Language Infrastructure), Controllers, Dependency Injection (DI), Plugins, Semantic Kernel (AI), Kernel &amp; IKernel, AI in C# and Microsoft.Extensions.AI in a simple way. We’ll also look at examples with easy-to-understand explanations of how everything flows. This guide is intended for beginners who are new to programming and want to understand the fundamentals of these technologies. By the end, you’ll have a solid foundation to start building your own applications.</p><h3>Understanding C#</h3><p>C# (pronounced C-sharp) is a programming language used to write software. It was created by Microsoft, and it’s a part of the .NET framework. You can use C# to create many types of applications, like websites, desktop apps, mobile apps, and even games!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NNW-0gaLq3II3yuj" /><figcaption><strong>C#</strong></figcaption></figure><p><strong>Real-World Applications of C#:</strong></p><ul><li><strong>Web Applications:</strong> Used with ASP.NET to build dynamic websites.</li><li><strong>Mobile Apps:</strong> Using Xamarin to create cross-platform mobile applications.</li><li><strong>Games:</strong> Used with Unity to develop games for various platforms.</li><li><strong>Desktop Applications:</strong> Used to create applications with a graphical user interface (GUI).</li></ul><p><strong>Basic Structure of a C# Program:</strong></p><pre>using System;<br><br>class Program<br>{<br>    static void Main()<br>    {<br>        Console.WriteLine(&quot;Hello, C#!&quot;);<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The program starts at the <strong><em>Main()</em></strong> method. This is where your program begins.</li><li><strong><em>Console.WriteLine(&quot;Hello, C#!&quot;);</em></strong> tells the program to print the message <strong><em>&quot;Hello, C#!&quot;</em></strong> to the screen.</li><li>Once the message is shown, the program ends.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/">https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/</a></li><li><a href="https://www.w3schools.com/cs/cs_intro.php">https://www.w3schools.com/cs/cs_intro.php</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/dotnet/csharp-notebooks">https://github.com/dotnet/csharp-notebooks</a></li></ul><h3>.NET Framework 🆚 .NET Core</h3><p>The .NET Framework is like a big toolbox that makes writing software easier. It provides tools that help developers do things like handle files, talk to databases, or build web pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8_SlFa3XtcwlmL84.png" /><figcaption><strong>.NET Core vs .NET Framework</strong></figcaption></figure><p><strong>Two Main Parts of .NET:</strong></p><ul><li><strong>CLR (Common Language Runtime):</strong> Think of this as the engine that runs your code.</li><li><strong>BCL (Base Class Library):</strong> This is a collection of pre-made tools and code that you can use to do common tasks.</li></ul><p><strong>.NET Framework vs. .NET Core:</strong> .NET Framework is primarily used for Windows-based applications, while .NET Core is a cross-platform version of .NET that runs on Windows, macOS, and Linux. .NET Core is becoming more popular for new projects due to its flexibility and performance improvements.</p><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotnet-framework">https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotnet-framework</a></li></ul><h3>.NET CLI (Command-Line Interface)</h3><p>The <strong>.NET CLI</strong> (Command-Line Interface) is a set of cross-platform tools that developers use to build, run, and manage .NET applications directly from the command line. It provides a quick, efficient way to interact with the .NET ecosystem without needing to rely on a full integrated development environment (IDE) like Visual Studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/0*OmEC60OwlJKakv8E.png" /><figcaption><strong>.NET CLI</strong></figcaption></figure><p>The .NET CLI helps developers:</p><ul><li>Create and manage .NET projects.</li><li>Build, run, and test applications.</li><li>Publish applications to different environments.</li><li>Manage NuGet packages and dependencies.</li><li>Work on .NET applications across various platforms (Windows, Linux, macOS).</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/core/tools/">https://learn.microsoft.com/en-us/dotnet/core/tools/</a></li></ul><h3>Controllers in C# (MVC Pattern)</h3><p>Finally, introducing MVC controllers (or API Controllers if relevant) as part of application design wraps up the guide. Controllers often use the concepts of DI, AI, and other advanced features, so it’s best placed last as it ties all the pieces together in a real-world architecture.</p><p><strong>Example: Basic Model and Controller in ASP.NET Core</strong></p><pre>// Model.cs<br>public class Product<br>{<br>    public int Id { get; set; }<br>    public string Name { get; set; }<br>    public decimal Price { get; set; }<br>}<br><br>// Controller.cs<br>using Microsoft.AspNetCore.Mvc;<br>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class ProductsController : ControllerBase<br>{<br>    private static List&lt;Product&gt; products = new List&lt;Product&gt;<br>    {<br>        new Product { Id = 1, Name = &quot;Laptop&quot;, Price = 1000 },<br>        new Product { Id = 2, Name = &quot;Phone&quot;, Price = 500 }<br>    };<br>    [HttpGet]<br>    public IEnumerable&lt;Product&gt; Get()<br>    {<br>        return products;<br>    }<br>    [HttpPost]<br>    public IActionResult Post([FromBody] Product product)<br>    {<br>        products.Add(product);<br>        return CreatedAtAction(nameof(Get), new { id = product.Id }, product);<br>    }<br>}<br>// Program.cs<br>using Microsoft.AspNetCore.Hosting;<br>using Microsoft.Extensions.Hosting;<br>public class Program<br>{<br>    public static void Main(string[] args)<br>    {<br>        CreateHostBuilder(args).Build().Run();<br>    }<br>    public static IHostBuilder CreateHostBuilder(string[] args) =&gt;<br>        Host.CreateDefaultBuilder(args)<br>            .ConfigureWebHostDefaults(webBuilder =&gt;<br>            {<br>                webBuilder.UseStartup&lt;Startup&gt;();<br>            });<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li><strong><em>Product</em></strong> class represents a data model with properties <strong><em>Id</em></strong>, <strong><em>Name</em></strong>, and <strong><em>Price</em></strong>.</li><li><strong><em>ProductsController</em></strong> handles HTTP requests. It has two actions: <strong><em>Get()</em></strong> to retrieve all products and <strong><em>Post()</em></strong> to add a new product.</li><li>The <strong><em>Main()</em></strong> method sets up and runs the web host for the application.</li><li>The program starts the web server, and you can interact with the API endpoints to get and add products.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/understanding-models-views-and-controllers-cs">https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/understanding-models-views-and-controllers-cs</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/aspnet/AspNetWebStack/tree/main/src/Microsoft.Web.Mvc">https://github.com/aspnet/AspNetWebStack/tree/main/src/Microsoft.Web.Mvc</a></li></ul><h3>Dependency Injection (DI)</h3><p>Dependency Injection is a way of providing objects to a class instead of creating them inside the class. It’s like letting someone else handle the creation of things you need, so your class can just focus on what it needs to do. This makes your code cleaner and easier to maintain.</p><p><strong>Types of Dependency Injection (DI):</strong></p><ol><li>Constructor Injection</li><li>Property/Setter Injection</li><li>Interface Injection</li></ol><h4>1. Constructor Injection</h4><p>In Constructor Injection, the dependencies are provided through the constructor when the object is created.</p><p><strong>Example: Constructor Injection</strong></p><pre>public interface IMessageService<br>{<br>    void SendMessage(string message);<br>}<br><br>public class EmailService : IMessageService<br>{<br>    public void SendMessage(string message)<br>    {<br>        Console.WriteLine($&quot;Email sent: {message}&quot;);<br>    }<br>}<br><br>public class Notification<br>{<br>    private readonly IMessageService _messageService;<br>    // Constructor Injection<br>    public Notification(IMessageService messageService)<br>    {<br>        _messageService = messageService;<br>    }<br>    public void Notify(string message)<br>    {<br>        _messageService.SendMessage(message);<br>    }<br>}<br><br>// Main program<br>class Program<br>{<br>    static void Main()<br>    {<br>        IMessageService emailService = new EmailService();<br>        Notification notification = new Notification(emailService);<br>        notification.Notify(&quot;Constructor Injection in action!&quot;);<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The <strong><em>Notification</em></strong> class requires an <strong><em>IMessageService</em></strong> to send messages.</li><li>When creating the <strong><em>Notification</em></strong> object, we provide an <strong><em>IMessageService</em></strong> through the constructor.</li><li><strong><em>notification.Notify(&quot;Constructor Injection in action!&quot;);</em></strong> sends the message using the <strong><em>EmailService</em></strong>.</li><li>The program prints<strong><em> “Email sent: Constructor Injection in action!”</em></strong> to the screen.</li><li>The program ends after showing the message.</li></ul><h4>2. Property/Setter Injection</h4><p>In Setter Injection, the dependencies are provided after the class is created, using setter methods or properties.</p><p><strong>Example: Setter Injection</strong></p><pre>public interface IMessageService<br>{<br>    void SendMessage(string message);<br>}<br><br>public class EmailService : IMessageService<br>{<br>    public void SendMessage(string message)<br>    {<br>        Console.WriteLine($&quot;Email sent: {message}&quot;);<br>    }<br>}<br><br>public class Notification<br>{<br>    private IMessageService _messageService;<br>    // Setter Injection<br>    public void SetMessageService(IMessageService messageService)<br>    {<br>        _messageService = messageService;<br>    }<br>    public void Notify(string message)<br>    {<br>        _messageService.SendMessage(message);<br>    }<br>}<br><br>// Main program<br>class Program<br>{<br>    static void Main()<br>    {<br>        IMessageService emailService = new EmailService();<br>        Notification notification = new Notification();<br>        notification.SetMessageService(emailService);<br>        notification.Notify(&quot;Setter Injection in action!&quot;);<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The <strong><em>Notification</em></strong> class has a setter method <strong><em>SetMessageService()</em></strong> to inject the <strong><em>IMessageService</em></strong> after the object is created.</li><li>In the <strong><em>Main()</em></strong> method, we create an instance of <strong><em>EmailService </em></strong>and inject it into the <strong><em>Notification</em></strong> object using the setter method.</li><li><strong><em>notification.Notify(&quot;Setter Injection in action!&quot;);</em></strong> sends the message using the <strong><em>SendMessage()</em></strong> method of <strong><em>EmailService</em></strong>.</li><li>The program prints <strong><em>“Email sent: Setter Injection in action!” </em></strong>to the screen.</li><li>The program ends after showing the message.</li></ul><h4>3. Interface Injection</h4><p>In Interface Injection, the class is required to implement an interface that will accept the dependency.</p><p><strong>Example: Interface Injection</strong></p><pre>public interface IMessageService<br>{<br>    void SendMessage(string message);<br>}<br><br>public interface IMessageServiceConsumer<br>{<br>    void InjectMessageService(IMessageService messageService);<br>}<br><br>public class EmailService : IMessageService<br>{<br>    public void SendMessage(string message)<br>    {<br>        Console.WriteLine($&quot;Email sent: {message}&quot;);<br>    }<br>}<br><br>public class Notification : IMessageServiceConsumer<br>{<br>    private IMessageService _messageService;<br>    // Interface Injection<br>    public void InjectMessageService(IMessageService messageService)<br>    {<br>        _messageService = messageService;<br>    }<br>    public void Notify(string message)<br>    {<br>        _messageService.SendMessage(message);<br>    }<br>}<br><br>// Main program<br>class Program<br>{<br>    static void Main()<br>    {<br>        IMessageService emailService = new EmailService();<br>        Notification notification = new Notification();<br>        notification.InjectMessageService(emailService);<br>        notification.Notify(&quot;Interface Injection in action!&quot;);<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The <strong><em>Notification</em></strong> class implements the <strong><em>IMessageServiceConsumer</em></strong> interface, which requires the <strong><em>InjectMessageService()</em></strong> method.</li><li>The <strong><em>InjectMessageService()</em></strong> method is called to inject the <strong><em>IMessageService</em></strong> dependency into <strong><em>Notification</em></strong>.</li><li><strong><em>notification.Notify(&quot;Interface Injection in action!&quot;);</em></strong> sends the message using the <strong><em>SendMessage()</em></strong> method of <strong><em>EmailService</em></strong>.</li><li>The program prints “<strong><em>Email sent: Interface Injection in action!</em></strong><em>”</em> to the screen.</li><li>The program ends after showing the message.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection">https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection</a></li><li><a href="https://www.scholarhat.com/tutorial/designpatterns/implementation-of-dependency-injection-pattern">https://www.scholarhat.com/tutorial/designpatterns/implementation-of-dependency-injection-pattern</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/fundamentals/dependency-injection">https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/fundamentals/dependency-injection</a></li></ul><h3>Using Plugins for Extensibility in .NET</h3><p>This topic introduces the concept of plugins, which allows for dynamic, extensible architectures. After covering AI, understanding how plugins can further extend your application is a good next step.</p><p><strong>Example: Creating a Simple Plugin System in C#</strong></p><pre>public interface IPlugin<br>{<br>    void Execute();<br>}<br><br>public class HelloWorldPlugin : IPlugin<br>{<br>    public void Execute()<br>    {<br>        Console.WriteLine(&quot;Hello, World!&quot;);<br>    }<br>}<br><br>class Program<br>{<br>    static void Main(string[] args)<br>    {<br>        IPlugin plugin = new HelloWorldPlugin();<br>        plugin.Execute();<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li><strong><em>IPlugin</em></strong> interface defines a contract for plugins with an <strong><em>Execute()</em></strong> method.</li><li><strong><em>HelloWorldPlugin</em></strong> implements the <strong><em>IPlugin</em></strong> interface and provides the <strong><em>Execute()</em></strong> method.</li><li>In the <strong><em>Main()</em></strong> method, an instance of <strong><em>HelloWorldPlugin</em></strong> is created and its <strong><em>Execute()</em></strong> method is called.</li><li>The program prints<strong><em> “Hello, World!”</em></strong> to the screen.</li><li>The program ends after showing the message.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support">https://learn.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support</a></li></ul><h3>Semantic Kernel (SK)</h3><p>Now that the foundation of C# and the infrastructure (DI, .NET, CLI) is laid, you can introduce AI. Semantic Kernel (SK) is like a smart brain for your program that helps it understand human language. It allows programs to do things like answer questions or summarize texts, much like an AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*MS3YMlCV_P8JNw5OX_8UQg.png" /><figcaption><strong>Semantic Kernel</strong></figcaption></figure><p><strong>Practical Applications of Semantic Kernel:</strong></p><ul><li><strong>Chatbots:</strong> To provide intelligent responses to user queries.</li><li><strong>Data Analysis:</strong> To interpret and summarize large datasets.</li><li><strong>Content Generation:</strong> To create human-like text for various uses.</li></ul><p><strong>Example: Using Semantic Kernel to Run AI Tasks:</strong></p><pre>using Microsoft.SemanticKernel;<br>using Microsoft.SemanticKernel.Connectors.OpenAI;<br>using Microsoft.SemanticKernel.TemplateEngine;<br>using Kernel = Microsoft.SemanticKernel.Kernel;<br><br>class Program<br>{<br>    static async Task Main(string[] args)<br>    {<br>        // Prepare the kernel builder<br>        var builder = Kernel.CreateBuilder();<br><br>        // Configure AI service credentials (modify as per your setup)<br>        var (useAzureOpenAI, model, azureEndpoint, apiKey, orgId) = Settings.LoadFromFile();<br><br>        if (useAzureOpenAI)<br>            builder.AddAzureOpenAIChatCompletion(model, azureEndpoint, apiKey);<br>        else<br>            builder.AddOpenAIChatCompletion(model, apiKey, orgId);<br><br>        // Build the kernel<br>        var kernel = builder.Build();<br><br>        // Define the prompt template to summarize content<br>        string skPrompt = &quot;&quot;&quot;<br>        {{$input}}<br><br>        Summarize the content above.<br>        &quot;&quot;&quot;;<br><br>        // Set execution settings for AI model (configure as per your needs)<br>        var executionSettings = new OpenAIPromptExecutionSettings <br>        {<br>            MaxTokens = 2000,<br>            Temperature = 0.2,<br>            TopP = 0.5<br>        };<br><br>        // Define the input content to summarize<br>        var input = &quot;&quot;&quot;<br>        Demo (ancient Greek poet)<br>        From Wikipedia, the free encyclopedia<br>        Demo or Damo (Greek: Δεμώ, Δαμώ; fl. c. AD 200) was a Greek woman of the Roman period, known for a single epigram, engraved upon the Colossus of Memnon, which bears her name. She speaks of herself therein as a lyric poetess dedicated to the Muses, but nothing is known of her life.<br>        Identity<br>        Demo was evidently Greek, as her name, a traditional epithet of Demeter, signifies. The name was relatively common in the Hellenistic world, in Egypt and elsewhere, and she cannot be further identified. The date of her visit to the Colossus of Memnon cannot be established with certainty, but internal evidence on the left leg suggests her poem was inscribed there at some point in or after AD 196.<br>        Epigram<br>        There are a number of graffiti inscriptions on the Colossus of Memnon. Following three epigrams by Julia Balbilla, a fourth epigram, in elegiac couplets, entitled and presumably authored by &quot;Demo&quot; or &quot;Damo&quot; (the Greek inscription is difficult to read), is a dedication to the Muses.<br>        &quot;&quot;&quot;;<br><br>        // Run the prompt and retrieve the result<br>        var result = await kernel.InvokePromptAsync(skPrompt, new() { [&quot;input&quot;] = input });<br><br>        // Output the summarized result<br>        Console.WriteLine(&quot;Summary:&quot;);<br>        Console.WriteLine(result);</pre><p><strong>Code Explanation:</strong></p><ul><li>The <strong><em>Kernel.CreateBuilder()</em></strong> initializes a builder to configure the AI kernel.</li><li>The <strong><em>Settings.LoadFromFile()</em></strong> method retrieves credentials and settings for the AI service (OpenAI or Azure OpenAI).</li><li>Depending on the settings, the builder is configured with either OpenAI or Azure OpenAI service details, such as model name, API keys, and endpoints.</li><li>The <strong><em>builder.Build()</em></strong> creates the AI kernel, which serves as the main engine to process tasks.</li><li>A multi-line string <strong><em>(</em></strong><strong><em>skPrompt)</em></strong> is written as the task template. This instructs the kernel to summarize any text content it receives.</li><li>The <strong><em>OpenAIPromptExecutionSettings</em></strong> object specifies how the AI should behave, such as creativity<strong><em> (</em></strong><strong><em>Temperature)</em></strong>, randomness <strong><em>(</em></strong><strong><em>TopP)</em></strong>, and maximum response length <strong><em>(</em></strong><strong><em>MaxTokens)</em></strong>.</li><li>A detailed description of an ancient Greek poet is assigned to the <strong><em>input</em></strong> variable, serving as the content to be summarized.</li><li>The <strong><em>InvokePromptAsync()</em></strong> method sends the defined prompt and the input text to the kernel for processing.</li><li>The kernel uses the provided prompt and input to generate a concise summary based on the AI model’s understanding.</li><li>The summarized result from the kernel is displayed on the console.</li><li>Once the summary is printed, the program concludes its execution.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/semantic-kernel/overview/">https://learn.microsoft.com/en-us/semantic-kernel/overview/</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/microsoft/semantic-kernel">https://github.com/microsoft/semantic-kernel</a></li></ul><h3>Kernel and IKernel</h3><p>Following the introduction to Semantic Kernel, explaining the Kernel and IKernel interfaces helps tie the practical aspect of AI (in the form of SK) to real-world coding implementations.</p><p><strong>What is Kernel?</strong> The Kernel is the AI engine that runs tasks and interacts with other parts of the program.</p><p><strong>What is IKernel?</strong> IKernel is like a set of instructions that says, “If you are going to be a Kernel, you must have these functions to work.”</p><p><strong>Example: Implementing Kernel and IKernel</strong></p><pre>using Microsoft.SemanticKernel;<br><br>public interface IKernel<br>{<br>    Task&lt;string&gt; ExecuteTaskAsync(string task);<br>}<br><br>public class MyKernel : IKernel<br>{<br>    public async Task&lt;string&gt; ExecuteTaskAsync(string task)<br>    {<br>        return $&quot;Task &#39;{task}&#39; executed successfully!&quot;;<br>    }<br>}<br>class Program<br>{<br>    static async Task Main(string[] args)<br>    {<br>        IKernel kernel = new MyKernel();<br>        var result = await kernel.ExecuteTaskAsync(&quot;Hello AI&quot;);<br>        Console.WriteLine(result);  // Output: Task &#39;Hello AI&#39; executed successfully!<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li><strong><em>IKernel</em></strong> defines what tasks the Kernel must be able to do.</li><li><strong><em>MyKernel</em></strong> is a class that does the job of executing tasks, and it follows the instructions in the <strong><em>IKernel</em></strong> interface.</li><li>In <strong><em>Main()</em></strong>, we create an instance of <strong><em>MyKernel</em></strong> and use it to run the task <strong><em>&quot;Hello AI&quot;.</em></strong></li><li>The result is returned and printed: <strong><em>“Task ‘Hello AI’ executed successfully!”.</em></strong></li><li>The program ends after displaying the result.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/semantic-kernel/concepts/kernel?pivots=programming-language-csharp">https://learn.microsoft.com/en-us/semantic-kernel/concepts/kernel?pivots=programming-language-csharp</a></li><li><a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.semantickernel.ikernelbuilder?view=semantic-kernel-dotnet">https://learn.microsoft.com/en-us/dotnet/api/microsoft.semantickernel.ikernelbuilder?view=semantic-kernel-dotnet</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/microsoft/semantic-kernel">https://github.com/microsoft/semantic-kernel</a></li></ul><h3>AI in C#: Working with AI Models</h3><p>Now that the basics of AI and Semantic Kernel are covered, discussing how to work with AI models in C# is a natural extension. It introduces practical examples of how to use pre-built models and extend your AI capabilities.</p><p><strong>Example: Simple AI Task in C#</strong></p><pre>using System;<br>using System.Threading.Tasks;<br>using Azure;<br>using Azure.AI.OpenAI;<br><br>class Program<br>{<br>    static async Task Main(string[] args)<br>    {<br>        // Azure OpenAI service details<br>        string endpoint = &quot;https://&lt;your-azure-openai-endpoint&gt;.openai.azure.com/&quot;; // Replace with your Azure endpoint<br>        string apiKey = &quot;&lt;your-api-key&gt;&quot;; // Replace with your Azure API key<br>        string modelName = &quot;&lt;your-model-name&gt;&quot;; // Replace with your model (e.g., &quot;gpt-4&quot;)<br>        // Create the Azure OpenAI client<br>        var client = new OpenAIClient(new Uri(endpoint), new AzureKeyCredential(apiKey));<br>        // User&#39;s question<br>        string input = &quot;What is the capital of France?&quot;;<br>        // Get the AI&#39;s response<br>        string response = await GetAIResponseAsync(client, modelName, input);<br>        // Print the response<br>        Console.WriteLine(&quot;AI Response:&quot;);<br>        Console.WriteLine(response);<br>    }<br><br>    static async Task&lt;string&gt; GetAIResponseAsync(OpenAIClient client, string modelName, string input)<br>    {<br>        // Configure the request options<br>        var completionOptions = new CompletionsOptions<br>        {<br>            Prompt = input,<br>            MaxTokens = 100,<br>            Temperature = 0.7f<br>        };<br>        // Request AI completion<br>        var response = await client.GetCompletionsAsync(modelName, completionOptions);<br>        // Return the AI&#39;s response<br>        return response.Value.Choices[0].Text.Trim();<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The <strong><em>OpenAIClient</em></strong> is created using Azure service details like <strong><em>endpoint</em></strong> and <strong><em>apiKey</em></strong>, ensuring secure communication.</li><li>The <strong><em>input</em></strong> variable stores the user&#39;s question (e.g., &quot;What is the capital of France?&quot;).</li><li>In the <strong><em>GetAIResponseAsync</em></strong> method, <strong><em>CompletionsOptions</em></strong> is configured to control the AI&#39;s behavior, including:</li><li><strong>Prompt</strong>: The user’s query.</li><li><strong>MaxTokens</strong>: Limits the response length.</li><li><strong>Temperature</strong>: Adjusts creativity in responses.</li><li><strong><em>GetCompletionsAsync</em></strong> sends the request to Azure OpenAI, specifying the AI model and options.</li><li>The AI’s response is retrieved, and the first choice of the completion is extracted, trimmed, and returned.</li><li>The AI’s response is displayed to the user using <strong><em>Console.WriteLine</em></strong>.</li><li>After printing the response, the program ends.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/ai/">https://learn.microsoft.com/en-us/dotnet/ai/</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/dotnet/ai-samples">https://github.com/dotnet/ai-samples</a></li></ul><h3>Microsoft.Extensions.AI</h3><p>After exploring Semantic Kernel, it’s a good idea to explain Microsoft.Extensions.AI as it provides tools and libraries that can help developers incorporate AI tasks seamlessly into .NET applications.</p><p><strong>Example: Using Microsoft.Extensions.AI for AI Tasks</strong></p><pre>using Azure.AI.OpenAI;<br>using Microsoft.Extensions.AI;<br>using MicrosoftExtensionsAiSample.Utils;<br>using OpenAI;<br>using System.ClientModel;<br><br>class Program<br>{<br>    static async Task Main(string[] args)<br>    {<br>        // Get the Azure OpenAI endpoint and API key<br>        string azureOpenAiEndpoint = ConsoleHelper.GetString(&quot;Enter your Azure OpenAI endpoint:&quot;);<br>        string azureOpenAiKey = ConsoleHelper.GetString(&quot;Enter your Azure OpenAI API key:&quot;);<br>        string azureOpenAiModel = ConsoleHelper.GetString(&quot;Enter your Azure OpenAI chat model name:&quot;);<br><br>        // Create the Azure OpenAI chat client<br>        var chatClient = new AzureOpenAIClient(new Uri(azureOpenAiEndpoint), new ApiKeyCredential(azureOpenAiKey))<br>                         .AsChatClient(azureOpenAiModel);<br><br>        // Check if the chat client is valid<br>        if (chatClient is null)<br>        {<br>            ConsoleHelper.DisplayError(&quot;Invalid chat host selected.&quot;);<br>            return;<br>        }<br><br>        // Show header<br>        ConsoleHelper.ShowHeader();<br><br>        // Create a list of chat messages<br>        List&lt;ChatMessage&gt; chatMessages = new List&lt;ChatMessage&gt;();<br><br>        // Loop for the chat<br>        while (true)<br>        {<br>            // Get the user message<br>            string userMessage = ConsoleHelper.GetString(&quot;Enter your message (type &#39;exit&#39; to quit):&quot;, false);<br><br>            // Check for exit condition<br>            if (userMessage.Equals(&quot;exit&quot;, StringComparison.OrdinalIgnoreCase) ||<br>                userMessage.Equals(&quot;quit&quot;, StringComparison.OrdinalIgnoreCase))<br>            {<br>                Console.WriteLine(&quot;Exiting the chat. Goodbye!&quot;);<br>                break;<br>            }<br><br>            // Add the user message to the chat messages<br>            chatMessages.Add(new ChatMessage(ChatRole.User, userMessage));<br><br>            Console.WriteLine();<br>            Console.WriteLine(&quot;AI:&quot;);<br><br>            // Send the chat messages to the model and stream the response messages<br>            await foreach (var update in chatClient.CompleteStreamingAsync(chatMessages))<br>            {<br>                Console.Write(update);<br>            }<br><br>            Console.WriteLine();<br>            Console.WriteLine();<br>        }<br>    }<br>}</pre><p><strong>Code Explanation:</strong></p><ul><li>The code uses namespaces like <strong><em>Azure.AI.OpenAI</em></strong>, <strong><em>Microsoft.Extensions.AI</em></strong>, and others to integrate Azure OpenAI functionalities and utilities for the application.</li><li>The <strong><em>Main</em></strong> method is defined as the entry point of the application with an asynchronous execution model (<strong><em>async</em></strong>).</li><li>The program collects three inputs from the user like <strong><em>Azure OpenAI endpoint</em></strong>, <strong><em>Azure OpenAI API key</em></strong>, The <strong><em>chat model name</em></strong> to be used for interaction.</li><li>A chat client is created using <strong><em>Azure OpenAI endpoint</em></strong>,<strong><em>API key </em></strong>for authentication, <strong><em>model name</em></strong> to specify the chat model.</li><li>The <strong><em>AzureOpenAIClient</em></strong> instance is converted into a <strong><em>ChatClient</em></strong> using <strong><em>.AsChatClient(azureOpenAiModel)</em></strong>.</li><li>The program checks if the <strong><em>chatClient</em></strong> is valid (<strong><em>null</em></strong> check). If invalid, it displays an error and terminates execution.</li><li>A custom header is displayed using <strong><em>ConsoleHelper.ShowHeader()</em></strong> to structure the user interface.</li><li>A list named <strong><em>chatMessages</em></strong> is initialized to store messages exchanged between the user and the AI model.</li><li>The program enters an infinite loop to continuously handle user input and AI responses.</li><li>Inside the loop The user is prompted to enter a message. then the message is added to the <strong><em>chatMessages</em></strong> list as a <strong><em>ChatMessage</em></strong> with <strong><em>ChatRole.User.</em></strong></li><li>The program streams the AI’s response for the given chat messages using <strong><em>CompleteStreamingAsync(chatMessages)</em></strong>.</li><li>The AI’s response is streamed and displayed to the console in real time using <strong><em>await foreach</em></strong>.</li><li>After displaying the AI’s response, the loop starts over, prompting the user for another message.</li><li>The input is compared to the strings <strong><em>exit</em></strong> and <strong><em>quit</em></strong> using the <strong><em>Equals</em></strong> method with <strong><em>StringComparison.OrdinalIgnoreCase</em></strong>.</li><li>This ensures the check is case-insensitive, allowing variations like <strong><em>Exit</em></strong> or <strong><em>EXIT</em></strong> to be valid.</li></ul><p><strong><em>Reference:</em></strong></p><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/ai/ai-extensions">https://learn.microsoft.com/en-us/dotnet/ai/ai-extensions</a></li></ul><p><strong><em>Github:</em></strong></p><ul><li><a href="https://github.com/dotnet/ai-samples">https://github.com/dotnet/ai-samples</a></li></ul><h3>Conclusion</h3><p>This guide has introduced fundamental concepts like C#, the .NET framework, CLI, Dependency Injection, and AI integration using Semantic Kernel, along with practical examples. By understanding these core concepts, beginners can start building applications using C# and .NET, incorporate AI functionality, and use advanced tools like Semantic Kernel for natural language processing tasks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cea3a20a5cd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uipath Citizen Developer SKILL-A-THON 2022]]></title>
            <link>https://medium.com/hackgenius/uipath-citizen-developer-skill-a-thon-2022-f73ce9e988f1?source=rss-8e493a965d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f73ce9e988f1</guid>
            <category><![CDATA[ict-academy]]></category>
            <category><![CDATA[uipath-studiox]]></category>
            <category><![CDATA[skillathon-2022]]></category>
            <category><![CDATA[uipath-academic-alliance]]></category>
            <category><![CDATA[rap]]></category>
            <dc:creator><![CDATA[Dhilip S]]></dc:creator>
            <pubDate>Mon, 22 May 2023 15:36:39 GMT</pubDate>
            <atom:updated>2024-08-17T06:34:01.434Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>Uipath Citizen Developer SKILL-A-THON 2022 </strong>was an incredible and an wonderful experience. This Skillathon was conducted by <a href="https://www.uipath.com/"><strong>Uipath</strong></a><strong> </strong>under the Academic Alliance with <strong>ICT Academy</strong>. This skillathon is for <strong>college students of ICT Academy member institutions</strong>. The skillathon lasted from <strong>January 2023 — March 2023</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NbkEqofnEeOqhDiz4xQPrQ.png" /><figcaption>Uipath Citizen Developer SKILL-A-THON 2022</figcaption></figure><p>The hackathon comprised of 4 steps:</p><ul><li>Self learning Modules</li><li>Masterclass with Uipath MVP</li><li>Bot building sessions</li><li>Build your Automation Challenge</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*UyugGzbZwI0o_rZs4a6bGg.png" /><figcaption>Contest Process</figcaption></figure><p>There were<strong> 29,000 students</strong> from <strong>201 institutions</strong> registered in which <strong>16,090 students completed learning </strong>and built<strong> 8,330 bots using UiPath StudioX</strong>, a no-code drag &amp; drop automation platform.</p><p>I was very excited when I saw this opportunity posted in an<strong> RPA - Metazord</strong> <strong>WA group </strong>by <strong>Mrs Pavithra TR</strong> (RPA Trainer). This skillathon happened during my 5th semester end examinations so I thought of concentrating only in my academics. Before the last day of the registration I thought of just participating in this skillathon and I have registered for this wonderful event.</p><p>Then I logged into my<strong> </strong><a href="https://academy.uipath.com/"><strong>Uipath Academy</strong></a> account to complete the <strong>self learning module</strong>. I have completed my self learning module within a week and received the certificate from Uipath Academy.</p><p>Then I have attended the <strong>Masterclass with Uipath MVP</strong> and the Bot building sessions to enrich my practical knowledge in Uipath StudioX.</p><p>Then I have reached the <strong>Build your Automation Challenge</strong> in which <strong>minimum of 2 bots</strong> should be built by a student using StudioX to receive Skillathon Certificate and a Special Badge.</p><p>In the <strong>Build your Automation Challenge</strong> I have created three bots which includes</p><ul><li><a href="https://www.youtube.com/watch?v=IgyfVYy784I&amp;t=23s"><strong>Open AI Chatbot</strong></a><strong> -</strong> The API key of ChatGPT is fed as an input to the HTTP Header. So this bot works similar to a ChatGPT. It will answer the questions and save the answer to a word file then the word file is converted into a pdf and gets saved in your project folder.</li><li><a href="https://www.youtube.com/watch?v=t3VpVkXHreA&amp;t=16s"><strong>Spelling Correction Bot</strong></a><strong> - </strong>This bot fetches the input from the Excel file which consists of spelling mistakes is present in a column. The API key of ChatGPT is fed as an input to the HTTP Header which rectifies the error and types automatically in the output column.</li><li><a href="https://www.youtube.com/watch?v=SzM-6qEQTiw&amp;list=PLxZsFlxqJ8GpAyP8j3jeP-3LMHduCr-zq&amp;index=4&amp;t=23s"><strong>Automatic Form Filler</strong></a> - This bot fetches the Student Details from and fills the Student Details automatically.</li></ul><p>The execution videos of the projects are uploaded in <a href="https://www.youtube.com/playlist?list=PLxZsFlxqJ8GpAyP8j3jeP-3LMHduCr-zq">youtube</a> and the project files are submitted for further evaluation process.</p><p>Finally <strong>On March 17, 2023 around 11am</strong> the <strong>results</strong> were released for the <strong>Top 3 Student Winners</strong>. It was really a proud moment as my HOD sir, Class Advisor mam and my RPA Trainer mam has congratulated me for this victory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xe8vue1zv1-CAIDCDG3-tw.png" /><figcaption>Top 3 Student Winners</figcaption></figure><p>I received <strong>Uipath Academy RPA Citizen Developer Foundation Training</strong> for completing the Self learning module issued through <a href="https://credentials.uipath.com/">UiPath Credential</a> platform and I got listed on <a href="https://credentials.uipath.com/profile/dhilips262091/wallet#gs.u4oenw">UiPath Credential Directory</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X__XuBxUdK78xXzEtMttVA.png" /><figcaption>Uipath Academy RPA Citizen Developer Foundation Training</figcaption></figure><p>I received <strong>Uipath Academic Alliance Skill-A-Thon RPA Citizen Developer</strong> for completing the Build your automation Challenge issued through <a href="https://credentials.uipath.com/"><strong>UiPath Credential</strong></a> platform and I got listed on <a href="https://credentials.uipath.com/profile/dhilips262091/wallet#gs.u4oenw"><strong>UiPath Credential Directory</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-Dgq2OYxAHt_T7iYScg7g.png" /><figcaption>Uipath Academic Alliance Skill-A-Thon RPA Citizen Developer</figcaption></figure><p>Uipath has created a video for the journey of Uipath Citizen Developer SKILL-A-THON 2022.</p><p><a href="https://drive.google.com/file/d/1sX2N9Cv6GMKw5wMuPud3921kIZK24dRt/view">Uipath Skill-A-Thon Video.mp4</a></p><p><strong>Press Coverage</strong>:</p><ul><li><a href="https://www.cxotoday.com/press-release/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon/">https://www.cxotoday.com/press-release/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon/</a></li><li><a href="https://timesofindia.indiatimes.com/business/startups/trend-tracking/building-software-robots-quickly-without-coding/articleshow/99463236.cms?from=mdr">https://timesofindia.indiatimes.com/business/startups/trend-tracking/building-software-robots-quickly-without-coding/articleshow/99463236.cms?from=mdr</a></li><li><a href="https://indiaeducationdiary.in/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon/">https://indiaeducationdiary.in/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon/</a></li><li><a href="https://www.itvoice.in/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon">https://www.itvoice.in/200-indian-colleges-showcase-their-automation-skills-by-building-8000-bots-in-the-3rd-edition-of-uipath-ict-academy-skill-a-thon</a></li><li><a href="https://www.thehindu.com/education/news-from-the-world-of-education-march-21-2023/article66644486.ece">https://www.thehindu.com/education/news-from-the-world-of-education-march-21-2023/article66644486.ece</a></li><li><a href="https://www.msn.com/en-in/money/news/building-software-robots-quickly-without-coding/ar-AA19Onyy">https://www.msn.com/en-in/money/news/building-software-robots-quickly-without-coding/ar-AA19Onyy</a></li></ul><p>I felt really proud and excited because my achievement was published in the<strong> Times of India (Mumbai Edition)</strong> in <strong>times techies page (Page No:21)</strong> <strong>dated 12.04.2023</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*YoVSJk7IAwD-F8W8p8f37g.png" /><figcaption>Times of India (Times Techies)-12.04.2023</figcaption></figure><p>Thanks to<strong> Uipath</strong> , <strong>ICT Academy</strong> , <strong>KGiSL Institute of Technology</strong> , <strong>House of Metazord - KGiSL Educational Institutions</strong> for providing this wonderful oppurtunity. This day is definitely going to be part of my most remarkable memories.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f73ce9e988f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackgenius/uipath-citizen-developer-skill-a-thon-2022-f73ce9e988f1">Uipath Citizen Developer SKILL-A-THON 2022</a> was originally published in <a href="https://medium.com/hackgenius">hackgenius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>