For comprehensive documentation related to this code: SAP BTP AI Best Practices
This repository provides a comprehensive collection of best practices and sample implementations for AI-powered applications on SAP Business Technology Platform (BTP). It serves as a practical guide for developers looking to implement enterprise-grade AI solutions using SAP's AI services and integration with generative AI models.
The examples provided demonstrate how to:
- Securely access generative AI models
- Implement content filtering for AI-generated outputs
- Apply data masking for PII protection
- Create effective prompt templates
- Build retrieval-augmented generation (RAG) systems
Each best practice includes code samples in multiple programming languages (TypeScript, Python, Java, CAP) to support various technology stacks and development approaches.
- SAP Business Technology Platform account
- Access to SAP AI Core service
-
Clone the repository:
git clone https://github.tools.sap/btp-ai-best-practices/sap-btp-ai-best-practices.git cd sap-btp-ai-best-practices
-
Follow the setup instructions in the README of each specific best practice directory.
For example, to run the TypeScript example for accessing generative AI models:
cd best-practices/access-to-generative-ai-models/typescript npm install cp .env.example .env # Edit the .env file with your service key npm start
sap-btp-ai-best-practices/
├── best-practices/ # Best practices implementations
│ ├── access-to-generative-ai-models/
│ ├── content-filtering/
│ ├── data-masking/
│ ├── prompt-templating/
│ ├── vector-rag-embedding/
│ └── vector-rag-query/
└── use-cases/ # End-to-end use case implementations
For a detailed overview of available best practices, see the best practices directory.
No known issues.
Create an issue in this repository if you find a bug or have questions about the content.
For additional support, ask a question in SAP Community.
If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.
Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.