The SAP Cloud SDK for AI (Python) is designed to simplify interactions with generative AI APIs and services, particularly within the SAP ecosystem. It provides unified interfaces for various large language models (LLMs), enabling developers to easily integrate AI capabilities into their applications. The library is currently at version 6.7.0 and maintains a regular release cadence with updates and new features.
pip install sap-ai-sdk-genVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `GenerativeAI` client and use its `Completion` service. It relies on environment variables for API key configuration (e.g., `OPENAI_API_KEY`) and attempts to generate text using a specified model.
Initialize `GenerativeAI` and then use methods like `ai_client.get_completion_service()` to obtain service instances.
Ensure relevant environment variables (e.g., `OPENAI_API_KEY`, `AI_API_URL`, `AI_CLIENT_ID`, `AI_CLIENT_SECRET`) are correctly set before initializing the `GenerativeAI` client. Refer to the documentation for provider-specific requirements.
Always check which providers are configured and, if necessary, explicitly pass the `provider` name to the relevant methods.
No dependency data recorded yet.