@sap-ai-sdk/orchestration 1.11.1-20250414013204.0 → 1.11.1-20250415115505.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -692
- package/dist/orchestration-client.d.ts +12 -0
- package/dist/orchestration-client.d.ts.map +1 -1
- package/dist/orchestration-client.js +52 -6
- package/dist/orchestration-client.js.map +1 -1
- package/dist/orchestration-types.d.ts +3 -5
- package/dist/orchestration-types.d.ts.map +1 -1
- package/dist/orchestration-types.js.map +1 -1
- package/dist/util/module-config.d.ts.map +1 -1
- package/dist/util/module-config.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -7,22 +7,7 @@ This package incorporates generative AI orchestration capabilities into your AI
|
|
|
7
7
|
### Table of Contents
|
|
8
8
|
|
|
9
9
|
- [Installation](#installation)
|
|
10
|
-
- [
|
|
11
|
-
- [Orchestration Service](#orchestration-service)
|
|
12
|
-
- [Usage](#usage)
|
|
13
|
-
- [LLM Config](#llm-config)
|
|
14
|
-
- [Templating](#templating)
|
|
15
|
-
- [Prompt Registry](#prompt-registry)
|
|
16
|
-
- [Content Filtering](#content-filtering)
|
|
17
|
-
- [Data Masking](#data-masking)
|
|
18
|
-
- [Grounding](#grounding)
|
|
19
|
-
- [Using a JSON Configuration from AI Launchpad](#using-a-json-configuration-from-ai-launchpad)
|
|
20
|
-
- [Streaming](#streaming)
|
|
21
|
-
- [Using a Custom Resource Group](#using-a-custom-resource-group)
|
|
22
|
-
- [Custom Request Configuration](#custom-request-configuration)
|
|
23
|
-
- [Custom Destination](#custom-destination)
|
|
24
|
-
- [Error Handling](#error-handling)
|
|
25
|
-
- [Local Testing](#local-testing)
|
|
10
|
+
- [Documentation](#documentation)
|
|
26
11
|
- [Support, Feedback, Contribution](#support-feedback-contribution)
|
|
27
12
|
- [License](#license)
|
|
28
13
|
|
|
@@ -32,683 +17,9 @@ This package incorporates generative AI orchestration capabilities into your AI
|
|
|
32
17
|
$ npm install @sap-ai-sdk/orchestration
|
|
33
18
|
```
|
|
34
19
|
|
|
35
|
-
##
|
|
20
|
+
## Documentation
|
|
36
21
|
|
|
37
|
-
|
|
38
|
-
- Configure the project with **Node.js v20 or higher** and **native ESM** support.
|
|
39
|
-
- An [Orchestration deployment](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/get-your-orchestration-deployment-url) is running in your AI Core service instance.
|
|
40
|
-
- When using the `default` [resource group](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/resource-groups), a deployment is provided by default.
|
|
41
|
-
No further setup is needed.
|
|
42
|
-
- When using a custom resource group, please refer to [this guide](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration) on how to create a deployment in that resource group.
|
|
43
|
-
|
|
44
|
-
> **Accessing the AI Core Service via the SDK**
|
|
45
|
-
>
|
|
46
|
-
> The SDK automatically retrieves the `AI Core` service credentials and resolves the access token needed for authentication.
|
|
47
|
-
>
|
|
48
|
-
> - In Cloud Foundry, it's accessed from the `VCAP_SERVICES` environment variable.
|
|
49
|
-
> - In Kubernetes / Kyma environments, you have to mount the service binding as a secret instead, for more information refer to [this documentation](https://www.npmjs.com/package/@sap/xsenv#usage-in-kubernetes).
|
|
50
|
-
|
|
51
|
-
## Orchestration Service
|
|
52
|
-
|
|
53
|
-
The orchestration service provides essential features like [templating](#templating), [content filtering](#content-filtering), [grounding](#grounding), etc which are often required in business AI scenarios.
|
|
54
|
-
|
|
55
|
-
Find more details about orchestration workflow [here](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration-workflow).
|
|
56
|
-
|
|
57
|
-
## Usage
|
|
58
|
-
|
|
59
|
-
Leverage the orchestration service capabilities by using the orchestration client.
|
|
60
|
-
You can perform a simple prompt by running:
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
|
|
64
|
-
|
|
65
|
-
const orchestrationClient = new OrchestrationClient({
|
|
66
|
-
llm: {
|
|
67
|
-
model_name: 'gpt-4o'
|
|
68
|
-
},
|
|
69
|
-
templating: {
|
|
70
|
-
template: [
|
|
71
|
-
{ role: 'user', content: 'Hello World! Why is this phrase so famous?' }
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const response = await orchestrationClient.chatCompletion();
|
|
77
|
-
console.log(response.getContent());
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Here we use GPT-4o with a single user message as prompt and print out the response.
|
|
81
|
-
|
|
82
|
-
The `OrchestrationClient` enables combining various modules, such as templating and content filtering, while sending chat completion requests to an orchestration-compatible generative AI model.
|
|
83
|
-
|
|
84
|
-
In addition to the examples below, you can find more **sample code** [here](https://github.com/SAP/ai-sdk-js/blob/main/sample-code/src/orchestration.ts).
|
|
85
|
-
|
|
86
|
-
### LLM Config
|
|
87
|
-
|
|
88
|
-
Choose the LLM by setting the `model_name` property.
|
|
89
|
-
Optionally, define `model_version` (default: `latest`) and `model_params` for custom settings.
|
|
90
|
-
|
|
91
|
-
> [!Tip]
|
|
92
|
-
>
|
|
93
|
-
> #### Harmonized API
|
|
94
|
-
>
|
|
95
|
-
> The Orchestration Service provides a [harmonized API](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/harmonized-api) for all models.
|
|
96
|
-
> Switching to a different model — even from another vendor — only requires changing the `model_name` property.
|
|
97
|
-
|
|
98
|
-
### Templating
|
|
99
|
-
|
|
100
|
-
Use the orchestration client with templating to pass a prompt containing placeholders that will be replaced with input parameters during a chat completion request.
|
|
101
|
-
This allows for variations in the prompt based on the input parameters.
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
const orchestrationClient = new OrchestrationClient({
|
|
105
|
-
llm: {
|
|
106
|
-
model_name: 'gpt-4o',
|
|
107
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
108
|
-
},
|
|
109
|
-
templating: {
|
|
110
|
-
template: [
|
|
111
|
-
{ role: 'user', content: 'What is the capital of {{?country}}?' }
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const response = await orchestrationClient.chatCompletion({
|
|
117
|
-
inputParams: { country: 'France' }
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const responseContent = response.getContent();
|
|
121
|
-
const finishReason = response.getFinishReason();
|
|
122
|
-
const tokenUsage = response.getTokenUsage();
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
You can use the following convenience methods for handling chat completion responses:
|
|
126
|
-
|
|
127
|
-
- `getContent()` parses the response and returns the model's output as a string.
|
|
128
|
-
- `getFinishReason()` retrieves the `finish_reason` explaining why chat completion request stopped.
|
|
129
|
-
- `getTokenUsage()` provides token usage details, including `total_tokens`, `prompt_tokens`, and `completion_tokens`.
|
|
130
|
-
|
|
131
|
-
#### Structured Outputs
|
|
132
|
-
|
|
133
|
-
##### Tool Calling
|
|
134
|
-
|
|
135
|
-
Structured outputs through tools can be enabled by setting `strict: true` in the function definition.
|
|
136
|
-
These tools enable the creation of multi-step, agent-driven workflows, allowing LLMs to perform specific actions.
|
|
137
|
-
|
|
138
|
-
```ts
|
|
139
|
-
templating: {
|
|
140
|
-
tools: [
|
|
141
|
-
type: 'function',
|
|
142
|
-
function: {
|
|
143
|
-
name: 'add',
|
|
144
|
-
description: 'Calculate the absolute value of x',
|
|
145
|
-
parameters: {
|
|
146
|
-
type: 'object',
|
|
147
|
-
properties: {
|
|
148
|
-
x: { type: number }
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
required: ['x'],
|
|
152
|
-
additionalProperties: false
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
##### Using `response_format` parameter
|
|
159
|
-
|
|
160
|
-
Setting `response_format` under `templating` guarantees that the model's output aligns with the schema type specified by developers.
|
|
161
|
-
It is useful when the model is **not calling a tool**, but rather, responding to the user in a structured way.
|
|
162
|
-
|
|
163
|
-
The example below demonstrates how to use `response_format` to return a JSON Schema, with `strict: true` ensuring the outputs conform precisely to the schema.
|
|
164
|
-
|
|
165
|
-
```ts
|
|
166
|
-
const templating: TemplateModuleConfig = {
|
|
167
|
-
template: [{ role: 'user', content: 'What is the capital of {{?country}}?' }],
|
|
168
|
-
response_format: {
|
|
169
|
-
type: 'json_schema',
|
|
170
|
-
json_schema: {
|
|
171
|
-
name: 'capital_response',
|
|
172
|
-
strict: true,
|
|
173
|
-
schema: {
|
|
174
|
-
type: 'object',
|
|
175
|
-
properties: {
|
|
176
|
-
country_name: {
|
|
177
|
-
type: 'string',
|
|
178
|
-
description: 'The name of the country provided by the user.'
|
|
179
|
-
},
|
|
180
|
-
capital: {
|
|
181
|
-
type: 'string',
|
|
182
|
-
description: 'The capital city of the country.'
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
required: ['country_name', 'capital']
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
You can also initialize `json_schema` using a Zod schema, as shown below:
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
const countryCapitalSchema = z
|
|
196
|
-
.object({
|
|
197
|
-
country_name: z.string(),
|
|
198
|
-
capital: z.string()
|
|
199
|
-
})
|
|
200
|
-
.strict();
|
|
201
|
-
|
|
202
|
-
const response_format: ResponseFormatJsonSchema = {
|
|
203
|
-
type: 'json_schema',
|
|
204
|
-
json_schema: {
|
|
205
|
-
name: 'capital_response',
|
|
206
|
-
strict: true,
|
|
207
|
-
schema: zodToJsonSchema(countryCapitalSchema)
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Prompt Registry
|
|
213
|
-
|
|
214
|
-
Alternatively, prepared templates from the [Prompt Registry](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/prompt-registry) of SAP AI Core can be used instead of passing a template in the request.
|
|
215
|
-
|
|
216
|
-
```ts
|
|
217
|
-
const orchestrationClient = new OrchestrationClient({
|
|
218
|
-
llm,
|
|
219
|
-
templating: {
|
|
220
|
-
template_ref: {
|
|
221
|
-
name: 'get-capital',
|
|
222
|
-
scenario: 'e2e-test',
|
|
223
|
-
version: '0.0.1'
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
return orchestrationClient.chatCompletion({
|
|
229
|
-
inputParams: { input: 'France' }
|
|
230
|
-
});
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
A prompt template can be referenced either by ID, or by using a combination of name, scenario, and version.
|
|
234
|
-
For details on storing a template in the Prompt Registry, refer to [this guide](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-prompt-template-imperative).
|
|
235
|
-
|
|
236
|
-
#### Passing a Message History
|
|
237
|
-
|
|
238
|
-
It is possible to provide a history of a conversation to the model.
|
|
239
|
-
Use the following snippet to send a chat completion request with history and a system message:
|
|
240
|
-
|
|
241
|
-
```ts
|
|
242
|
-
const orchestrationClient = new OrchestrationClient({
|
|
243
|
-
llm: {
|
|
244
|
-
model_name: 'gpt-4o',
|
|
245
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
246
|
-
},
|
|
247
|
-
templating: {
|
|
248
|
-
template: [{ role: 'user', content: 'What is my name?' }]
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
const response = await orchestrationClient.chatCompletion({
|
|
253
|
-
messagesHistory: [
|
|
254
|
-
{
|
|
255
|
-
role: 'system',
|
|
256
|
-
content:
|
|
257
|
-
'You are a helpful assistant who remembers all details the user shares with you.'
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
role: 'user',
|
|
261
|
-
content: 'Hi! Im Bob'
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
role: 'assistant',
|
|
265
|
-
content:
|
|
266
|
-
"Hi Bob, nice to meet you! I'm an AI assistant. I'll remember that your name is Bob as we continue our conversation."
|
|
267
|
-
}
|
|
268
|
-
]
|
|
269
|
-
});
|
|
270
|
-
const responseContent = response.getContent();
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
#### Image Recognition
|
|
274
|
-
|
|
275
|
-
Many models in the orchestration service have image recognition capabilities, meaning the models can take images and answer questions about them.
|
|
276
|
-
|
|
277
|
-
> [!Warning]
|
|
278
|
-
> The `image_url` content type can only be used in messages with `role: 'user'`.
|
|
279
|
-
> Attempting to use `image_url` in non-user messages will result in an error.
|
|
280
|
-
|
|
281
|
-
```ts
|
|
282
|
-
const orchestrationClient = new OrchestrationClient({
|
|
283
|
-
llm: {
|
|
284
|
-
model_name: 'gpt-4o'
|
|
285
|
-
},
|
|
286
|
-
templating: {
|
|
287
|
-
template: [
|
|
288
|
-
{
|
|
289
|
-
role: 'user', // image_url content type is only supported in user messages
|
|
290
|
-
content: [
|
|
291
|
-
{
|
|
292
|
-
type: 'text',
|
|
293
|
-
text: 'What is the content of the image?'
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
type: 'image_url',
|
|
297
|
-
image_url: {
|
|
298
|
-
url: '{{?imageUrl}}'
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
}
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
const response = await orchestrationClient.chatCompletion({
|
|
308
|
-
inputParams: {
|
|
309
|
-
imageUrl: 'IMAGE_URL'
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
`IMAGE_URL` can either be a public URL or a base64 encoded image, e.g., `data:image/jpeg;base64,...`.
|
|
315
|
-
The model can take multiple images.
|
|
316
|
-
It will process each image and use the information from all of them to answer the question.
|
|
317
|
-
|
|
318
|
-
### Content Filtering
|
|
319
|
-
|
|
320
|
-
Use the orchestration client with filtering to restrict content that is passed to and received from a generative AI model.
|
|
321
|
-
|
|
322
|
-
This feature allows filtering both the [input](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/input-filtering) and [output](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/output-filtering) of a model based on content safety criteria.
|
|
323
|
-
|
|
324
|
-
The following example demonstrates how to use content filtering with the orchestration client.
|
|
325
|
-
See the sections below for details on the available content filters and how to build them.
|
|
326
|
-
|
|
327
|
-
```ts
|
|
328
|
-
const llm: LlmModuleConfig = {
|
|
329
|
-
model_name: 'gpt-4o',
|
|
330
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
331
|
-
};
|
|
332
|
-
const templating: TemplatingModuleConfig = {
|
|
333
|
-
template: [{ role: 'user', content: '{{?input}}' }]
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
const filter: FilterConfig = ... // Use a build function to create a content filter
|
|
337
|
-
|
|
338
|
-
const orchestrationClient = new OrchestrationClient({
|
|
339
|
-
llm,
|
|
340
|
-
templating,
|
|
341
|
-
filtering: {
|
|
342
|
-
input: {
|
|
343
|
-
filters: [filter] // Multiple filters can be applied
|
|
344
|
-
},
|
|
345
|
-
output: {
|
|
346
|
-
filters: [filter]
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
try {
|
|
352
|
-
const response = await orchestrationClient.chatCompletion({
|
|
353
|
-
inputParams: { input: 'I hate you!' }
|
|
354
|
-
});
|
|
355
|
-
console.log(response.getContent());
|
|
356
|
-
} catch (error: any) {
|
|
357
|
-
console.error(error.message);
|
|
358
|
-
console.error(error.cause?.response?.data);
|
|
359
|
-
}
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
Multiple filters can be applied at the same time for both input and output filtering.
|
|
363
|
-
|
|
364
|
-
> [!Note]
|
|
365
|
-
> The `chatCompletion()` method can throw an error with HTTP status code `400` if content filters hit.
|
|
366
|
-
> In case of a `200` HTTP response, the `getContent()` method can throw an error if the output filters hit.
|
|
367
|
-
> See the [error handling](#error-handling) section for more details.
|
|
368
|
-
|
|
369
|
-
#### Azure Content Filter
|
|
370
|
-
|
|
371
|
-
Use `buildAzureContentSafetyFilter()` function to build an Azure content filter.
|
|
372
|
-
Each category of the filter can be assigned a specific severity level, which corresponds to an Azure threshold value.
|
|
373
|
-
|
|
374
|
-
| Severity Level | Azure Threshold Value |
|
|
375
|
-
| ----------------------- | --------------------- |
|
|
376
|
-
| `ALLOW_SAFE` | 0 |
|
|
377
|
-
| `ALLOW_SAFE_LOW` | 2 |
|
|
378
|
-
| `ALLOW_SAFE_LOW_MEDIUM` | 4 |
|
|
379
|
-
| `ALLOW_ALL` | 6 |
|
|
380
|
-
|
|
381
|
-
```ts
|
|
382
|
-
const filter = buildAzureContentSafetyFilter({
|
|
383
|
-
Hate: 'ALLOW_SAFE_LOW',
|
|
384
|
-
Violence: 'ALLOW_SAFE_LOW_MEDIUM'
|
|
385
|
-
});
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
#### Llama Guard Filter
|
|
389
|
-
|
|
390
|
-
Use `buildLlamaGuardFilter()` function to build a Llama Guard content filter.
|
|
391
|
-
|
|
392
|
-
Available categories can be found with autocompletion.
|
|
393
|
-
Pass the categories as arguments to the function to enable them.
|
|
394
|
-
|
|
395
|
-
```ts
|
|
396
|
-
const filter: FilterConfig = buildLlamaGuardFilter('hate', 'violent_crimes');
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
### Data Masking
|
|
400
|
-
|
|
401
|
-
Use the orchestration client with masking to mask sensitive information in the prompt while preserving necessary context for the generative AI model.
|
|
402
|
-
|
|
403
|
-
The following example demonstrates how to use data masking with the orchestration client.
|
|
404
|
-
See the sections below for details on the available masking providers and how to build them.
|
|
405
|
-
|
|
406
|
-
```ts
|
|
407
|
-
const llm: LlmModuleConfig = {
|
|
408
|
-
model_name: 'gpt-4o',
|
|
409
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
410
|
-
};
|
|
411
|
-
const templating: TemplatingModuleConfig = {
|
|
412
|
-
template: [
|
|
413
|
-
{
|
|
414
|
-
role: 'user',
|
|
415
|
-
content:
|
|
416
|
-
'Please write an email to {{?user}} ({{?email}}), informing them about the amazing capabilities of generative AI! Be brief and concise, write at most 6 sentences.'
|
|
417
|
-
}
|
|
418
|
-
]
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
const maskingProvider: MaskingProviderConfig = ... // Use a build function to create a masking provider
|
|
422
|
-
|
|
423
|
-
const orchestrationClient = new OrchestrationClient({
|
|
424
|
-
llm,
|
|
425
|
-
templating,
|
|
426
|
-
masking: {
|
|
427
|
-
masking_providers: [maskingProvider] // Multiple masking providers can be applied
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
const response = await orchestrationClient.chatCompletion({
|
|
432
|
-
inputParams: { user: 'Alice Anderson', email: 'alice.anderson@sap.com' }
|
|
433
|
-
});
|
|
434
|
-
return response.getContent();
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
#### SAP Data Privacy Integration
|
|
438
|
-
|
|
439
|
-
Orchestration service offers a masking provider SAP Data Privacy Integration (DPI) to anonymize or pseudonomize sensitive information.
|
|
440
|
-
Use `buildDpiMaskingProvider()` function to build a DPI masking provider.
|
|
441
|
-
|
|
442
|
-
```ts
|
|
443
|
-
const maskingProvider: MaskingProviderConfig = buildDpiMaskingProvider({
|
|
444
|
-
method: 'annonymization',
|
|
445
|
-
entities: [{ type: 'profile-email' }, { type: 'profile-person' }],
|
|
446
|
-
allowlist: ['SAP']
|
|
447
|
-
});
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
The `allowlist` property specifies terms will be kept unmasked.
|
|
451
|
-
Set `mask_grounding_input` to `true` to mask grounding input as well.
|
|
452
|
-
For more information about groundings, refer to the [grounding](#grounding) section.
|
|
453
|
-
|
|
454
|
-
### Grounding
|
|
455
|
-
|
|
456
|
-
Grounding enables integrating external, contextually relevant, domain-specific, or real-time data into AI processes.
|
|
457
|
-
The grounding configuration can be provided as a raw JSON object or by using the `buildDocumentGroundingConfig()` function, which requires only the minimal mandatory values.
|
|
458
|
-
|
|
459
|
-
```ts
|
|
460
|
-
const orchestrationClient = new OrchestrationClient({
|
|
461
|
-
llm: {
|
|
462
|
-
model_name: 'gpt-4o'
|
|
463
|
-
},
|
|
464
|
-
templating: {
|
|
465
|
-
template: [
|
|
466
|
-
{
|
|
467
|
-
role: 'user',
|
|
468
|
-
content:
|
|
469
|
-
'UserQuestion: {{?groundingRequest}} Context: {{?groundingOutput}}'
|
|
470
|
-
}
|
|
471
|
-
],
|
|
472
|
-
defaults: {}
|
|
473
|
-
},
|
|
474
|
-
grounding: buildDocumentGroundingConfig({
|
|
475
|
-
input_params: ['groundingRequest'],
|
|
476
|
-
output_param: 'groundingOutput',
|
|
477
|
-
// metadata_params: ['PARAM_NAME']
|
|
478
|
-
filters: [
|
|
479
|
-
{
|
|
480
|
-
id: 'FILTER_ID',
|
|
481
|
-
// data_repository_type: 'vector', // optional, default value is 'vector'
|
|
482
|
-
data_repositories: ['REPOSITORY_ID']
|
|
483
|
-
}
|
|
484
|
-
]
|
|
485
|
-
})
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
const response = await orchestrationClient.chatCompletion({
|
|
489
|
-
inputParams: {
|
|
490
|
-
groundingRequest: 'Give me a short introduction of SAP AI Core.'
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
return response.getContent();
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
By default, the optional filter property `data_repository_type` is set to `vector`.
|
|
497
|
-
Set it to `help.sap.com` to retrieve context from the SAP Help Portal.
|
|
498
|
-
Set `metadata_params` property with an array of parameter names to include [metadata](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/metadata) in the grounding result, which can be used in the prompt.
|
|
499
|
-
Set `data_repositories` property with an array of repository IDs to search in specific data repositories.
|
|
500
|
-
Skip this property to search in all available data repositories.
|
|
501
|
-
|
|
502
|
-
### Using a JSON Configuration from AI Launchpad
|
|
503
|
-
|
|
504
|
-
If you already have an orchestration workflow created in AI Launchpad, you can either download the configuration as a JSON file or copy the JSON string directly to use it with the orchestration client.
|
|
505
|
-
|
|
506
|
-
```ts
|
|
507
|
-
const jsonConfig = await fs.promises.readFile(
|
|
508
|
-
'path/to/orchestration-config.json',
|
|
509
|
-
'utf-8'
|
|
510
|
-
);
|
|
511
|
-
// Alternatively, you can provide the JSON configuration as a plain string in the code directly.
|
|
512
|
-
// const jsonConfig = 'YOUR_JSON_CONFIG'
|
|
513
|
-
|
|
514
|
-
const response = await new OrchestrationClient(jsonConfig).chatCompletion();
|
|
515
|
-
|
|
516
|
-
return response;
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
### Streaming
|
|
520
|
-
|
|
521
|
-
The `OrchestrationClient` supports streaming responses for chat completion requests based on the [Server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) standard.
|
|
522
|
-
|
|
523
|
-
Use the `stream()` method to receive a stream of chunk responses from the model.
|
|
524
|
-
After consuming the stream, call the helper methods to get the finish reason and token usage information.
|
|
525
|
-
|
|
526
|
-
```ts
|
|
527
|
-
const orchestrationClient = new OrchestrationClient({
|
|
528
|
-
llm: {
|
|
529
|
-
model_name: 'gpt-4o',
|
|
530
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
531
|
-
},
|
|
532
|
-
templating: {
|
|
533
|
-
template: [
|
|
534
|
-
{ role: 'user', content: 'Give a long history of {{?country}}?' }
|
|
535
|
-
]
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
const response = await orchestrationClient.stream({
|
|
540
|
-
inputParams: { country: 'France' }
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
for await (const chunk of response.stream) {
|
|
544
|
-
console.log(JSON.stringify(chunk));
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
const finishReason = response.getFinishReason();
|
|
548
|
-
const tokenUsage = response.getTokenUsage();
|
|
549
|
-
|
|
550
|
-
console.log(`Finish reason: ${finishReason}\n`);
|
|
551
|
-
console.log(`Token usage: ${JSON.stringify(tokenUsage)}\n`);
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
#### Streaming the Delta Content
|
|
555
|
-
|
|
556
|
-
The client provides a helper method to extract the text chunks as strings:
|
|
557
|
-
|
|
558
|
-
```ts
|
|
559
|
-
for await (const chunk of response.stream.toContentStream()) {
|
|
560
|
-
console.log(chunk); // will log the delta content
|
|
561
|
-
}
|
|
562
|
-
```
|
|
563
|
-
|
|
564
|
-
Each chunk will be a string containing the delta content.
|
|
565
|
-
|
|
566
|
-
#### Streaming with Abort Controller
|
|
567
|
-
|
|
568
|
-
Streaming request can be aborted using the `AbortController` API.
|
|
569
|
-
In case of an error, the SAP Cloud SDK for AI will automatically close the stream.
|
|
570
|
-
Additionally, it can be aborted manually by calling the `stream()` method with an `AbortController` object.
|
|
571
|
-
|
|
572
|
-
```ts
|
|
573
|
-
const orchestrationClient = new OrchestrationClient({
|
|
574
|
-
llm: {
|
|
575
|
-
model_name: 'gpt-4o',
|
|
576
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
577
|
-
},
|
|
578
|
-
templating: {
|
|
579
|
-
template: [
|
|
580
|
-
{ role: 'user', content: 'Give a long history of {{?country}}?' }
|
|
581
|
-
]
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
const controller = new AbortController();
|
|
586
|
-
const response = await orchestrationClient.stream(
|
|
587
|
-
{
|
|
588
|
-
inputParams: { country: 'France' }
|
|
589
|
-
},
|
|
590
|
-
controller
|
|
591
|
-
);
|
|
592
|
-
|
|
593
|
-
// Abort the streaming request after one second
|
|
594
|
-
setTimeout(() => {
|
|
595
|
-
controller.abort();
|
|
596
|
-
}, 1000);
|
|
597
|
-
|
|
598
|
-
for await (const chunk of response.stream) {
|
|
599
|
-
console.log(JSON.stringify(chunk));
|
|
600
|
-
}
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
In this example, streaming request will be aborted after one second.
|
|
604
|
-
Abort controller can be useful, e.g., when end-user wants to stop the stream or refreshes the page.
|
|
605
|
-
|
|
606
|
-
#### Stream Options
|
|
607
|
-
|
|
608
|
-
The orchestration service offers multiple streaming options, which you can configure in addition to the LLM's streaming options.
|
|
609
|
-
These include options like definining the maximum number of characters per chunk or modifying the output filter behavior.
|
|
610
|
-
There are two ways to add specific streaming options to your client, either at initialization of orchestration client, or when calling the stream API.
|
|
611
|
-
|
|
612
|
-
Setting streaming options dynamically could be useful if an initialized orchestration client will also be used for streaming.
|
|
613
|
-
|
|
614
|
-
You can check the list of available stream options in the [orchestration service's documentation](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/streaming).
|
|
615
|
-
|
|
616
|
-
An example for setting the streaming options when calling the stream API looks like the following:
|
|
617
|
-
|
|
618
|
-
```ts
|
|
619
|
-
const response = orchestrationClient.stream(
|
|
620
|
-
{
|
|
621
|
-
inputParams: { country: 'France' }
|
|
622
|
-
},
|
|
623
|
-
controller,
|
|
624
|
-
{
|
|
625
|
-
llm: { include_usage: false },
|
|
626
|
-
global: { chunk_size: 10 },
|
|
627
|
-
outputFiltering: { overlap: 200 }
|
|
628
|
-
}
|
|
629
|
-
);
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
Usage metrics are collected by default, if you do not want to receive them, set `include_usage` to `false`.
|
|
633
|
-
If you don't want any streaming options as part of your call to the LLM, set `streamOptions.llm` to `null`.
|
|
634
|
-
|
|
635
|
-
> [!NOTE]
|
|
636
|
-
> When initalizing a client with a JSON module config, providing streaming options is not possible.
|
|
637
|
-
|
|
638
|
-
### Using a Custom Resource Group
|
|
639
|
-
|
|
640
|
-
Using a custom [resource group](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/resource-groups) requires a deployment of Orchestration within that resource group.
|
|
641
|
-
Refer to [this guide](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration) for creating such a deployment.
|
|
642
|
-
|
|
643
|
-
You can pass a custom resource group when creating a client as follows:
|
|
644
|
-
|
|
645
|
-
```ts
|
|
646
|
-
const orchestrationClient = new OrchestrationClient(
|
|
647
|
-
{
|
|
648
|
-
llm: {
|
|
649
|
-
model_name: 'gpt-4p',
|
|
650
|
-
model_params: { max_tokens: 50, temperature: 0.1 }
|
|
651
|
-
},
|
|
652
|
-
templating: {
|
|
653
|
-
template: [{ role: 'user', content: 'What is my name?' }]
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
{ resourceGroup: 'rg1234' }
|
|
657
|
-
);
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
### Custom Request Configuration
|
|
661
|
-
|
|
662
|
-
Set custom request configuration in the `requestConfig` parameter when calling the `chatCompletion()` method.
|
|
663
|
-
|
|
664
|
-
```ts
|
|
665
|
-
const response = await orchestrationClient.chatCompletion(
|
|
666
|
-
{
|
|
667
|
-
...
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
headers: {
|
|
671
|
-
'x-custom-header': 'custom-value'
|
|
672
|
-
// Add more headers here
|
|
673
|
-
},
|
|
674
|
-
params: {
|
|
675
|
-
// Add more parameters here
|
|
676
|
-
}
|
|
677
|
-
// Add more request configuration here
|
|
678
|
-
}
|
|
679
|
-
);
|
|
680
|
-
```
|
|
681
|
-
|
|
682
|
-
### Custom Destination
|
|
683
|
-
|
|
684
|
-
When initializing the `OrchestrationClient` client, it is possible to provide a custom destination.
|
|
685
|
-
For example, when targeting a destination with the name `my-destination`, the following code can be used:
|
|
686
|
-
|
|
687
|
-
```ts
|
|
688
|
-
const orchestrationClient = new OrchestrationClient(
|
|
689
|
-
{
|
|
690
|
-
llm,
|
|
691
|
-
templating
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
resourceGroup: 'default'
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
destinationName: 'my-destination'
|
|
698
|
-
}
|
|
699
|
-
);
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
By default, the fetched destination is cached.
|
|
703
|
-
To disable caching, set the `useCache` parameter to `false` together with the `destinationName` parameter.
|
|
704
|
-
|
|
705
|
-
## Error Handling
|
|
706
|
-
|
|
707
|
-
For error handling instructions, refer to this [section](https://github.com/SAP/ai-sdk-js/blob/main/README.md#error-handling).
|
|
708
|
-
|
|
709
|
-
## Local Testing
|
|
710
|
-
|
|
711
|
-
For local testing instructions, refer to this [section](https://github.com/SAP/ai-sdk-js/blob/main/README.md#local-testing).
|
|
22
|
+
Visit the [SAP Cloud SDK for AI (JavaScript)](https://sap.github.io/ai-sdk/docs/js/overview-cloud-sdk-for-ai-js) documentation portal to learn more about its capabilities and detailed usage.
|
|
712
23
|
|
|
713
24
|
## Support, Feedback, Contribution
|
|
714
25
|
|
|
@@ -23,5 +23,17 @@ export declare class OrchestrationClient {
|
|
|
23
23
|
stream(prompt?: Prompt, controller?: AbortController, options?: StreamOptions, requestConfig?: CustomRequestConfig): Promise<OrchestrationStreamResponse<OrchestrationStreamChunkResponse>>;
|
|
24
24
|
private executeRequest;
|
|
25
25
|
private createStreamResponse;
|
|
26
|
+
/**
|
|
27
|
+
* Validate if a string is valid JSON.
|
|
28
|
+
* @param config - The JSON string to validate.
|
|
29
|
+
*/
|
|
30
|
+
private validateJsonConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Parse and merge templating into the config object.
|
|
33
|
+
* @param config - The orchestration module configuration with templating either as object or string.
|
|
34
|
+
* @returns The updated and merged orchestration module configuration.
|
|
35
|
+
* @throws Error if the YAML parsing fails or if the parsed object does not conform to the expected schema.
|
|
36
|
+
*/
|
|
37
|
+
private parseAndMergeTemplating;
|
|
26
38
|
}
|
|
27
39
|
//# sourceMappingURL=orchestration-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-client.d.ts","sourceRoot":"","sources":["../src/orchestration-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestration-client.d.ts","sourceRoot":"","sources":["../src/orchestration-client.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAKpE,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,MAAM,EAEN,aAAa,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAOjF;;GAEG;AACH,qBAAa,mBAAmB;IAQ5B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB,CAAC;IACzB,OAAO,CAAC,WAAW,CAAC;IATtB;;;;;OAKG;gBAEO,MAAM,EAAE,yBAAyB,GAAG,MAAM,EAC1C,gBAAgB,CAAC,EAAE,mBAAmB,YAAA,EACtC,WAAW,CAAC,EAAE,6BAA6B,YAAA;IAW/C,cAAc,CAClB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAS3B,MAAM,CACV,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,kBAAwB,EAClC,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,2BAA2B,CAAC,gCAAgC,CAAC,CAAC;YAkB3D,cAAc;YAkCd,oBAAoB;IAyBlC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CA6BhC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { executeRequest } from '@sap-ai-sdk/core';
|
|
2
2
|
import { resolveDeploymentId } from '@sap-ai-sdk/ai-api/internal.js';
|
|
3
3
|
import { createLogger } from '@sap-cloud-sdk/util';
|
|
4
|
+
import yaml from 'yaml';
|
|
5
|
+
import { promptTemplatePostRequestSchema } from '@sap-ai-sdk/prompt-registry';
|
|
4
6
|
import { OrchestrationStream } from './orchestration-stream.js';
|
|
5
7
|
import { OrchestrationStreamResponse } from './orchestration-stream-response.js';
|
|
6
8
|
import { OrchestrationResponse } from './orchestration-response.js';
|
|
@@ -26,13 +28,14 @@ export class OrchestrationClient {
|
|
|
26
28
|
this.config = config;
|
|
27
29
|
this.deploymentConfig = deploymentConfig;
|
|
28
30
|
this.destination = destination;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
JSON.parse(config);
|
|
32
|
-
}
|
|
31
|
+
if (typeof config === 'string') {
|
|
32
|
+
this.validateJsonConfig(config);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
else if (typeof config.templating === 'string') {
|
|
35
|
+
this.config = this.parseAndMergeTemplating(config); // parse and assign if templating is a string
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.config = config; // TypeScript cannot infer that config.templating is not a string
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
async chatCompletion(prompt, requestConfig) {
|
|
@@ -86,5 +89,48 @@ export class OrchestrationClient {
|
|
|
86
89
|
._pipe(OrchestrationStream._processTokenUsage, response);
|
|
87
90
|
return response;
|
|
88
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Validate if a string is valid JSON.
|
|
94
|
+
* @param config - The JSON string to validate.
|
|
95
|
+
*/
|
|
96
|
+
validateJsonConfig(config) {
|
|
97
|
+
try {
|
|
98
|
+
JSON.parse(config);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw new Error(`Could not parse JSON: ${error}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parse and merge templating into the config object.
|
|
106
|
+
* @param config - The orchestration module configuration with templating either as object or string.
|
|
107
|
+
* @returns The updated and merged orchestration module configuration.
|
|
108
|
+
* @throws Error if the YAML parsing fails or if the parsed object does not conform to the expected schema.
|
|
109
|
+
*/
|
|
110
|
+
parseAndMergeTemplating(config) {
|
|
111
|
+
try {
|
|
112
|
+
const parsedObject = yaml.parse(config.templating); // We are sure it's a string here
|
|
113
|
+
const result = promptTemplatePostRequestSchema.safeParse(parsedObject);
|
|
114
|
+
if (result.success) {
|
|
115
|
+
return {
|
|
116
|
+
...config,
|
|
117
|
+
templating: {
|
|
118
|
+
template: result.data.spec.template,
|
|
119
|
+
...(result.data.spec.defaults && {
|
|
120
|
+
defaults: result.data.spec.defaults
|
|
121
|
+
}),
|
|
122
|
+
...(result.data.spec.response_format && {
|
|
123
|
+
response_format: result.data.spec.response_format
|
|
124
|
+
}),
|
|
125
|
+
...(result.data.spec.tools && { tools: result.data.spec.tools })
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
throw new Error(`Prompt Template YAML does not conform to the defined type: ${result.error}`);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw new Error(`Error parsing YAML: ${error}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
89
135
|
}
|
|
90
136
|
//# sourceMappingURL=orchestration-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-client.js","sourceRoot":"","sources":["../src/orchestration-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,8BAA8B,EAC9B,kDAAkD,EACnD,MAAM,iBAAiB,CAAC;AAezB,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,eAAe;IACxB,cAAc,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAQpB;IACA;IACA;IATV;;;;;OAKG;IACH,YACU,MAA0C,EAC1C,gBAAsC,EACtC,WAA2C;QAF3C,WAAM,GAAN,MAAM,CAAoC;QAC1C,qBAAgB,GAAhB,gBAAgB,CAAsB;QACtC,gBAAW,GAAX,WAAW,CAAgC;QAEnD,IAAI,
|
|
1
|
+
{"version":3,"file":"orchestration-client.js","sourceRoot":"","sources":["../src/orchestration-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,8BAA8B,EAC9B,kDAAkD,EACnD,MAAM,iBAAiB,CAAC;AAezB,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,eAAe;IACxB,cAAc,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAQpB;IACA;IACA;IATV;;;;;OAKG;IACH,YACU,MAA0C,EAC1C,gBAAsC,EACtC,WAA2C;QAF3C,WAAM,GAAN,MAAM,CAAoC;QAC1C,qBAAgB,GAAhB,gBAAgB,C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
|
@@ -40,16 +40,15 @@ export interface OrchestrationModuleConfig {
|
|
|
40
40
|
/**
|
|
41
41
|
* Templating module configuration.
|
|
42
42
|
*/
|
|
43
|
-
templating: TemplatingModuleConfig;
|
|
43
|
+
templating: TemplatingModuleConfig | string;
|
|
44
44
|
/**
|
|
45
45
|
* LLM module configuration.
|
|
46
46
|
*/
|
|
47
47
|
llm: LlmModuleConfig;
|
|
48
48
|
/**
|
|
49
|
-
* Filtering module configuration.
|
|
50
|
-
*
|
|
49
|
+
* Filtering module configuration for both input and output filters.
|
|
50
|
+
* To configure a filter, use convenience functions like `buildAzureContentSafetyFilter`, `buildLlamaGuardFilter`, etc..
|
|
51
51
|
* @example
|
|
52
|
-
* ```ts
|
|
53
52
|
* filtering: {
|
|
54
53
|
* input: {
|
|
55
54
|
* filters: [
|
|
@@ -57,7 +56,6 @@ export interface OrchestrationModuleConfig {
|
|
|
57
56
|
* ]
|
|
58
57
|
* }
|
|
59
58
|
* }
|
|
60
|
-
* ```
|
|
61
59
|
*/
|
|
62
60
|
filtering?: FilteringModuleConfig;
|
|
63
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-types.d.ts","sourceRoot":"","sources":["../src/orchestration-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,eAAe,IAAI,uBAAuB,EAC1C,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,uBAAuB,GAAG;IACtD,MAAM;IACN,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,cAAc,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,UAAU,EAAE,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestration-types.d.ts","sourceRoot":"","sources":["../src/orchestration-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,eAAe,IAAI,uBAAuB,EAC1C,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;G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"version":3,"file":"orchestration-types.js","sourceRoot":"","sources":["../src/orchestration-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestration-types.js","sourceRoot":"","sources":["../src/orchestration-types.ts"],"names":[],"mappings":"AA2MA;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,UAAU,EAAE,CAAC;IACb,cAAc,EAAE,CAAC;IACjB,qBAAqB,EAAE,CAAC;IACxB,SAAS,EAAE,CAAC;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-config.d.ts","sourceRoot":"","sources":["../../src/util/module-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"module-config.d.ts","sourceRoot":"","sources":["../../src/util/module-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EAGtB,MAAM,+BAA+B,CAAC;AAOvC;;GAEG;AACH,wBAAgB,kDAAkD,CAChE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAarB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,eAAe,EAChC,aAAa,CAAC,EAAE,aAAa,GAC5B,eAAe,CAiBjB;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,GAC7C,qBAAqB,CAQvB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,aAAa,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,mBAAmB,CAgCrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,aAAa,GAC5B,qBAAqB,CAgCvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-config.js","sourceRoot":"","sources":["../../src/util/module-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"module-config.js","sourceRoot":"","sources":["../../src/util/module-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAiBnD,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,eAAe;IACxB,cAAc,EAAE,qBAAqB;CACtC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,kDAAkD,CAChE,MAA2B,EAC3B,MAAe,EACf,MAAgB;IAEhB,MAAM,oBAAoB,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3C,IAAI,MAAM,EAAE,CAAC;QACX,oBAAoB,CAAC,MAAM,GAAG,IAAI,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,OAAO,oBAAoB,CAAC,MAAM,CAAC;IACrC,CAAC;IAED,OAAO;QACL,gBAAgB,EAAE,MAAM,EAAE,eAAe,IAAI,EAAE;QAC/C,YAAY,EAAE,MAAM,EAAE,WAAW,IAAI,EAAE;QACvC,oBAAoB;KACrB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,eAAgC,EA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AAI;YAC7B,gBAAgB,EAAE,MAAM,CAAC,eAAe;SACzC,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,aAAmC,EACnC,aAA6B;IAE7B,OAAO;QACL,GAAG,aAAa;QAChB,GAAG,CAAC,CAAC,aAAa,IAAI,aAAa,EAAE,MAAM,CAAC,IAAI;YAC9C,MAAM,EAAE;gBACN,GAAG,aAAa;gBAChB,GAAG,aAAa,EAAE,MAAM;aACzB;SACF,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ai-sdk/orchestration",
|
|
3
|
-
"version": "1.11.1-
|
|
3
|
+
"version": "1.11.1-20250415115505.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@sap-cloud-sdk/util": "^4.0.2",
|
|
24
|
-
"
|
|
25
|
-
"@sap-ai-sdk/
|
|
24
|
+
"yaml": "^1.10.2",
|
|
25
|
+
"@sap-ai-sdk/core": "^1.11.1-20250415115505.0",
|
|
26
|
+
"@sap-ai-sdk/ai-api": "^1.11.1-20250415115505.0",
|
|
27
|
+
"@sap-ai-sdk/prompt-registry": "^1.11.1-20250415115505.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@sap-cloud-sdk/http-client": "^4.0.2",
|