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
• SAP Cloud SDK for AI: Uses the `dotenv` library to load environment variables. If you encounter issues with the dotenv library, ensure it is installed correctly by running:
• **Next.js:** Requires specific configuration for loading environment variables.
83
83
84
+
[OPTION END]
85
+
86
+
[OPTION BEGIN [SAP Cloud SDK for Java]]
87
+
88
+
• [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
+
90
+
• Create a `.env`file in the **working directory** from which you run the code. Add the following line using the copied JSON:
The value of `AICORE_SERVICE_KEY` must be a single line, so remove any line breaks from the service key JSON.
97
+
98
+
• For other options of access configuration and detailed information on installation and usage of the **SAP Cloud SDK for AI (for Java)**, visit the official
99
+
[GitHub repository](https://github.com/SAP/ai-sdk-java). This page provides comprehensive steps to set up and integrate the SDK effectively in your projects.
100
+
101
+
[OPTION END]
102
+
103
+
[OPTION BEGIN [Bruno]]
104
+
#### Download and Import the Bruno Collection
105
+
- Download the [bruno_collections](img/Bruno_Collection.json) file
106
+
107
+
- Navigate to the Bruno Collections section
108
+
109
+
- Upload the .json file to import the collection. Follow the screenshot attached for reference
110
+

111
+

112
+

113
+
#### Set Environment Variables
114
+
- From the imported collection, select the get_token query.
115
+
116
+
- Click on "No Environment" and then select "Configure".
117
+
118
+

119
+
- Populate the following environment variables with values from the service key:
120
+
- ai_auth_url → url from the service key.
121
+
- ai_api_url → serviceurls.AI_API_URL from the service key.
122
+
- client_id → clientid from the service key.
123
+
- client_secret → clientsecret from the service key.
124
+
- resource_group → Specify a resource group name.
125
+
126
+

127
+
- Save the environment configuration.
128
+
129
+
- Click on "No Environment" in the top-right corner and select "Grounding-test".
130
+

131
+
#### Generate the Token
132
+
- Select the get_token request from the root folder of the imported collection.
133
+
134
+
- Execute the request to generate the token.
135
+

136
+
137
+
**NOTE**: If the token expires at any point during execution, repeat this step to regenerate it.
138
+
139
+
[OPTION END]
140
+
141
+
142
+
### Create Configuration for Orchestration deployment
143
+
144
+
[OPTION BEGIN [AI Launchpad]]
145
+
146
+
Go to the Configuration section within your chosen Resource Group.
147
+
148
+

149
+
150
+
• Fill in Deployment Details, Under configuration, input the following details:
151
+
152
+
Name: "orchestration"
153
+
154
+
Executable: "orchestration"
155
+
156
+
Scenario: "orchestration"
157
+
158
+
Version: "0.0.1"
159
+
160
+
• Click Next after entering each detail.
161
+
162
+

163
+
164
+
[OPTION END]
165
+
166
+
[OPTION BEGIN [Gen AI SDK]]
167
+
168
+
• Create a folder named orchestration, then navigate to this folder using VS Code.
169
+
170
+
• Inside the folder, create a new file with any name but ensure it has the .ipynb extension.
171
+
172
+

173
+
174
+
You'll create a configuration that defines the orchestration setup. Use the following code to initialize your configuration.
175
+
176
+
```CODE
177
+
178
+
# Define scenario ID, executable ID, and configuration suffix
179
+
scenario_id = "orchestration"
180
+
executable_id = "orchestration"
181
+
config_suffix = "config-new" # Enter your configuration name
182
+
config_name = f"{config_suffix}-orchestration"
183
+
184
+
# Create a new configuration
185
+
config = ai_core_client.configuration.create(
186
+
scenario_id=scenario_id,
187
+
executable_id=executable_id,
188
+
name=config_name
189
+
)
190
+
print(f"Configuration created successfully with ID: {config.id} and Name: {config_name}")
191
+
192
+
84
193
[OPTION END]
85
194
86
195
[OPTION BEGIN [Bruno]]
@@ -923,4 +1032,4 @@ Data masking and content filtering are available to enhance data privacy and saf
923
1032
924
1033
Data masking and content filtering are available to enhance data privacy and safety. Data masking hides sensitive information like phone numbers or organization names, while content filtering can screen for categories such as hate self-harm, sexual content, and violence. In this tutorial, the response generated by the LLM models may carry sensitive information, such as names and phone numbers etc.. For further enhancement, refer to the next tutorial on implementing these modules.
0 commit comments