generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 2
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: Follow-up Documentation cleanup #159
Merged
Merged
Changes from 64 commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
7239bbb
chore: add local testing instructions
KavithaSiva f89fc29
fix: Changes from lint
971883e
chore: minor sentence fix
KavithaSiva 8072128
chore: fix sentence
KavithaSiva f39f044
chore: add missing sections
KavithaSiva 9028c12
Update packages/orchestration/README.md
KavithaSiva e0f2033
Update packages/orchestration/README.md
KavithaSiva df50cd1
Update packages/orchestration/README.md
KavithaSiva 7390dbe
Update packages/orchestration/README.md
KavithaSiva 8506bd6
Update packages/langchain/README.md
KavithaSiva 361940b
Update packages/ai-api/README.md
KavithaSiva ef23a7c
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva d62d62d
chore: link client readmes in root
KavithaSiva 98fa3b4
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva f1991b1
Update packages/orchestration/README.md
KavithaSiva 864f041
chore: Address review comments
KavithaSiva 7b94a23
chore: address review comments
KavithaSiva 9333645
fix: Changes from lint
63fd72c
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 94c3d8a
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 4c8ce4f
Merge branch 'documentation/minor-cleanup' of github.com:SAP/ai-sdk-j…
KavithaSiva 87a2ac0
chore: address review comments
KavithaSiva 124a0d8
chore: add deploymentID relationship
KavithaSiva 54f7815
chore: address review comment
KavithaSiva 0f34a2d
chore: address review comments
KavithaSiva d5856df
chore: remove usage of you
KavithaSiva 45b547e
chore: remove usages of you.
KavithaSiva 2e29d74
fix: Changes from lint
8fd9186
chore: remove more usages of you
KavithaSiva 76f5dd3
Merge branch 'documentation/minor-cleanup' of github.com:SAP/ai-sdk-j…
KavithaSiva 408b0a1
chore: address review comment
KavithaSiva 0016f88
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 756b5df
chore: minor cleanup
KavithaSiva 41c0b84
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 129bdeb
Update packages/orchestration/README.md
KavithaSiva 0a2a768
Update packages/orchestration/README.md
KavithaSiva 728abe2
Update packages/orchestration/README.md
KavithaSiva afb3a95
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 267a6f7
chore: cleanup links
KavithaSiva 53b14e2
chore: cleanup links
KavithaSiva cd54014
chore: explain deployment id
KavithaSiva b379d9e
chore: explain deployment ID
KavithaSiva 40e7409
chore: fix toc
KavithaSiva 688af41
Update packages/orchestration/README.md
KavithaSiva 9e26d5a
Update packages/orchestration/README.md
KavithaSiva d7f9522
chore: address review comments
KavithaSiva 69afd57
chore: final review comment
KavithaSiva e24d8ad
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 7af7b3b
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 508fee5
chore: address review comments
KavithaSiva 697e2c9
fix: Changes from lint
1425977
chore: remove requestConfig section
KavithaSiva 5d40c54
Merge branch 'documentation/minor-cleanup' of github.com:SAP/ai-sdk-j…
KavithaSiva ecf5c01
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 831b355
chore: cleanup convenience functions usage
KavithaSiva 5358ad1
chore: fix toc
KavithaSiva bce751d
chore: fix toc
KavithaSiva 57c02a0
Update README.md
deekshas8 37f23a7
Apply suggestions from code review
deekshas8 8188acc
Apply suggestions from code review
deekshas8 05d15b8
Update packages/orchestration/README.md
deekshas8 59cb45a
Update packages/orchestration/README.md
deekshas8 1838278
Update packages/orchestration/README.md
deekshas8 9eff8b0
Apply suggestions from code review
deekshas8 9926785
Merge branch 'main' into documentation/minor-cleanup
KavithaSiva 3a70dc7
fix: Changes from lint
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,16 @@ This package provides LangChain model clients built on top of the foundation mod | |
|
||
## Table of Contents | ||
|
||
1. [Installation](#installation) | ||
2. [Prerequisites](#prerequisites) | ||
3. [Usage](#usage) | ||
- [Client Initialization](#client-initialization) | ||
- [Chat Client](#chat-client) | ||
- [Embedding Client](#embedding-client) | ||
4. [Support, Feedback, Contribution](#support-feedback-contribution) | ||
5. [License](#license) | ||
- [Installation](#installation) | ||
- [Prerequisites](#prerequisites) | ||
- [Relationship between Models and Deployment ID](#relationship-between-models-and-deployment-id) | ||
- [Usage](#usage) | ||
- [Client Initialization](#client-initialization) | ||
- [Chat Client](#chat-client) | ||
- [Embedding Client](#embedding-client) | ||
- [Local Testing](#local-testing) | ||
- [Support, Feedback, Contribution](#support-feedback-contribution) | ||
- [License](#license) | ||
|
||
## Installation | ||
|
||
|
@@ -24,10 +26,22 @@ $ npm install @sap-ai-sdk/langchain | |
- [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. | ||
- For testing your application locally: | ||
- Download a service key for your AI Core service instance. | ||
- Create a `.env` file in the root of your directory. | ||
- Add an entry `AICORE_SERVICE_KEY='<content-of-service-key>'`. | ||
- 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`. | ||
|
||
## Relationship between Models and Deployment ID | ||
|
||
SAP AI Core manages access to generative AI models through the global AI scenario `foundation-models`. | ||
Creating a deployment for a model requires access to this scenario. | ||
|
||
Each model, model version, and resource group allows for a one-time deployment. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as before, a bit confusing to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
After deployment completion, the response includes a `deploymentUrl` and an `id`, which is the deployment ID. 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). | ||
|
||
[Resource groups](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/resource-groups?q=resource+group) represent a virtual collection of related resources within the scope of one SAP AI Core tenant. | ||
|
||
Consequently, each deployment ID and resource group uniquely map to a combination of model and model version within the `foundation-models` scenario. | ||
|
||
## Usage | ||
|
||
|
@@ -60,6 +74,9 @@ const chatClient = new AzureOpenAiChatClient({ | |
}); | ||
``` | ||
|
||
**Do not pass a `deployment ID` to initialize the client.** | ||
For the LangChain model clients, initialization is done using the model name, model version and resource group. | ||
|
||
An important note is that LangChain clients by default attempt 6 retries with exponential backoff in case of a failure. | ||
Especially in testing environments you might want to reduce this number to speed up the process: | ||
|
||
|
@@ -155,6 +172,10 @@ const vectorStore = await MemoryVectorStore.fromDocuments( | |
const retriever = vectorStore.asRetriever(); | ||
``` | ||
|
||
## Local Testing | ||
|
||
For local testing instructions, refer to this [section](https://github.com/SAP/ai-sdk-js/blob/main/README.md#local-testing). | ||
|
||
## Support, Feedback, Contribution | ||
|
||
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/ai-sdk-js/issues). | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subtle differences between the two, so I will use the original sentence, as it talks about relationship rather than what is required by the API.