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
• [Create a service key](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-service-key) for your AI Core instance and copy the JSON object.
89
89
@@ -163,7 +163,7 @@ Go to the Configuration section within your chosen Resource Group.
163
163
164
164
[OPTION END]
165
165
166
-
[OPTION BEGIN [Gen AI SDK]]
166
+
[OPTION BEGIN [Python SDK]]
167
167
168
168
• Create a folder named orchestration, then navigate to this folder using VS Code.
print(f"Configuration created successfully with ID: {config.id} and Name: {config_name}")
191
-
191
+
```
192
192
193
193
[OPTION END]
194
194
@@ -255,7 +255,7 @@ Go to the Configuration section within your chosen Resource Group.
255
255
256
256
[OPTION END]
257
257
258
-
[OPTION BEGIN [Gen AI SDK]]
258
+
[OPTION BEGIN [Python SDK]]
259
259
260
260
• Create a folder named orchestration, then navigate to this folder using VS Code.
261
261
@@ -292,7 +292,7 @@ print(f"Configuration created successfully with ID: {config.id} and Name: {confi
292
292
293
293
[OPTION END]
294
294
295
-
[OPTION BEGIN [SAP Cloud SDK]]
295
+
[OPTION BEGIN [JavaScript SDK]]
296
296
297
297
In this step, we define a function to create an orchestration configuration using the ConfigurationApi from the SAP AI SDK. This configuration integrates various parameters needed for orchestration, such as the executable ID and scenario ID.
298
298
@@ -347,7 +347,7 @@ orchestrationConfig;
347
347
348
348
[OPTION END]
349
349
350
-
[OPTION BEGIN [SAP Cloud SDK for Java]]
350
+
[OPTION BEGIN [Java SDK]]
351
351
352
352
In this step, we will create an orchestration configuration using the core module of the SAP Cloud SDK for Java in a maven project. This configuration integrates various parameters needed for orchestration, such as the executable ID and scenario ID.
353
353
@@ -394,14 +394,6 @@ var configuration = new ConfigurationApi().create(RESOURCE_GROUP, configurationD
394
394
// Print the configuration response message
395
395
System.out.println(configuration.getMessage());
396
396
```
397
-
• If not done automaticaly by your IDE, add the following imports:
@@ -447,7 +439,7 @@ Once the deployment begins, continue to the status page. Verify that the Deploym
447
439
448
440
[OPTION END]
449
441
450
-
[OPTION BEGIN [Gen AI SDK]]
442
+
[OPTION BEGIN [Python SDK]]
451
443
452
444
With the configuration ID, you can proceed to deploy the orchestration and monitor its progress.
453
445
@@ -505,7 +497,7 @@ Result: The code will display a loading spinner until the deployment status upda
505
497
506
498
[OPTION END]
507
499
508
-
[OPTION BEGIN [SAP Cloud SDK]]
500
+
[OPTION BEGIN [JavaScript SDK]]
509
501
510
502
This step involves creating a deployment using the specified configuration and resource group. The deployment is handled via the DeploymentApi, which streamlines the process of activating the orchestration setup.
511
503
@@ -570,7 +562,7 @@ export async function deployOrchestration(
570
562
571
563
[OPTION END]
572
564
573
-
[OPTION BEGIN [SAP Cloud SDK for Java]]
565
+
[OPTION BEGIN [Java SDK]]
574
566
575
567
In this step, we will create a deployment from the configuration created in the last step using the core module of the SAP Cloud SDK for Java.
576
568
@@ -587,12 +579,6 @@ var deployment = new DeploymentApi().create(RESOURCE_GROUP, deploymentCreationRe
587
579
// Print the deployment response message
588
580
System.out.println(deployment.getMessage());
589
581
```
590
-
• If not done automaticaly by your IDE, add the following imports:
@@ -774,7 +760,7 @@ Data masking and content filtering are available to enhance data privacy and saf
774
760
775
761
[OPTION END]
776
762
777
-
[OPTION BEGIN [Gen AI SDK]]
763
+
[OPTION BEGIN [Python SDK]]
778
764
779
765
To begin the consumption process for the orchestration you’ve deployed, follow the process below:
780
766
@@ -910,7 +896,7 @@ Data masking and content filtering are available to enhance data privacy and saf
910
896
911
897
[OPTION END]
912
898
913
-
[OPTION BEGIN [SAP Cloud SDK]]
899
+
[OPTION BEGIN [JavaScript SDK]]
914
900
915
901
To begin the consumption process for the orchestration you’ve deployed, follow the process below:
916
902
@@ -1071,7 +1057,7 @@ Data masking and content filtering are available to enhance data privacy and saf
1071
1057
1072
1058
[OPTION END]
1073
1059
1074
-
[OPTION BEGIN [SAP Cloud SDK for Java]]
1060
+
[OPTION BEGIN [Java SDK]]
1075
1061
1076
1062
In this step, we will consume an LLM through the orchestration service with the created deployment, using the core and orchestration module of the SAP Cloud SDK for Java.
1077
1063
@@ -1107,42 +1093,40 @@ The next step involves creating the prompt for the LLM including both `SystemMes
1107
1093
1108
1094
```java
1109
1095
// Define system and user messages for prompt
1110
-
var systemMessage =newSystemMessage(
1096
+
var systemMessage =Message.system(
1111
1097
"""
1112
1098
You are an AI assistant designed to screen resumes for HR purposes.
1113
1099
Please assess the candidate qualifications based on the provided resume.
1114
1100
"""
1115
1101
);
1116
-
var userMessage =newUserMessage("Candidate Resume: \n"+ cvContent);
1102
+
var userMessage =Message.user("Candidate Resume: \n"+ cvContent);
1117
1103
1118
1104
// Define the prompt for resume screening
1119
1105
var prompt =newOrchestrationPrompt(systemMessage, userMessage);
1120
1106
1121
1107
```
1122
1108
1123
-
We can define multiple models for the use case. Only use those models that are already deployed in your instances. For this example, we have selected the following three models:
1109
+
1110
+
We can define model parameters and a list of models to use. Only use those models that are already deployed in your instances. For this example, we have selected the following parameters and models:
1124
1111
1125
1112
```java
1126
-
// List of models to iterate through
1127
-
var models =List.of("gpt-4o", "mistralai--mistral-large-instruct", "anthropic--claude-3.5-sonnet");
1128
-
```
1129
1113
1130
-
With the following function we create an `OrchestrationModuleConfig` containing information about the `LLMModule`. This can be extended to contain information regarding templating, masking, filtering and grounding, if desired to use these functionality of orchestration.
1114
+
// Map of model parameters, can be adapted if desired
1115
+
Map<String, Object> modelParams =Map.of(
1116
+
"max_tokens", 1000,
1117
+
"temperature", 0.6
1118
+
);
1119
+
1120
+
// List of models to iterate through, can be adapted if desired
0 commit comments