├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── azure-app-service.yml │ ├── azure-container-apps.yml │ ├── azure-kubernetes-service.yml │ └── azure-spring-apps.yml ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.md ├── README.md ├── deploy-AKS.sh ├── mvnw ├── mvnw.cmd ├── openaibot.yaml ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── microsoft │ │ └── samples │ │ └── springopenai │ │ ├── OpenAIService.java │ │ ├── RestEndpoint.java │ │ ├── SpringOpenAIApplication.java │ │ └── data │ │ ├── CompletionRequest.java │ │ ├── EventChoice.java │ │ └── EventData.java └── resources │ └── application.properties └── test └── java └── com └── microsoft └── samples └── springopenai └── SpringOpenAIApplicationTests.java /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows (which version?). Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd spring-openai-bot 31 | git checkout [branch-name] 32 | ./mvnw test 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | 46 | -------------------------------------------------------------------------------- /.github/workflows/azure-app-service.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Azure App Service 2 | 3 | #### 4 | # This app runs with a key and URL for Azure OpenAI Service: https://azure.microsoft.com/en-us/products/cognitive-services/openai-service/ 5 | # https://azure.microsoft.com/en-us/products/cognitive-services/openai-service/ 6 | # Add the following values in two places: 7 | # 1. Action secrets in this GitHub Repo: Settings > Secrets and Variables > Actions 8 | # 2. Application settings of you destination App Service: Configuration > Application Settings. 9 | # Values: 10 | # APPLICATION_OPENAI_KEY= 11 | # APPLICATION_OPENAI_URL=Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy 12 | # 13 | # App Service Destination setup: 14 | # Get an Azure App Service Publish Profile: https://learn.microsoft.com/en-us/visualstudio/azure/how-to-get-publish-profile-from-azure-app-service 15 | # Add the following values in secrets in this GitHub Repo: 16 | # The name of your destination App Service: 17 | # Values: 18 | # 1. AZUREAPPSERVICE_DESTINATION= 19 | # 2. AZUREAPPSERVICE_PUBLISHPROFILE= 20 | # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy 21 | #### 22 | 23 | on: 24 | push: 25 | branches: 26 | - main 27 | workflow_dispatch: 28 | 29 | jobs: 30 | build: 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - name: Checkout code 35 | uses: actions/checkout@v3 36 | - name: Set up Java 37 | uses: actions/setup-java@v3 38 | with: 39 | distribution: 'temurin' 40 | java-version: '17' 41 | cache: 'maven' 42 | - name: Build with Maven 43 | run: ./mvnw clean package 44 | - name: Upload artifact for deployment job 45 | uses: actions/upload-artifact@v3 46 | with: 47 | name: java-app 48 | path: '${{ github.workspace }}/target/*.jar' 49 | 50 | deploy: 51 | runs-on: ubuntu-latest 52 | needs: build 53 | environment: 54 | name: 'Production' 55 | url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} 56 | 57 | steps: 58 | - name: Download artifact from build job 59 | uses: actions/download-artifact@v3 60 | with: 61 | name: java-app 62 | 63 | - name: Deploy to Azure Web App 64 | id: deploy-to-webapp 65 | uses: azure/webapps-deploy@v2 66 | with: 67 | app-name: ${{ secrets.AZUREAPPSERVICE_DESTINATION }} 68 | slot-name: 'Production' 69 | publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE }} 70 | package: '*.jar' 71 | -------------------------------------------------------------------------------- /.github/workflows/azure-container-apps.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Azure Container Apps 2 | 3 | #### 4 | # This GitHub Action requires the following secrets: 5 | # AZURE_CREDENTIALS : a JSON payload allowing access to your Azure resources 6 | # RESOURCE_GROUP_NAME : the name of the Azure resource group containing your Azure Container Apps instance 7 | # CONTAINER_NAME : the name of your Azure Container Apps instance 8 | # REGISTRY_URL : the URL of your container registry 9 | # REGISTRY_USERNAME : the username of your container registry 10 | # REGISTRY_PASSWORD : the password of your container registry 11 | #### 12 | 13 | on: 14 | push: 15 | branches: 16 | - main 17 | 18 | jobs: 19 | deploy: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v3 24 | - name: Set up Java 25 | uses: actions/setup-java@v3 26 | with: 27 | distribution: 'temurin' 28 | java-version: '17' 29 | cache: 'maven' 30 | - name: Build Spring Boot application with GraalVM 31 | run: | 32 | ./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=${{ secrets.REGISTRY_URL }}/com.microsoft.samples.springopenai/spring-openai-bot:${{ github.sha }} 33 | - name: Log in to container registry 34 | uses: docker/login-action@v2 35 | with: 36 | registry: ${{ secrets.REGISTRY_URL }} 37 | username: ${{ secrets.REGISTRY_USERNAME }} 38 | password: ${{ secrets.REGISTRY_PASSWORD }} 39 | - name: Docker push to container registry 40 | run: | 41 | docker image push ${{ secrets.REGISTRY_URL }}/com.microsoft.samples.springopenai/spring-openai-bot:${{ github.sha }} 42 | - name: Azure Login 43 | uses: azure/login@v1 44 | with: 45 | creds: ${{ secrets.AZURE_CREDENTIALS }} 46 | - name: Deploy to Azure Container Apps 47 | uses: azure/CLI@v1 48 | with: 49 | inlineScript: | 50 | az config set extension.use_dynamic_install=yes_without_prompt 51 | az containerapp update -n ${{ secrets.CONTAINER_NAME }} -g ${{ secrets.RESOURCE_GROUP_NAME }} --image ${{ secrets.REGISTRY_URL }}/com.microsoft.samples.springopenai/spring-openai-bot:${{ github.sha }} 52 | -------------------------------------------------------------------------------- /.github/workflows/azure-kubernetes-service.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Azure Kubernetes Service 2 | 3 | #### 4 | # This app runs with a key and URL for Azure OpenAI Service: https://azure.microsoft.com/en-us/products/cognitive-services/openai-service/ 5 | # https://azure.microsoft.com/en-us/products/cognitive-services/openai-service/ 6 | # And a service principal with access to an Azure container registry and an Azure Kubernetes Service 7 | # Add the following values in secrets in this GitHub Repo: Settings > Secrets and Variables > Actions 8 | # Values: 9 | # AZURE_CLIENT_ID 10 | # AZURE_SUBSCRIPTION_ID 11 | # AZURE_TENANT_ID 12 | # Then set up the env: section below with the values for your destination AKS/ACR instances. 13 | #### 14 | 15 | "on": 16 | push: 17 | branches: 18 | - main 19 | workflow_dispatch: {} 20 | env: 21 | ACR_RESOURCE_GROUP: 22 | AZURE_CONTAINER_REGISTRY: 23 | CLUSTER_NAME: 24 | CLUSTER_RESOURCE_GROUP: 25 | CONTAINER_NAME: 26 | DEPLOYMENT_MANIFEST_PATH: | 27 | ./openaibot.yaml 28 | jobs: 29 | buildImage: 30 | permissions: 31 | contents: read 32 | id-token: write 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v3 36 | - uses: azure/login@v1 37 | name: Azure login 38 | with: 39 | client-id: ${{ secrets.AZURE_CLIENT_ID }} 40 | subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} 41 | tenant-id: ${{ secrets.AZURE_TENANT_ID }} 42 | - name: Build and push image to ACR 43 | run: az acr build --image ${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.ACR_RESOURCE_GROUP }} -f ./Dockerfile ./ 44 | deploy: 45 | permissions: 46 | actions: read 47 | contents: read 48 | id-token: write 49 | runs-on: ubuntu-latest 50 | needs: 51 | - buildImage 52 | steps: 53 | - uses: actions/checkout@v3 54 | - uses: azure/login@v1 55 | name: Azure login 56 | with: 57 | client-id: ${{ secrets.AZURE_CLIENT_ID }} 58 | subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} 59 | tenant-id: ${{ secrets.AZURE_TENANT_ID }} 60 | - uses: azure/use-kubelogin@v1 61 | name: Set up kubelogin for non-interactive login 62 | with: 63 | kubelogin-version: v0.0.25 64 | - uses: azure/aks-set-context@v3 65 | name: Get K8s context 66 | with: 67 | admin: "false" 68 | cluster-name: ${{ env.CLUSTER_NAME }} 69 | resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} 70 | use-kubelogin: "true" 71 | - uses: Azure/k8s-deploy@v4 72 | name: Deploys application 73 | with: 74 | action: deploy 75 | images: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }} 76 | manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }} 77 | namespace: default 78 | -------------------------------------------------------------------------------- /.github/workflows/azure-spring-apps.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Azure Spring Apps 2 | 3 | #### 4 | # This GitHub Action requires the following secrets: 5 | # AZURE_CREDENTIALS : a JSON payload allowing access to your Azure resources 6 | # RESOURCE_GROUP_NAME : the name of the Azure resource group containing your Azure Spring Apps instance 7 | # SPRING_CLUSTER_NAME : the name of your Azure Spring Apps cluster 8 | # APPLICATION_NAME : the name of your Azure Spring Apps instance 9 | #### 10 | 11 | on: 12 | push: 13 | branches: 14 | - main 15 | 16 | jobs: 17 | deploy: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout code 21 | uses: actions/checkout@v3 22 | - name: Set up Java 23 | uses: actions/setup-java@v3 24 | with: 25 | distribution: 'temurin' 26 | java-version: '17' 27 | cache: 'maven' 28 | - name: Build Spring Boot application 29 | run: | 30 | ./mvnw package 31 | - name: Azure Login 32 | uses: azure/login@v1 33 | with: 34 | creds: ${{ secrets.AZURE_CREDENTIALS }} 35 | - name: Deploy to Azure Spring Apps 36 | uses: azure/CLI@v1 37 | with: 38 | inlineScript: | 39 | az config set extension.use_dynamic_install=yes_without_prompt 40 | az extension add --name containerapp --upgrade 41 | az provider register --namespace Microsoft.App 42 | az provider register --namespace Microsoft.OperationalInsights 43 | az extension add --yes --source https://ascprivatecli.blob.core.windows.net/cli-extension/spring-1.1.11-py3-none-any.whl 44 | az provider register --namespace Microsoft.AppPlatform 45 | az spring app deploy -n ${{ secrets.APPLICATION_NAME }} -g ${{ secrets.RESOURCE_GROUP_NAME }} -s ${{ secrets.SPRING_CLUSTER_NAME }} --artifact-path target/springopenai-*.jar --runtime-version Java_17 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | /.env 35 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/spring-openai-bot/03f3f83aefddb30d0b0783b5adcaffcaf69f2e2b/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Spring OpenAI Bot 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 5 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 6 | 7 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 8 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 9 | provided by the bot. You will only need to do this once across all repos using our CLA. 10 | 11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 14 | 15 | - [Code of Conduct](#coc) 16 | - [Issues and Bugs](#issue) 17 | - [Feature Requests](#feature) 18 | - [Submission Guidelines](#submit) 19 | 20 | ## Code of Conduct 21 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 22 | 23 | ## Found an Issue? 24 | If you find a bug in the source code or a mistake in the documentation, you can help us by 25 | [submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can 26 | [submit a Pull Request](#submit-pr) with a fix. 27 | 28 | ## Want a Feature? 29 | You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub 30 | Repository. If you would like to *implement* a new feature, please submit an issue with 31 | a proposal for your work first, to be sure that we can use it. 32 | 33 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). 34 | 35 | ## Submission Guidelines 36 | 37 | ### Submitting an Issue 38 | Before you submit an issue, search the archive, maybe your question was already answered. 39 | 40 | If your issue appears to be a bug, and hasn't been reported, open a new issue. 41 | Help us to maximize the effort we can spend fixing issues and adding new 42 | features, by not reporting duplicate issues. Providing the following information will increase the 43 | chances of your issue being dealt with quickly: 44 | 45 | * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps 46 | * **Version** - what version is affected (e.g. 0.1.2) 47 | * **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you 48 | * **Browsers and Operating System** - is this a problem with all browsers? 49 | * **Reproduce the Error** - provide a live example or a unambiguous set of steps 50 | * **Related Issues** - has a similar issue been reported before? 51 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be 52 | causing the problem (line of code or commit) 53 | 54 | You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new]. 55 | 56 | ### Submitting a Pull Request (PR) 57 | Before you submit your Pull Request (PR) consider the following guidelines: 58 | 59 | * Search the repository (https://github.com/Azure-Samples/spring-openai-bot/pulls) for an open or closed PR 60 | that relates to your submission. You don't want to duplicate effort. 61 | 62 | * Make your changes in a new git fork: 63 | 64 | * Commit your changes using a descriptive commit message 65 | * Push your fork to GitHub: 66 | * In GitHub, create a pull request 67 | * If we suggest changes then: 68 | * Make the required updates. 69 | * Rebase your fork and force push to your GitHub repository (this will update your Pull Request): 70 | 71 | ```shell 72 | git rebase master -i 73 | git push -f 74 | ``` 75 | 76 | That's it! Thank you for your contribution! 77 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # To run this locally, 2 local variables are needed that connects to a Azure OpenAI service 2 | # export APPLICATION_OPENAI_KEY= 3 | # export APPLICATION_OPENAI_URL= 4 | # Run with docker 5 | # docker build -t openaibot . 6 | # docker run -p 8080:8080 -e APPLICATION_OPENAI_KEY -e APPLICATION_OPENAI_URL openaibot 7 | # Access the app at http://localhost:8080/ 8 | 9 | FROM maven:3.9.0-eclipse-temurin-17 AS build 10 | WORKDIR /home/app/ 11 | COPY . /home/app/ 12 | RUN mvn clean package -DskipTests=true 13 | 14 | FROM mcr.microsoft.com/openjdk/jdk:17-distroless 15 | COPY --from=build /home/app/target/springopenai-0.0.1-SNAPSHOT.jar /app.jar 16 | EXPOSE 8080 17 | ENTRYPOINT ["java","-jar","/app.jar"] 18 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot OpenAI Bot 2 | 3 | Sample application showing how to use Spring Boot with OpenAI's GPT-3 API. 4 | 5 | This is a fully reactive application that uses Spring WebFlux and the OpenAI streaming API, 6 | that can be packaged as a GraalVM native image. 7 | 8 | ## Features 9 | 10 | * Spring Boot 3 11 | * Fully reactive with Spring WebFlux and Spring WebClient 12 | * OpenAI streaming API 13 | * Native image with GraalVM 14 | * Deployment to Azure Container Apps 15 | 16 | ## Getting Started 17 | 18 | ### Prerequisites 19 | 20 | - Java 17 21 | - Access to OpenAI's GPT-3 API 22 | 23 | ### Installation 24 | 25 | ```bash 26 | ./mvnw package 27 | ``` 28 | 29 | ### Quickstart 30 | 31 | You will need to set the following environment variables to access OpenAI's API: 32 | 33 | ```bash 34 | export APPLICATION_OPENAI_KEY= 35 | export APPLICATION_OPENAI_URL= 36 | ``` 37 | 38 | ## Demo 39 | 40 | ```bash 41 | ./mvnw spring-boot:run 42 | ``` 43 | 44 | ## Resources 45 | 46 | To customize the OpenAI prompt, you can check the following resource: 47 | 48 | - [Prompt Engineering Guide](https://github.com/dair-ai/Prompt-Engineering-Guide) 49 | -------------------------------------------------------------------------------- /deploy-AKS.sh: -------------------------------------------------------------------------------- 1 | # Note - these commands do not run end-to-end yet, but are a work in progress 2 | # Set Up env vars for this script 3 | # rgandacrandaksname=will be used for the resource group, acr and k8s cluster name 4 | # mylocation=will be used for the location of all resources 5 | # myResourceGroup=will be used for the resource group 6 | # myACRName=will be used for the acr name 7 | # myAKSCluster=will be used for the k8s cluster name 8 | # Run locally: 9 | # mvn package 10 | # mvn spring-boot:run 11 | # 12 | # Run with docker 13 | # docker build -t openaibot . 14 | # run -p 8080:8080 -e APPLICATION_OPENAI_KEY -e APPLICATION_OPENAI_URL openaibot 15 | # Access the app at http://localhost:8080/feature 16 | # Azure locations: az account list-locations -o table 17 | 18 | # Required: 19 | export mylocation=