Skip to main content
Version: 2.0.0

Prerequisites

For Local Development

RequirementDetails
Python version3.10 or higher
Package managerpip
Repository accessGit access to the project repository
AI Core credentialsgen-ai-core-key-new.json
HANA DB credentialshana-db-credentials.json

For BTP Cloud Foundry Deployment

RequirementWho Provides It
SAP BTP Cloud Foundry space accessPlatform / BTP team
Cloud Foundry CLI (cf) installed and logged inDeveloper workstation
Docker installed with registry access configuredDevOps team
SAP AI Core credentialsSecurity / Platform team
HANA DB credentialsDBA / Infrastructure team

Local Setup and Installation

Step 1: Clone the Repository

git clone <repository-url>
cd <project-folder>

Step 2: Install Python Dependencies

pip install -r requirements.txt

Step 3: Place Credential Files

project-folder/
├── gen-ai-core-key-new.json
├── hana-db-credentials.json
├── api/
├── main.py
└── requirements.txt

Step 4: Start the Backend Server

uvicorn api.server:app --host 0.0.0.0 --port 8000 --reload
Access PointURL
API basehttp://localhost:8000
Interactive API docshttp://localhost:8000/docs

Step 5: Test via CLI

python main.py

Deployment on SAP BTP Cloud Foundry

Deployment Steps

Step 1:  Build the Docker image
Step 2: Push the image to the container registry
Step 3: Deploy to Cloud Foundry:
cf push -f manifest.docker.yaml

Required Environment Variables

SAP AI Core Credentials

VariablePurpose
AICORE_AUTH_URLAuthentication endpoint for AI Core
AICORE_CLIENT_IDClient ID for AI Core OAuth
AICORE_CLIENT_SECRETClient secret for AI Core OAuth
AICORE_BASE_URLBase URL for AI Core API calls

SAP HANA DB Credentials

VariablePurpose
HANA_HOSTHANA database host address
HANA_PORTHANA database port
HANA_USERDatabase username
HANA_PASSWORDDatabase password
HANA_SCHEMATarget schema name