Posts

Showing posts with the label Azure OpenAI Service

Spring AI: Build AI-Driven Applications with Spring Boot and Azure OpenAI

Image
The flow of interaction: Postman sends a request to the REST API. The REST Controller delegates the request to the AI Service . The AI Service uses the OpenAiClient (provided by Spring AI Azure OpenAI Starter) to call the Azure OpenAI API . The Azure OpenAI API interacts with the underlying AI models to generate a response, which is sent back to the client. Tools and Technologies Overview Spring Boot : A Java-based framework for building production-ready applications quickly and efficiently. Azure OpenAI : A cloud-based AI service providing access to advanced language models such as GPT-3.5 and GPT-4. Spring AI Azure OpenAI Starter : A Spring Boot starter that simplifies integration with Azure OpenAI services. Maven : A build automation tool for managing dependencies and building the project. Postman : A tool for testing REST APIs during development. Artificial Intelligence (AI) is revolutionizing how applications are built, offering intelligent features like natural language proc...

How to Integrate Azure OpenAI Service with ASP.NET Core Web API

Image
Integrating Azure OpenAI Service with an ASP.NET application allows you to build web-based solutions powered by OpenAI's GPT models (like GPT-3 or GPT-4) using Azure’s API. Below is an end-to-end guide on how to build an ASP.NET Core Web API application that interacts with the Azure OpenAI Service. Prerequisites Azure Subscription : You need an Azure account to create an OpenAI resource. Azure OpenAI Resource : Create an OpenAI resource in Azure and get your API key and endpoint . .NET SDK : Install the .NET SDK . NuGet Packages : You’ll need the following NuGet packages: Microsoft.Extensions.Configuration Newtonsoft.Json Microsoft.AspNetCore.Mvc.NewtonsoftJson Step 1: Create an ASP.NET Core Web API Project Create a new ASP.NET Core Web API project: dotnet new webapi -n AzureOpenAIServiceApi cd AzureOpenAIServiceApi Step 2: Install NuGet Packages Install the necessary NuGet packages: dotnet add package Newtonsoft .Json dotnet add package Microsoft .Extensions .Configuration ...