Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions sample-code/spring-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
Sample code to demonstrate the usage of the SAP AI SDK.
Also used as basis for running E2E tests.

## Prerequisites

Before running the application, ensure the following prerequisites are met:

- Java 17 or higher
- Maven 3.8 or higher
- Credentials for [SAP AI Core](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core) service configured
- Deployments of the following models in the `default` resource group:
- `gpt-4o-mini`
- `text-embedding-3-small`

### Setting Up Credentials for SAP AI Core

To set up credentials for the AI Core service:

- Follow the instruction at [Connecting to AI Core](https://sap.github.io/ai-sdk/docs/java/guides/connecting-to-ai-core) to create a service key for the AI Core service.
- Add the service key content either to a `.env` file in the sample app directory or directly to the `AI_CORE_SERVICE_KEY` environment variable.

### Deploying Generative AI Models in SAP AI Core

To deploy `gpt-4o-mini` and `text-embedding-3-small` models, follow the instructions at:
[Create a Deployment for a Generative AI Model](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core)

## Build and Run the Sample App

Before you can run the sample app, you need to install the AI SDK into your local Maven repository:
Expand All @@ -15,13 +38,7 @@ Before you can run the sample app, you need to install the AI SDK into your loca
> The sample app uses the latest state of the SDK, so make sure to install the SDK after pulling a new version via Git.
> Alternatively, you check out one of the release tags of the repository, e.g. `git fetch --all --tags && git checkout rel/1.1.0`.

Next, you'll need to set up credentials for the AI Core service:

* Follow [these instructions](https://sap.github.io/ai-sdk/docs/java/guides/connecting-to-ai-core) to create a service key for the AI Core service.

⚠️ Put the `.env` file in the sample app directory.

Finally, you can start the sample app:
Start the sample app:

* Run `mvn spring-boot:run` from the sample app directory.

Expand Down