Friday, 21 February 2025

AI Agents using Semantic Kernel SDK

 >dotnet new console (After creating a folder in VSCode run this command to create a C# project)

>dotnet add package Microsoft.SemanticKernel --version 1.30.0 (This command will install the Semantic Kernal SDK

>dotnet run

Create Azure OpenAI end-point and deployment and the following code is a hello-world code to test your setup:

using Microsoft.SemanticKernel;

// Populate values from your OpenAI deployment
var modelId = "<Model Name From Deployment>";
var endpoint = "<EndPoint URL>";
var apiKey = "<API KEY>";

// Create a kernel with Azure OpenAI chat completion
var builder = Kernel.CreateBuilder().AddAzureOpenAIChatCompletion(modelId, endpoint, apiKey);

// Build the kernel
Kernel kernel = builder.Build();

var result = await kernel.InvokePromptAsync("Give me a list of breakfast foods with eggs and cheese");
Console.WriteLine(result);

Thursday, 6 February 2025

Links to LLM Articles

  • Crescendo Attack: 2404.01833
  • The Price of Intelligence: The Price of Intelligence - ACM Queue
  • https://arxiv.org/abs/2502.11371v1
  • https://techcommunity.microsoft.com/blog/adforpostgresql/introducing-the-graphrag-solution-for-azure-database-for-postgresql/4299871
  • https://www.microsoft.com/en-us/research/blog/lazygraphrag-setting-a-new-standard-for-quality-and-cost/?msockid=3a065a80a9a960181f744951a89b618b
  • https://techcommunity.microsoft.com/blog/azure-ai-services-blog/graphrag-costs-explained-what-you-need-to-know/4207978
  • https://github.com/Azure-Samples/graphrag-accelerator
  • https://microsoft.github.io/graphrag/
  • https://techcommunity.microsoft.com/blog/azure-ai-services-blog/announcing-new-fine-tuning-capabilities-with-o1-mini-model-on-azure-openai-servi/4358186



Sunday, 25 February 2024

Visual Studio Code | You don't have permissions to push username/repository on GitHub

If you get the following error message when you are trying to commit code from Visual Studio Code to GitHub Repo. The following is an easy fix:

[Step # 1] Go to your control panel -> Credential Manager:


[Step # 2] remove all the GitHub related credentials.

[Step # 3] Then go back to Visual Studio Code and try to commit your code again.

[Step # 4] You will be given a pop-up screen to login to GitHub. Do it and it will solve this problem. 


Saturday, 11 February 2023

Microsoft Azure | Key Phrase Extraction using Azure.AI.TextAnalytics;

Problem Statement:  Extract key phrases from a sentence or a paragraph.

Solution:

Azure documentation link : What is key phrase extraction in Azure Cognitive Service for Language? - Azure Cognitive Services | Microsoft Learn

(Step-1) In Azure Portal create a 'Language Service' under 'cognitive services'.


(Step-2) Select 'Custom text classification & Custom names entity recognition' as shown above.

(Step-3) Create a service.

(Step-4) When the services is created extract the key & uri:


(Step-5) Use the following C# code, insert the key, URI and a sentence. [I used visual studio and installed all the right packages]. That's it :)


using Azure;
using System;
using Azure.AI.TextAnalytics;

namespace KeyPhraseExtractionExample
{
    class Program
    {
        private static readonly AzureKeyCredential credentials = new AzureKeyCredential(<<INSERT KEY>>);
        private static readonly Uri endpoint = new Uri(<<INSERT URI>>);

        // Example method for extracting key phrases from text
        static void KeyPhraseExtractionExample(TextAnalyticsClient client)
        {
            try
            {
                var response = client.ExtractKeyPhrases(<<INSERT SENTENSE>>);
            
                // Printing key phrases
                Console.WriteLine("Key phrases:");

                foreach (string keyphrase in response.Value)
                {
                    Console.WriteLine($"\t{keyphrase}");
                }
            }
            catch (RequestFailedException e)
            {
                Console.WriteLine(e);
            }
        }

        static void Main(string[] args)
        {
            var client = new TextAnalyticsClient(endpoint, credentials);
            KeyPhraseExtractionExample(client);

            Console.Write("Press any key to exit.");
            Console.ReadKey();
        }

    }
}

Executive Summary: Anthropic's Claude Mythos Model

  What Happened Anthropic announced  Claude Mythos Preview , a new AI model it describes as its most capable ever — and so powerful in cyber...