![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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 VectorApi.createCollection(
{
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 VectorApi.createDocuments(
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 VectorApi.deleteCollectionById(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.
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 3 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.