SAP Cloud SDK for AI (Python): Base Client for AI API
The SDK formerly known as AI API Client SDK was rebranded.
The class names have not changed i.e., you can continue to use existing code.
The Base Client for AI API is a Python-based SDK that enables you to access the AI API using Python methods and data structures.
The Base SDK can be used with any implementation of AI API. Because it is independent of the runtime implementation, it doesn't provide access to runtime-specific APIs. For example, maintaining object store secrets is specific to SAP AI Core and is therefore not included in the Base SDK. Check for SDK offerings for your runtime that let you access any runtime-specific APIs. For more information on the Core SDK see https://pypi.org/project/sap-ai-sdk-core/.
For more information on the AI API specification, SAP AI Core and related topics, please refer to https://help.sap.com/docs/AI_CORE?version=CLOUD.
Example Usage
from ai_api_client_sdk.ai_api_v2_client import AIAPIV2Client
# Instantiate the client
client = AIAPIV2Client(base_url=AI_API_URL,
auth_url=AUTH_URL,
client_id=CLIENT_ID,
client_secret=CLIENT_SECRET, resource_group=RESOURCE_GROUP)
# Make some queries, e.g.
scenarios = client.scenario.query()
for scenario in scenarios.resources:
print(scenario.id)
# Find a deployable executables in scenario 1111
executables = client.executable.query(scenario_id="1111")
for executable in executables.resources:
if executable.deployable == False:
break
print(executable.id)
# Inspect the required parameters for the executable
for parameter in executable.parameters:
print("Parameter:{}, Type: {}".format(parameter.name, parameter.type))
# Create a configuration
parameter_epochs = ParameterBinding(key="training-epochs", value="1")
myConfiguration = client.configuration.create(name="test", scenario_id="1111" executable_id="argo-mnist-0.2.1", parameter_bindings=[parameter_epochs])
Metadata
Release files for sap-ai-sdk-base 3.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sap_ai_sdk_base-3.4.0-py3-none-any.whl | Python 3 | none | any | Details for sap_ai_sdk_base-3.4.0-py3-none-any.whl |
Release files / sap_ai_sdk_base-3.4.0-py3-none-any.whl
| Download URL | sap_ai_sdk_base-3.4.0-py3-none-any.whl |
|---|---|
| Size | 269.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f820e5b4976989d9d178c64bc989d0f80fc61442b64e96851628ddacfadb366
|
|
BLAKE2b-256 checksum How to use checksums |
5120de65ea58dc055383a5e94c01e1167deb6e28e4a73302861a26c557d14317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Security for sap-ai-sdk-base 3.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.