Home

Awesome

Spring AI Workshop for Azure

Prerequisites

Before you beginm make sure to set the following environment variables.

export SPRING_AI_AZURE_OPENAI_API_KEY=<INSERT KEY HERE>
export SPRING_AI_AZURE_OPENAI_ENDPOINT=<INSERT ENDPOINT URL HERE>

Create Azure AI Deployments

The configuration assumes you have already created deployments of the following names in the Azure OpenAI Studio

NOTE: Spring configuration properties currently use the property-name model instead of deployment-name so don't get confused. Spring AI will be renaming the property in the future to avoid confusion. See here for more information.

For the chat, the configuration in application.properties should contain the following

spring.ai.azure.openai.chat.options.model=gpt-35-turbo-16k

The default value for the embedding model is text-embedding-ada-002, but if you wanted to change it you would set the configuration in application.properties as shown below.

spring.ai.azure.openai.embedding.options.model=text-embedding-ada-002

Workshop Overview

The workshop consists of six examples, each with a dedicated README file.

All six workshop examples are organized into individual Java packages within this project. In each package, you'll find a Spring @RestController class that serves as the entry point for showcasing the discussed functionality.

To interact with the @RestController, you will be using the http utility as a user-friendly alternative to curl.

Detailed instructions and exercises for each example can be found in their respective README files:

These guides will walk you through the workshop exercises.