Skip to main content

Posts

How To Query Azure SQL DB Using FAISS and Open-Source AI Model

In today’s data-driven era, where we are dealing with massive data pertaining to different data sources having different data formats, it creates a very big challenge, especially in terms of efficient search and information retrieval. Dive into this deep ocean and locating the correct data is not at all an easy task with AI. In this article, I’ll show you how you can integrate Azure SQL Database, FAISS , and advanced models from Hugging Face to enhance your search capabilities. Let’s take a quick look at each of these pillars. Understanding Terminology Azure SQL Database Azure SQL Database i s a cloud-based service that provides a totally managed database system. The high availability, scalability, and security of this particular service type make it the best option for handling large amounts of data. FAISS FAISS is short for Facebook AI Similarity Search. It is a library written by Facebook AI Research that enables efficient similarity search and clustering of dense vectors. It suppor...

Authenticate your Azure OpenAI Based App Using Microsoft Entra ID

If you’re using Azure OpenAI then you must be aware that the most common and easiest way to authenticate our application is using app-key. The key-based authentication approach is very popular because it is very straightforward. Let's have a quick look at the below code snippet: from openai import AzureOpenAI client = AzureOpenAI ( api_key = 'KEY_GOES_HERE' , api_version = "2024-02-01" , azure_endpoint = 'ENDPOINT_GOES_HERE' ) response = client . completions . create ( model = 'MODEL_GOES_HERE' , prompt = 'Tell me a joke' , max_tokens = 80 ) print ( "\n ##########" ) print ( response . choices [ 0 ] . text ) The above code snippet constructs the AzureOpenAI client object using api-key,api-version, and endpoint. Then, this object makes a call to the completion endpoint with the required parameters. Of course, app key works very well for the experimentation purpose and is not very well suited for ente...