https://github.com/Azure-Samples/spring-ai-azure-workshop
Workshop material for Spring AI and Azure OpenAI Service
https://github.com/Azure-Samples/spring-ai-azure-workshop
Last synced: about 2 months ago
JSON representation
Workshop material for Spring AI and Azure OpenAI Service
- Host: GitHub
- URL: https://github.com/Azure-Samples/spring-ai-azure-workshop
- Owner: Azure-Samples
- License: mit
- Created: 2023-08-29T19:23:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T23:18:58.000Z (about 1 year ago)
- Last Synced: 2024-04-16T10:17:44.023Z (about 1 year ago)
- Language: Java
- Size: 130 KB
- Stars: 28
- Watchers: 15
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-spring-ai - Workshop material for Azure OpenAI - contains step-by-step examples from 'hello world' to 'retrieval augmented generation' (Learning Resources / Workshops)
- awesome-spring-ai - Workshop material for Azure OpenAI - contains step-by-step examples from 'hello world' to 'retrieval augmented generation' (Learning Resources / Workshops)
README
# Spring AI Workshop for Azure
## Prerequisites
Before you beginm make sure to set the following environment variables.
```shell
export SPRING_AI_AZURE_OPENAI_API_KEY=
export SPRING_AI_AZURE_OPENAI_ENDPOINT=
```### Create Azure AI Deployments
The configuration assumes you have already created deployments of the following names in the Azure OpenAI Studio
* Deployment Name: `gpt-35-turbo-16k` with the model `gpt-35-turbo-16k`
* Deployment Name: `text-embedding-ada-002` with the model `text-embedding-ada-002`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](https://docs.spring.io/spring-ai/reference/api/clients/azure-openai-chat.html#_deployment_name) 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:
* 1-README-tell-me-a-joke.md
* 2-README-prompt-templating.md
* 3-README-prompt-roles.md
* 4-README-output-parser.md
* 5-README-stuff-prompt.md
* 6-README-retrieval-augmented-generation.mdThese guides will walk you through the workshop exercises.