Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update service binding docs #279

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ Setup your SAP AI Core instance with SAP Cloud SDK for AI.

## Requirements and Setup

See the documentation of each individual package under the [Packages](#packages) section.
- [Enable the AI Core service in SAP BTP](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/initial-setup).
- Ensure the project is configured with **Node.js v20 or higher**, along with **native ESM** support.

For further details, refer to the individual sections under [Packages](#packages).

## Packages

Expand Down Expand Up @@ -94,8 +97,8 @@ The [project README](https://github.com/SAP/ai-sdk-js/blob/main/sample-code/READ

To test SAP Cloud SDK for AI features locally during application development, follow these steps:

- Download a service key for the AI Core service instance.
- Set the downloaded service key as the `AICORE_SERVICE_KEY` environment variable in the local environment.
1. Download a service key for the AI Core service instance.
2. Set the downloaded service key as the `AICORE_SERVICE_KEY` environment variable in the local environment.

The SDK parses the service key from the environment variable to interact with the AI Core service.
This setup enables local testing of clients such as orchestration and OpenAI, provided that deployments for orchestration and OpenAI exist in SAP BTP.
Expand Down
6 changes: 5 additions & 1 deletion packages/ai-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ To ensure compatibility and manage updates effectively, we strongly recommend us
## Prerequisites

- [Enable the AI Core service in SAP BTP](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/initial-setup).
- Project configured with Node.js v20 or higher and native ESM support enabled.
- Configure the project with **Node.js v20 or higher** and **native ESM** support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see many copy/pasted content for different packages :)


> **Accessing the AI Core Service via the SDK**:
> The SDK automatically retrieves the `AI Core` service credentials from the `VCAP_SERVICES` environment variable and resolves the access token needed for authentication.
> All subsequent client requests are routed to this service endpoint.

## Usage

Expand Down
16 changes: 10 additions & 6 deletions packages/foundation-models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ $ npm install @sap-ai-sdk/foundation-models
## Prerequisites

- [Enable the AI Core service in SAP BTP](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/initial-setup).
- Project configured with Node.js v20 or higher and native ESM support enabled.
- A deployed OpenAI model in SAP Generative AI hub.
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` to deploy a model to SAP generative AI hub.
For more information, see [here](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core).
Deployment can be set up for each model and model version, as well as a resource group intended for use with the generative AI hub.
- Once a deployment is complete, the model can be accessed via the `deploymentUrl`.
- Configure the project with **Node.js v20 or higher** and **native ESM** support.
- Ensure a deployed OpenAI model is available in the SAP Generative AI Hub.
deekshas8 marked this conversation as resolved.
Show resolved Hide resolved
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` [to deploy a model](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core).
Alternatively, you can also create deployments using the [SAP AI Launchpad](https://help.sap.com/docs/sap-ai-core/generative-ai-hub/activate-generative-ai-hub-for-sap-ai-launchpad?locale=en-US&q=launchpad).
Deployment can be set up for each model and model version, as well as a resource group.
- Once a deployment is complete, access the model via the `deploymentUrl`.

> **Accessing the AI Core Service via the SDK**:
> The SDK automatically retrieves the `AI Core` service credentials from the `VCAP_SERVICES` environment variable and resolves the access token needed for authentication.
> All subsequent client requests are routed to this service endpoint.

## Relationship between Models and Deployment ID

Expand Down
15 changes: 9 additions & 6 deletions packages/langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ $ npm install @sap-ai-sdk/langchain
## Prerequisites

- [Enable the AI Core service in SAP BTP](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/initial-setup).
- Bind the service to your application.
- Ensure the project is configured with Node.js v20 or higher, along with native ESM support.
- A deployed model is available in SAP Generative AI hub.
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` to deploy a model to SAP generative AI hub.
For more information, see [here](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core).
- Once a deployment is complete, the model can be accessed via the `deploymentUrl`.
- Configure the project with **Node.js v20 or higher** and **native ESM** support.
- Ensure a deployed OpenAI model is available in the SAP Generative AI Hub.
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` [to deploy a model](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core).
Alternatively, you can also create deployments using the [SAP AI Launchpad](https://help.sap.com/docs/sap-ai-core/generative-ai-hub/activate-generative-ai-hub-for-sap-ai-launchpad?locale=en-US&q=launchpad).
- Once deployment is complete, access the model via the `deploymentUrl`.

> **Accessing the AI Core Service via the SDK**:
> The SDK automatically retrieves the `AI Core` service credentials from the `VCAP_SERVICES` environment variable and resolves the access token needed for authentication.
> All subsequent client requests are routed to this service endpoint.

## Relationship between Models and Deployment ID

Expand Down
16 changes: 10 additions & 6 deletions packages/orchestration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ $ npm install @sap-ai-sdk/orchestration
## Prerequisites

- [Enable the AI Core service in SAP BTP](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/initial-setup).
- Project configured with Node.js v20 or higher and native ESM support enabled.
- An orchestration deployment is running.
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` to create a deployment for orchestration to the SAP generative AI hub.
For more information, see [here](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration).
- Once a deployment is complete, the orchestration service can be accessed via the `deploymentUrl`.
- Configure the project with **Node.js v20 or higher** and **native ESM** support.
- Ensure an orchestration deployment is available in the SAP Generative AI Hub.
- Use the [`DeploymentApi`](https://github.com/SAP/ai-sdk-js/blob/main/packages/ai-api/README.md#create-a-deployment) from `@sap-ai-sdk/ai-api` [to create a deployment](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration).
Alternatively, you can also create deployments using the [SAP AI Launchpad](https://help.sap.com/docs/sap-ai-core/generative-ai-hub/activate-generative-ai-hub-for-sap-ai-launchpad?locale=en-US&q=launchpad).
- Once the deployment is complete, access the orchestration service via the `deploymentUrl`.

> **Accessing the AI Core Service via the SDK**:
> The SDK automatically retrieves the `AI Core` service credentials from the `VCAP_SERVICES` environment variable and resolves the access token needed for authentication.
> All subsequent client requests are routed to this service endpoint.

## Orchestration Service

Expand Down Expand Up @@ -297,7 +301,7 @@ const orchestrationClient = new OrchestrationClient(
);
```

The relationship between orchestration and resource groups is explained in this [section](#relationship-between-orchestration-and-resource-groups).
The relationship between orchestration and resource groups is explained [here](#relationship-between-orchestration-and-resource-groups).

### Custom Request Configuration

Expand Down