Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@sap-ai-sdk/document-grounding
Advanced tools
> [!warning] > This package is still in **beta** and is subject to breaking changes. Use it with caution.
[!warning] This package is still in beta and is subject to breaking changes. Use it with caution.
SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service.
This package incorporates generative AI document grounding capabilities into your AI activities in SAP AI Core and SAP AI Launchpad.
$ npm install @sap-ai-sdk/document-grounding
Accessing the AI Core Service via the SDK
The SDK automatically retrieves the
AI Core
service credentials and resolves the access token needed for authentication.
- In Cloud Foundry, it's accessed from the
VCAP_SERVICES
environment variable.- In Kubernetes / Kyma environments, you have to mount the service binding as a secret instead, for more information refer to this documentation.
The examples below demonstrate the usage of the most commonly used APIs in SAP AI Core document grounding service. In addition to the examples below, you can find more sample code here.
import
const response =
await CollectionsApi.vectorV1VectorEndpointsCreateCollection(
{
title: 'ai-sdk-js-e2e',
embeddingConfig: {
modelName: 'text-embedding-ada-002-v2'
},
metadata: []
},
{
'AI-Resource-Group': 'default'
}
).executeRaw();
const collectionId = (response.headers.location as string).split('/').at(-2);
const response: DocumentsListResponse =
await DocumentsApi.vectorV1VectorEndpointsCreateDocuments(
collectionId,
{
documents: [
{
metadata: [],
chunks: [
{
content:
'SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service.',
metadata: []
}
]
}
]
},
{
'AI-Resource-Group': 'default'
}
).execute();
When calling the execute()
method, it is possible to provide a custom destination.
For example, when querying deployments targeting a destination with the name my-destination
, the following code can be used:
const response = await CollectionsApi.vectorV1VectorEndpointsDeleteCollection(
collectionId,
{
'AI-Resource-Group': 'default'
}
).execute({
destinationName: 'my-destination'
});
For local testing instructions, refer to this section.
Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
The SAP Cloud SDK for AI is released under the Apache License Version 2.0.
FAQs
> [!warning] > This package is still in **beta** and is subject to breaking changes. Use it with caution.
The npm package @sap-ai-sdk/document-grounding receives a total of 444 weekly downloads. As such, @sap-ai-sdk/document-grounding popularity was classified as not popular.
We found that @sap-ai-sdk/document-grounding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.