From 405dd8bde269e98d43f659db57cf74972dd331de Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 10 Oct 2024 16:29:03 +0200 Subject: [PATCH] Update doc for spring boot usage --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4a4ace91..84df8068 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,7 @@ Before you begin, ensure you have: ### Write the Code -Create a Java class (e.g., `OpenAiExample.java`) and include the following code: +Add the following code to the controller or service class in your Spring Boot application: ```java // Initialize the client for GPT-3.5 Turbo model @@ -209,12 +209,11 @@ final OpenAiChatCompletionOutput result = ### Run and Test the Application Locally -Ensure that the `AICORE_SERVICE_KEY` environment variable is set in your terminal or IDE. - Then, compile and run your application: ```shell -cd sample-code/spring-app +cd your-spring-app/ + mvn compile mvn spring-boot:run ``` @@ -250,9 +249,7 @@ ApiClient client = Core.getClient().addDefaultHeader("header-key", "header-value DeploymentApi api = new DeploymentApi(client); ``` -For more customization, creating -a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders) -is also possible. +For more customization, creating a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders) is also possible. ### More Examples