You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/ai-core-orchestration-consumption-opt/ai-core-orchestration-consumption-opt.md
+53-55Lines changed: 53 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ print(cv_content)
85
85
86
86
**NOTE** : If you are continuing with the same project from the previous tutorial, skip steps 1 and 2. Otherwise, create a new project using the already deployed orchestration URL to access the Harmonized API.
87
87
88
-
For detailed installation and usage of the **SAP Cloud SDK for AI (JavaScript)**, visit the official [GitHub repository](https://github.com/SAP/ai-sdk-js/tree/main?tab=readme-ov-file#sap-ai-sdkorchestration). This page provides comprehensive steps to set up, integrate and test the SDK effectively in your projects.
88
+
For detailed installation, please refer to the official documentation of [`@sap-ai-sdk/orchestration`](https://github.com/SAP/ai-sdk-js/tree/main/packages/orchestration) package.
89
89
90
90
- The [cv.txt](img/cv.txt) file, containing the resume content, must be added to the working directory. Use the following code to load the file content:
91
91
@@ -96,8 +96,6 @@ import { readFile } from 'fs/promises';
The next step involves creating a template that specifies how the AI should handle the CV content. The template will include both `SystemMessage` and `UserMessage` components.
299
+
The next step involves creating a template that specifies how the CV content should be handled. The template will include message components with different roles:
302
300
303
-
• `SystemMessage`: Defines the AI assistant's role and instructions.
301
+
• `system`: Defines the AI assistant's role and instructions.
304
302
305
-
• `UserMessage`: Represents the user's input to be processed.
303
+
• `user`: Represents the user's input to be processed.
content:'You are a helpful AI assistant for HR. Summarize the following CV in 10 sentences, focusing on key qualifications, work experience, and achievements. Include personal contact information, organizational history, and personal interests.',
content:'You are a helpful AI assistant for HR. Summarize the following CV in 10 sentences, focusing on key qualifications, work experience, and achievements. Include personal contact information, organizational history, and personal interests.',
console.log('Content Filtering configuration defined successfully.');
707
704
```
708
705
709
706
**NOTE** : Adjust thresholds for hate, sexual, self-harm, and violence categories based on your use case.
710
707
711
-
Multiple filters can be applied for both input and output. In this tutorial, we are using Azure Content Filter, but you can choose from the available providers based on your use case. For more information on using this and/or additional modules, please refer to the official documentation of [SAP Cloud SDK for AI (Javascript)](https://github.com/SAP/ai-sdk-js/tree/main/packages/orchestration).
708
+
Multiple content filters can be applied for both input and output. In this tutorial, we use Azure Content Safety Filter, but you can choose from the available providers based on your use case. For more information, please refer to the official documentation of [`@sap-ai-sdk/orchestration`](https://github.com/SAP/ai-sdk-js/tree/main/packages/orchestration) package.
709
+
710
+
The `filtering` configuration created in this step will be used in the next step to initialize an `OrchestrationClient` and consume the orchestration service.
712
711
713
712
[OPTION END]
714
713
@@ -901,9 +900,9 @@ By incorporating these optional modules, you can tailor your Response to meet or
901
900
902
901
[OPTION BEGIN [JavaScript SDK]]
903
902
904
-
**Generate Responses for Multiple Models**
903
+
**Generate Responses with Multiple Models**
905
904
906
-
This step outlines the process of generating responses for a set of queries using different models. The `generateResponsesForModels()` function iterates through each model and executes queries with the created template.
905
+
This step outlines the process of generating responses for a set of queries using different models. The `generateResponsesWithModels()` function iterates through each model and executes queries with the created template.
907
906
908
907
**Note**: Ensure that your orchestration deployment is in Running Status and ready to be consumed during this process.
909
908
@@ -915,7 +914,7 @@ import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
915
914
constRESOURCE_GROUP="YourResourceGroupId"; // Define the resource group, change this to your resource group name
916
915
917
916
// Generate responses from multiple models using OrchestrationClient
0 commit comments