@sap-ai-sdk/orchestration 1.17.1-20250808013316.0 → 2.0.0-20250808144143.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/dist/client/api/schema/azure-content-safety-input.d.ts +5 -5
- package/dist/client/api/schema/azure-content-safety-input.d.ts.map +1 -1
- package/dist/client/api/schema/azure-content-safety-output.d.ts +4 -4
- package/dist/client/api/schema/azure-content-safety-output.d.ts.map +1 -1
- package/dist/client/api/schema/completion-post-request.d.ts +2 -2
- package/dist/client/api/schema/completion-post-request.d.ts.map +1 -1
- package/dist/client/api/schema/completion-post-response-streaming.d.ts +2 -2
- package/dist/client/api/schema/completion-post-response-streaming.d.ts.map +1 -1
- package/dist/client/api/schema/completion-post-response.d.ts +2 -2
- package/dist/client/api/schema/completion-post-response.d.ts.map +1 -1
- package/dist/client/api/schema/error-response-streaming.d.ts +2 -19
- package/dist/client/api/schema/error-response-streaming.d.ts.map +1 -1
- package/dist/client/api/schema/error-response.d.ts +2 -19
- package/dist/client/api/schema/error-response.d.ts.map +1 -1
- package/dist/client/api/schema/error-streaming.d.ts +25 -0
- package/dist/client/api/schema/error-streaming.d.ts.map +1 -0
- package/dist/client/api/schema/error-streaming.js +2 -0
- package/dist/client/api/schema/error-streaming.js.map +1 -0
- package/dist/client/api/schema/error.d.ts +25 -0
- package/dist/client/api/schema/error.d.ts.map +1 -0
- package/dist/client/api/schema/error.js +2 -0
- package/dist/client/api/schema/error.js.map +1 -0
- package/dist/client/api/schema/global-stream-options.d.ts +5 -1
- package/dist/client/api/schema/global-stream-options.d.ts.map +1 -1
- package/dist/client/api/schema/grounding-module-config.d.ts +13 -8
- package/dist/client/api/schema/grounding-module-config.d.ts.map +1 -1
- package/dist/client/api/schema/index.d.ts +5 -4
- package/dist/client/api/schema/index.d.ts.map +1 -1
- package/dist/client/api/schema/index.js +5 -4
- package/dist/client/api/schema/index.js.map +1 -1
- package/dist/client/api/schema/llm-model-details.d.ts +30 -0
- package/dist/client/api/schema/llm-model-details.d.ts.map +1 -0
- package/dist/client/api/schema/{llm-module-config.js → llm-model-details.js} +1 -1
- package/dist/client/api/schema/llm-model-details.js.map +1 -0
- package/dist/client/api/schema/llm-module-result.d.ts +1 -1
- package/dist/client/api/schema/module-configs.d.ts +7 -11
- package/dist/client/api/schema/module-configs.d.ts.map +1 -1
- package/dist/client/api/schema/orchestration-config.d.ts +2 -6
- package/dist/client/api/schema/orchestration-config.d.ts.map +1 -1
- package/dist/client/api/schema/prompt-templating-module-config.d.ts +15 -0
- package/dist/client/api/schema/prompt-templating-module-config.d.ts.map +1 -0
- package/dist/client/api/schema/prompt-templating-module-config.js +2 -0
- package/dist/client/api/schema/prompt-templating-module-config.js.map +1 -0
- package/dist/client/api/schema/template.d.ts +1 -1
- package/dist/client/api/schema/translation-module-config.d.ts +15 -0
- package/dist/client/api/schema/translation-module-config.d.ts.map +1 -0
- package/dist/client/api/schema/translation-module-config.js +2 -0
- package/dist/client/api/schema/translation-module-config.js.map +1 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +2 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -3
- package/dist/internal.js.map +1 -1
- package/dist/orchestration-client.d.ts +3 -3
- package/dist/orchestration-client.d.ts.map +1 -1
- package/dist/orchestration-client.js +20 -16
- package/dist/orchestration-client.js.map +1 -1
- package/dist/orchestration-response.d.ts.map +1 -1
- package/dist/orchestration-response.js +3 -3
- package/dist/orchestration-response.js.map +1 -1
- package/dist/orchestration-stream-chunk-response.js +2 -2
- package/dist/orchestration-stream-chunk-response.js.map +1 -1
- package/dist/orchestration-stream-response.d.ts.map +1 -1
- package/dist/orchestration-stream-response.js +3 -3
- package/dist/orchestration-stream-response.js.map +1 -1
- package/dist/orchestration-types.d.ts +147 -67
- package/dist/orchestration-types.d.ts.map +1 -1
- package/dist/orchestration-types.js.map +1 -1
- package/dist/util/filtering.d.ts +2 -9
- package/dist/util/filtering.d.ts.map +1 -1
- package/dist/util/filtering.js +0 -19
- package/dist/util/filtering.js.map +1 -1
- package/dist/util/grounding.d.ts.map +1 -1
- package/dist/util/grounding.js +4 -2
- package/dist/util/grounding.js.map +1 -1
- package/dist/util/module-config.d.ts +5 -5
- package/dist/util/module-config.d.ts.map +1 -1
- package/dist/util/module-config.js +69 -80
- package/dist/util/module-config.js.map +1 -1
- package/dist/util/stream.d.ts +3 -1
- package/dist/util/stream.d.ts.map +1 -1
- package/dist/util/stream.js +2 -2
- package/dist/util/stream.js.map +1 -1
- package/package.json +4 -4
- package/dist/client/api/schema/input-translation-module-config.d.ts +0 -6
- package/dist/client/api/schema/input-translation-module-config.d.ts.map +0 -1
- package/dist/client/api/schema/input-translation-module-config.js +0 -2
- package/dist/client/api/schema/input-translation-module-config.js.map +0 -1
- package/dist/client/api/schema/llm-module-config.d.ts +0 -31
- package/dist/client/api/schema/llm-module-config.d.ts.map +0 -1
- package/dist/client/api/schema/llm-module-config.js.map +0 -1
- package/dist/client/api/schema/output-translation-module-config.d.ts +0 -6
- package/dist/client/api/schema/output-translation-module-config.d.ts.map +0 -1
- package/dist/client/api/schema/output-translation-module-config.js +0 -2
- package/dist/client/api/schema/output-translation-module-config.js.map +0 -1
- package/dist/client/api/schema/templating-module-config.d.ts +0 -7
- package/dist/client/api/schema/templating-module-config.d.ts.map +0 -1
- package/dist/client/api/schema/templating-module-config.js +0 -2
- package/dist/client/api/schema/templating-module-config.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from './client/api/schema/index.js';
|
|
2
1
|
export { OrchestrationStreamResponse } from './orchestration-stream-response.js';
|
|
3
2
|
export { OrchestrationStreamChunkResponse } from './orchestration-stream-chunk-response.js';
|
|
4
3
|
export { OrchestrationStream } from './orchestration-stream.js';
|
|
5
4
|
export { OrchestrationClient } from './orchestration-client.js';
|
|
6
|
-
export { buildAzureContentFilter, buildAzureContentSafetyFilter, buildLlamaGuardFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildTranslationConfig } from './util/index.js';
|
|
7
5
|
export { OrchestrationResponse } from './orchestration-response.js';
|
|
6
|
+
export { buildAzureContentSafetyFilter, buildLlamaGuardFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildTranslationConfig } from './util/index.js';
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './index.js';
|
|
2
2
|
export * from './util/index.js';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './orchestration-response.js';
|
|
3
|
+
export * from './client/api/schema/index.js';
|
|
5
4
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './index.js';
|
|
2
2
|
export * from './util/index.js';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './orchestration-response.js';
|
|
3
|
+
export * from './client/api/schema/index.js';
|
|
5
4
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { OrchestrationStreamResponse } from './orchestration-stream-response.js'
|
|
|
2
2
|
import { OrchestrationResponse } from './orchestration-response.js';
|
|
3
3
|
import type { CustomRequestConfig } from '@sap-cloud-sdk/http-client';
|
|
4
4
|
import type { ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
|
|
5
|
-
import type { OrchestrationModuleConfig,
|
|
5
|
+
import type { OrchestrationModuleConfig, ChatCompletionRequest, StreamOptions } from './orchestration-types.js';
|
|
6
6
|
import type { OrchestrationStreamChunkResponse } from './orchestration-stream-chunk-response.js';
|
|
7
7
|
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
|
|
8
8
|
/**
|
|
@@ -19,8 +19,8 @@ export declare class OrchestrationClient {
|
|
|
19
19
|
* @param destination - The destination to use for the request.
|
|
20
20
|
*/
|
|
21
21
|
constructor(config: OrchestrationModuleConfig | string, deploymentConfig?: ResourceGroupConfig | undefined, destination?: HttpDestinationOrFetchOptions | undefined);
|
|
22
|
-
chatCompletion(
|
|
23
|
-
stream(
|
|
22
|
+
chatCompletion(request?: ChatCompletionRequest, requestConfig?: CustomRequestConfig): Promise<OrchestrationResponse>;
|
|
23
|
+
stream(request?: ChatCompletionRequest, controller?: AbortController, options?: StreamOptions, requestConfig?: CustomRequestConfig): Promise<OrchestrationStreamResponse<OrchestrationStreamChunkResponse>>;
|
|
24
24
|
private executeRequest;
|
|
25
25
|
private createStreamResponse;
|
|
26
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
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;AAMpE,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,
|
|
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;AAMpE,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EAErB,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;IAY/C,cAAc,CAClB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAS3B,MAAM,CACV,OAAO,CAAC,EAAE,qBAAqB,EAC/B,UAAU,kBAAwB,EAClC,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,2BAA2B,CAAC,gCAAgC,CAAC,CAAC;YAuB3D,cAAc;YAkCd,oBAAoB;IA4BlC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CAuChC"}
|
|
@@ -33,26 +33,26 @@ export class OrchestrationClient {
|
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
this.config =
|
|
36
|
-
typeof config.
|
|
36
|
+
typeof config.promptTemplating.prompt === 'string'
|
|
37
37
|
? this.parseAndMergeTemplating(config) // parse and assign if templating is a string
|
|
38
38
|
: config;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
async chatCompletion(
|
|
41
|
+
async chatCompletion(request, requestConfig) {
|
|
42
42
|
const response = await this.executeRequest({
|
|
43
|
-
|
|
43
|
+
request,
|
|
44
44
|
requestConfig,
|
|
45
45
|
stream: false
|
|
46
46
|
});
|
|
47
47
|
return new OrchestrationResponse(response);
|
|
48
48
|
}
|
|
49
|
-
async stream(
|
|
49
|
+
async stream(request, controller = new AbortController(), options, requestConfig) {
|
|
50
50
|
try {
|
|
51
51
|
if (typeof this.config === 'string' && options) {
|
|
52
52
|
logger.warn('Stream options are not supported when using a JSON module config.');
|
|
53
53
|
}
|
|
54
54
|
return await this.createStreamResponse({
|
|
55
|
-
|
|
55
|
+
request,
|
|
56
56
|
requestConfig,
|
|
57
57
|
stream: true,
|
|
58
58
|
streamOptions: options
|
|
@@ -64,17 +64,17 @@ export class OrchestrationClient {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
async executeRequest(options) {
|
|
67
|
-
const {
|
|
67
|
+
const { request, requestConfig, stream, streamOptions } = options;
|
|
68
68
|
const body = typeof this.config === 'string'
|
|
69
|
-
? constructCompletionPostRequestFromJsonModuleConfig(JSON.parse(this.config),
|
|
70
|
-
: constructCompletionPostRequest(this.config,
|
|
69
|
+
? constructCompletionPostRequestFromJsonModuleConfig(JSON.parse(this.config), request, stream)
|
|
70
|
+
: constructCompletionPostRequest(this.config, request, stream, streamOptions);
|
|
71
71
|
const deploymentId = await resolveDeploymentId({
|
|
72
72
|
scenarioId: 'orchestration',
|
|
73
73
|
...(this.deploymentConfig ?? {}),
|
|
74
74
|
destination: this.destination
|
|
75
75
|
});
|
|
76
76
|
return executeRequest({
|
|
77
|
-
url: `/inference/deployments/${deploymentId}/completion`,
|
|
77
|
+
url: `/inference/deployments/${deploymentId}/v2/completion`,
|
|
78
78
|
...(this.deploymentConfig ?? {})
|
|
79
79
|
}, body, requestConfig, this.destination);
|
|
80
80
|
}
|
|
@@ -115,11 +115,12 @@ export class OrchestrationClient {
|
|
|
115
115
|
*/
|
|
116
116
|
parseAndMergeTemplating(config) {
|
|
117
117
|
let parsedObject;
|
|
118
|
-
if (typeof config.
|
|
118
|
+
if (typeof config.promptTemplating.prompt === 'string' &&
|
|
119
|
+
!config.promptTemplating.prompt.trim()) {
|
|
119
120
|
throw new Error('Templating YAML string must be non-empty.');
|
|
120
121
|
}
|
|
121
122
|
try {
|
|
122
|
-
parsedObject = yaml.parse(config.
|
|
123
|
+
parsedObject = yaml.parse(config.promptTemplating.prompt);
|
|
123
124
|
}
|
|
124
125
|
catch (error) {
|
|
125
126
|
throw new Error(`Error parsing YAML: ${error}`);
|
|
@@ -131,11 +132,14 @@ export class OrchestrationClient {
|
|
|
131
132
|
const { template, defaults, response_format, tools } = result.data.spec;
|
|
132
133
|
return {
|
|
133
134
|
...config,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
promptTemplating: {
|
|
136
|
+
...config.promptTemplating,
|
|
137
|
+
prompt: {
|
|
138
|
+
template: template,
|
|
139
|
+
...(defaults && { defaults }),
|
|
140
|
+
...(response_format && { response_format }),
|
|
141
|
+
...(tools && { tools })
|
|
142
|
+
}
|
|
139
143
|
}
|
|
140
144
|
};
|
|
141
145
|
}
|
|
@@ -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,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gEAAgE,EAAE,MAAM,yCAAyC,CAAC;AAC3H,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;AAgBzB,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,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,EAAE,CAAC;oBAC3C,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;iBACxB;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-response.d.ts","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EAEV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,qBAAqB;aAKJ,WAAW,EAAE,YAAY;IAJrD;;OAEG;IACH,SAAgB,IAAI,EAAE,sBAAsB,CAAC;gBACjB,WAAW,EAAE,YAAY;IAIrD;;;OAGG;IACH,aAAa,IAAI,UAAU;IAG3B;;;;OAIG;IACH,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAIpD;;;;;OAKG;IACH,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAa/C;;;;OAIG;IACH,YAAY,CAAC,WAAW,SAAI,GAAG,gBAAgB,GAAG,SAAS;IAK3D;;;;OAIG;IACH,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAK/C;;;;OAIG;IACH,cAAc,CAAC,WAAW,SAAI,GAAG,YAAY;
|
|
1
|
+
{"version":3,"file":"orchestration-response.d.ts","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EAEV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,qBAAqB;aAKJ,WAAW,EAAE,YAAY;IAJrD;;OAEG;IACH,SAAgB,IAAI,EAAE,sBAAsB,CAAC;gBACjB,WAAW,EAAE,YAAY;IAIrD;;;OAGG;IACH,aAAa,IAAI,UAAU;IAG3B;;;;OAIG;IACH,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAIpD;;;;;OAKG;IACH,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAa/C;;;;OAIG;IACH,YAAY,CAAC,WAAW,SAAI,GAAG,gBAAgB,GAAG,SAAS;IAK3D;;;;OAIG;IACH,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAK/C;;;;OAIG;IACH,cAAc,CAAC,WAAW,SAAI,GAAG,YAAY;IAO7C;;;;OAIG;IACH,mBAAmB,CAAC,WAAW,SAAI,GAAG,oBAAoB,GAAG,SAAS;IAItE;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIvD,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -16,7 +16,7 @@ export class OrchestrationResponse {
|
|
|
16
16
|
* @returns Token usage.
|
|
17
17
|
*/
|
|
18
18
|
getTokenUsage() {
|
|
19
|
-
return this.data.
|
|
19
|
+
return this.data.final_result.usage;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Reason for stopping the completion.
|
|
@@ -64,7 +64,7 @@ export class OrchestrationResponse {
|
|
|
64
64
|
* @returns A list of all messages.
|
|
65
65
|
*/
|
|
66
66
|
getAllMessages(choiceIndex = 0) {
|
|
67
|
-
const messages = this.data.
|
|
67
|
+
const messages = this.data.intermediate_results.templating ?? [];
|
|
68
68
|
const content = this.findChoiceByIndex(choiceIndex)?.message;
|
|
69
69
|
return content ? [...messages, content] : messages;
|
|
70
70
|
}
|
|
@@ -85,7 +85,7 @@ export class OrchestrationResponse {
|
|
|
85
85
|
return this.getChoices().find((c) => c.index === index);
|
|
86
86
|
}
|
|
87
87
|
getChoices() {
|
|
88
|
-
return this.data.
|
|
88
|
+
return this.data.final_result.choices;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
//# sourceMappingURL=orchestration-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-response.js","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAKJ;IAJ5B;;OAEG;IACa,IAAI,CAAyB;IAC7C,YAA4B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"orchestration-response.js","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAKJ;IAJ5B;;OAEG;IACa,IAAI,CAAyB;IAC7C,YAA4B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAM,CAAC;IACvC,CAAC;IACD;;;;OAIG;IACH,eAAe,CAAC,WAAW,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,WAAW,GAAG,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACnD,IACE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE;YAC/B,MAAM,EAAE,aAAa,KAAK,gBAAgB,EAC1C,CAAC;YACD,M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 @@ export class OrchestrationStreamChunkResponse {
|
|
|
12
12
|
* @returns Token usage.
|
|
13
13
|
*/
|
|
14
14
|
getTokenUsage() {
|
|
15
|
-
return this.data.
|
|
15
|
+
return this.data.final_result?.usage;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Reason for stopping the completion stream chunk.
|
|
@@ -47,7 +47,7 @@ export class OrchestrationStreamChunkResponse {
|
|
|
47
47
|
return this.getChoices()?.find((c) => c.index === index);
|
|
48
48
|
}
|
|
49
49
|
getChoices() {
|
|
50
|
-
return this.data.
|
|
50
|
+
return this.data.final_result?.choices;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
//# sourceMappingURL=orchestration-stream-chunk-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream-chunk-response.js","sourceRoot":"","sources":["../src/orchestration-stream-chunk-response.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,OAAO,gCAAgC;IACf;IAA5B,YAA4B,IAAqC;QAArC,SAAI,GAAJ,IAAI,CAAiC;QAC/D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"orchestration-stream-chunk-response.js","sourceRoot":"","sources":["../src/orchestration-stream-chunk-response.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,OAAO,gCAAgC;IACf;IAA5B,YAA4B,IAAqC;QAArC,SAAI,GAAJ,IAAI,CAAiC;QAC/D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,WAAW,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,GAAG,CAAC;QAC/B,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IAC/D,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,WAAW,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAC5B,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAC7C,CAAC;IACJ,CAAC;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream-response.d.ts","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;GAEG;AACH,qBAAa,2BAA2B,CAAC,CAAC;IACjC,WAAW,UAAQ;IACnB,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAM;IACnD,OAAO,CAAC,OAAO,CAAqC;IAEpD;;;OAGG;IACI,aAAa,IAAI,UAAU,GAAG,SAAS;IAO9C;;;;OAIG;IACI,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAO3D;;;;;OAKG;IACI,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAQtD;;;;OAIG;IACI,YAAY,CAAC,WAAW,SAAI,GAAG,gBAAgB,GAAG,SAAS;IAQlE;;;;OAIG;IACI,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAQtD;;;;OAIG;IACI,cAAc,CAAC,WAAW,SAAI,GAAG,YAAY,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"orchestration-stream-response.d.ts","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;GAEG;AACH,qBAAa,2BAA2B,CAAC,CAAC;IACjC,WAAW,UAAQ;IACnB,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAM;IACnD,OAAO,CAAC,OAAO,CAAqC;IAEpD;;;OAGG;IACI,aAAa,IAAI,UAAU,GAAG,SAAS;IAO9C;;;;OAIG;IACI,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAO3D;;;;;OAKG;IACI,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAQtD;;;;OAIG;IACI,YAAY,CAAC,WAAW,SAAI,GAAG,gBAAgB,GAAG,SAAS;IAQlE;;;;OAIG;IACI,UAAU,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAQtD;;;;OAIG;IACI,cAAc,CAAC,WAAW,SAAI,GAAG,YAAY,GAAG,SAAS;IAUhE;;;;OAIG;IAEI,mBAAmB,CACxB,WAAW,SAAI,GACd,oBAAoB,GAAG,SAAS;IAO5B,WAAW,IAAI,sBAAsB,GAAG,SAAS;IAOxD,IAAI,MAAM,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAKnC;IAED,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,YAAY;IASpB;;OAEG;IACH,IAAI,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAExC;CACF"}
|
|
@@ -13,7 +13,7 @@ export class OrchestrationStreamResponse {
|
|
|
13
13
|
if (this.isStreamOpen()) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
return this._data.
|
|
16
|
+
return this._data.final_result?.usage;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Gets the finish reason for a specific choice index.
|
|
@@ -72,7 +72,7 @@ export class OrchestrationStreamResponse {
|
|
|
72
72
|
if (this.isStreamOpen()) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
const messages = this._data.
|
|
75
|
+
const messages = this._data.intermediate_results?.templating ?? [];
|
|
76
76
|
const content = this.findChoiceByIndex(choiceIndex)?.message;
|
|
77
77
|
return content ? [...messages, content] : messages;
|
|
78
78
|
}
|
|
@@ -100,7 +100,7 @@ export class OrchestrationStreamResponse {
|
|
|
100
100
|
return this._stream;
|
|
101
101
|
}
|
|
102
102
|
getChoices() {
|
|
103
|
-
return this._data.
|
|
103
|
+
return this._data.final_result?.choices ?? [];
|
|
104
104
|
}
|
|
105
105
|
findChoiceByIndex(index) {
|
|
106
106
|
return this.getChoices().find((c) => c.index === index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream-response.js","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAC/B,WAAW,GAAG,IAAI,CAAC;IACnB,KAAK,GAAoC,EAAE,CAAC;IAC3C,OAAO,CAAqC;IAEpD;;;OAGG;IACI,aAAa;QAClB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"orchestration-stream-response.js","sourceR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O,YAAY;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,KAAK,CACT,4GAA4G,CAC7G,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM,CAAC,MAA8B;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Xor } from '@sap-cloud-sdk/util';
|
|
2
2
|
import type { CustomRequestConfig } from '@sap-cloud-sdk/http-client';
|
|
3
3
|
import type { ChatModel } from './model-types.js';
|
|
4
|
-
import type { ChatMessages, DataRepositoryType, DocumentGroundingFilter, DpiConfig, DpiEntities,
|
|
4
|
+
import type { ChatMessages, DataRepositoryType, DocumentGroundingFilter, DpiConfig, DpiEntities, FilteringStreamOptions, LlamaGuard38B, LLMModelDetails as OriginalLLMModelDetails, Template, TemplateRef, TemplatingChatMessage, AzureContentSafetyOutput, AzureContentSafetyOutputFilterConfig, DPIStandardEntity, DPICustomEntity, InputFilteringConfig, OutputFilteringConfig, MaskingProviderConfig, SAPDocumentTranslation, GlobalStreamOptions, ErrorResponse } from './client/api/schema/index.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Chat completion request configuration.
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface ChatCompletionRequest {
|
|
9
9
|
/**
|
|
10
10
|
* Chat History.
|
|
11
11
|
*/
|
|
@@ -28,20 +28,126 @@ export interface Prompt {
|
|
|
28
28
|
/**
|
|
29
29
|
* Template parameters.
|
|
30
30
|
* @example
|
|
31
|
-
*
|
|
31
|
+
* placeholderValues: {
|
|
32
32
|
* product: 'SAP Cloud SDK'
|
|
33
33
|
* }
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
placeholderValues?: Record<string, string>;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* LLM
|
|
38
|
+
* LLM model details.
|
|
39
39
|
*/
|
|
40
|
-
export type
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
model_params?: LlmModelParams;
|
|
40
|
+
export type LlmModelDetails = Omit<OriginalLLMModelDetails, 'name' | 'params'> & {
|
|
41
|
+
name: ChatModel;
|
|
42
|
+
params?: LlmModelParams;
|
|
44
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Prompt templating module configuration.
|
|
46
|
+
*/
|
|
47
|
+
export interface PromptTemplatingModule {
|
|
48
|
+
/**
|
|
49
|
+
* The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Static prompts. Can be:
|
|
53
|
+
* - A `template`: an array of templated chat messages (with {{?placeholders}}).
|
|
54
|
+
* - An `id` or `scenario`, `name` and `version`: reference to a remote prompt template.
|
|
55
|
+
*
|
|
56
|
+
* This is meant for static instructions included with every call.
|
|
57
|
+
* For per-request templating, use `messages` in `.chatCompletion()` instead.
|
|
58
|
+
* @example
|
|
59
|
+
* prompt: {
|
|
60
|
+
* template: [
|
|
61
|
+
* {
|
|
62
|
+
* role: 'system',
|
|
63
|
+
* content: 'You are an assistant for {{?product}}.'
|
|
64
|
+
* }
|
|
65
|
+
* ]
|
|
66
|
+
* }
|
|
67
|
+
*/
|
|
68
|
+
prompt?: Xor<PromptTemplate, TemplateRef> | string;
|
|
69
|
+
/**
|
|
70
|
+
* LLM model details.
|
|
71
|
+
*/
|
|
72
|
+
model: LlmModelDetails;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Representation of the 'FilteringModuleConfig' schema.
|
|
76
|
+
*/
|
|
77
|
+
export interface FilteringModule {
|
|
78
|
+
/**
|
|
79
|
+
* List of provider type and filters.
|
|
80
|
+
*/
|
|
81
|
+
input?: InputFilteringConfig;
|
|
82
|
+
/**
|
|
83
|
+
* List of provider type and filters.
|
|
84
|
+
*/
|
|
85
|
+
output?: OutputFilteringConfig;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Representation of the 'MaskingModuleConfig' schema.
|
|
89
|
+
*/
|
|
90
|
+
export interface MaskingModule {
|
|
91
|
+
/**
|
|
92
|
+
* List of masking service providers
|
|
93
|
+
* Min Items: 1.
|
|
94
|
+
*/
|
|
95
|
+
masking_providers: MaskingProviderConfig[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Representation of the 'GroundingModuleConfig' schema.
|
|
99
|
+
*/
|
|
100
|
+
export interface GroundingModule {
|
|
101
|
+
/**
|
|
102
|
+
* @example "document_grounding_service"
|
|
103
|
+
*/
|
|
104
|
+
type: 'document_grounding_service' | any;
|
|
105
|
+
/**
|
|
106
|
+
* Grounding service configuration.
|
|
107
|
+
*/
|
|
108
|
+
config: {
|
|
109
|
+
/**
|
|
110
|
+
* Document grounding service filters to be used.
|
|
111
|
+
*/
|
|
112
|
+
filters?: DocumentGroundingFilter[];
|
|
113
|
+
/**
|
|
114
|
+
* Placeholders to be used for grounding input questions and output.
|
|
115
|
+
*/
|
|
116
|
+
placeholders: {
|
|
117
|
+
/**
|
|
118
|
+
* Contains the input parameters used for grounding input questions
|
|
119
|
+
* Min Items: 1.
|
|
120
|
+
*/
|
|
121
|
+
input: string[];
|
|
122
|
+
/**
|
|
123
|
+
* Placeholder name for grounding output.
|
|
124
|
+
* @example "groundingOutput"
|
|
125
|
+
*/
|
|
126
|
+
output: string;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Parameter name used for specifying metadata parameters.
|
|
130
|
+
*/
|
|
131
|
+
metadata_params?: string[];
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Configuration for translation module.
|
|
136
|
+
*/
|
|
137
|
+
export interface TranslationModule {
|
|
138
|
+
/**
|
|
139
|
+
* Configuration for input translation.
|
|
140
|
+
*/
|
|
141
|
+
input?: SAPDocumentTranslation;
|
|
142
|
+
/**
|
|
143
|
+
* Configuration for output translation.
|
|
144
|
+
*/
|
|
145
|
+
output?: SAPDocumentTranslation;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Orchestration error response.
|
|
149
|
+
*/
|
|
150
|
+
export type OrchestrationErrorResponse = ErrorResponse;
|
|
45
151
|
/**
|
|
46
152
|
* Model Parameters for LLM module configuration.
|
|
47
153
|
*/
|
|
@@ -56,9 +162,9 @@ export type LlmModelParams = {
|
|
|
56
162
|
/**
|
|
57
163
|
* Representation of the 'Template' schema.
|
|
58
164
|
*/
|
|
59
|
-
export type
|
|
165
|
+
export type PromptTemplate = Omit<Template, 'template'> & {
|
|
60
166
|
/**
|
|
61
|
-
* A chat message array to be formatted with values from `
|
|
167
|
+
* A chat message array to be formatted with values from `placeholderValues`.
|
|
62
168
|
* Both `role` and `content` can use {{?variable}} placeholders.
|
|
63
169
|
*
|
|
64
170
|
* For dynamic templating (changing per request), pass templated messages directly in `.chatCompletion({ messages })`.
|
|
@@ -75,37 +181,14 @@ export type Template = Omit<OriginalTemplate, 'template'> & {
|
|
|
75
181
|
*/
|
|
76
182
|
template?: TemplatingChatMessage;
|
|
77
183
|
};
|
|
78
|
-
/**
|
|
79
|
-
* Representation of the 'TemplatingModuleConfig' schema.
|
|
80
|
-
* The type can be either a `Template` or a `TemplateRef`.
|
|
81
|
-
*/
|
|
82
|
-
export type TemplatingModuleConfig = Xor<Template, TemplateRef>;
|
|
83
184
|
/**
|
|
84
185
|
* Orchestration module configuration.
|
|
85
186
|
*/
|
|
86
187
|
export interface OrchestrationModuleConfig {
|
|
87
188
|
/**
|
|
88
|
-
*
|
|
89
|
-
* - A `template`: an array of templated chat messages (with {{?placeholders}}).
|
|
90
|
-
* - An `id` or `scenario`, `name` and `version`: reference to a remote prompt template.
|
|
91
|
-
*
|
|
92
|
-
* This is meant for static instructions included with every call.
|
|
93
|
-
* For per-request templating, use `messages` in `.chatCompletion()` instead.
|
|
94
|
-
* @example
|
|
95
|
-
* templating: {
|
|
96
|
-
* template: [
|
|
97
|
-
* {
|
|
98
|
-
* role: 'system',
|
|
99
|
-
* content: 'You are an assistant for {{?product}}.'
|
|
100
|
-
* }
|
|
101
|
-
* ]
|
|
102
|
-
* }
|
|
189
|
+
* Prompt templating configuration.
|
|
103
190
|
*/
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* LLM module configuration.
|
|
107
|
-
*/
|
|
108
|
-
llm: LlmModuleConfig;
|
|
191
|
+
promptTemplating: PromptTemplatingModule;
|
|
109
192
|
/**
|
|
110
193
|
* Filtering module configuration for both input and output filters.
|
|
111
194
|
* To configure a filter, use convenience functions like `buildAzureContentSafetyFilter`, `buildLlamaGuardFilter`, etc..
|
|
@@ -118,27 +201,19 @@ export interface OrchestrationModuleConfig {
|
|
|
118
201
|
* }
|
|
119
202
|
* }
|
|
120
203
|
*/
|
|
121
|
-
filtering?:
|
|
204
|
+
filtering?: FilteringModule;
|
|
122
205
|
/**
|
|
123
206
|
* Masking module configuration.
|
|
124
207
|
*/
|
|
125
|
-
masking?:
|
|
208
|
+
masking?: MaskingModule;
|
|
126
209
|
/**
|
|
127
210
|
* Grounding module configuraton.
|
|
128
211
|
*/
|
|
129
|
-
grounding?:
|
|
212
|
+
grounding?: GroundingModule;
|
|
130
213
|
/**
|
|
131
|
-
*
|
|
214
|
+
* Translation module configuration.
|
|
132
215
|
*/
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Input translation module configuration.
|
|
136
|
-
*/
|
|
137
|
-
inputTranslation?: InputTranslationModuleConfig;
|
|
138
|
-
/**
|
|
139
|
-
* Output translation module configuration.
|
|
140
|
-
*/
|
|
141
|
-
outputTranslation?: OutputTranslationModuleConfig;
|
|
216
|
+
translation?: TranslationModule;
|
|
142
217
|
}
|
|
143
218
|
/**
|
|
144
219
|
* Request options for orchestration.
|
|
@@ -147,7 +222,7 @@ export interface RequestOptions {
|
|
|
147
222
|
/**
|
|
148
223
|
* Prompt configuration.
|
|
149
224
|
*/
|
|
150
|
-
|
|
225
|
+
request?: ChatCompletionRequest;
|
|
151
226
|
/**
|
|
152
227
|
* Custom request configuration.
|
|
153
228
|
*/
|
|
@@ -168,7 +243,7 @@ export interface StreamOptions {
|
|
|
168
243
|
/**
|
|
169
244
|
* LLM specific stream options.
|
|
170
245
|
*/
|
|
171
|
-
|
|
246
|
+
promptTemplating?: {
|
|
172
247
|
include_usage?: boolean;
|
|
173
248
|
[key: string]: any;
|
|
174
249
|
} | null;
|
|
@@ -196,18 +271,24 @@ export type DocumentGroundingServiceFilter = Omit<DocumentGroundingFilter, 'data
|
|
|
196
271
|
*/
|
|
197
272
|
export interface DocumentGroundingServiceConfig {
|
|
198
273
|
/**
|
|
199
|
-
*
|
|
274
|
+
* Document grounding service filters to be used.
|
|
200
275
|
*/
|
|
201
276
|
filters?: DocumentGroundingServiceFilter[];
|
|
202
277
|
/**
|
|
203
|
-
*
|
|
204
|
-
*/
|
|
205
|
-
input_params: string[];
|
|
206
|
-
/**
|
|
207
|
-
* Parameter name used for grounding output.
|
|
208
|
-
* @example "groundingOutput"
|
|
278
|
+
* Placeholders to be used for grounding input questions and output.
|
|
209
279
|
*/
|
|
210
|
-
|
|
280
|
+
placeholders: {
|
|
281
|
+
/**
|
|
282
|
+
* Contains the input parameters used for grounding input questions
|
|
283
|
+
* Min Items: 1.
|
|
284
|
+
*/
|
|
285
|
+
input: string[];
|
|
286
|
+
/**
|
|
287
|
+
* Placeholder name for grounding output.
|
|
288
|
+
* @example "groundingOutput"
|
|
289
|
+
*/
|
|
290
|
+
output: string;
|
|
291
|
+
};
|
|
211
292
|
/**
|
|
212
293
|
* Parameter name used for specifying metadata parameters.
|
|
213
294
|
*/
|
|
@@ -215,9 +296,8 @@ export interface DocumentGroundingServiceConfig {
|
|
|
215
296
|
}
|
|
216
297
|
/**
|
|
217
298
|
* Defines the type of the DPI masking entity.
|
|
218
|
-
* @internal
|
|
219
299
|
*/
|
|
220
|
-
|
|
300
|
+
type DpiEntity = DpiEntities | DPIStandardEntity | (DPICustomEntity & {
|
|
221
301
|
type: 'custom';
|
|
222
302
|
});
|
|
223
303
|
/**
|
|
@@ -234,19 +314,19 @@ export interface AzureContentFilter {
|
|
|
234
314
|
/**
|
|
235
315
|
* The filter category for hate content.
|
|
236
316
|
*/
|
|
237
|
-
|
|
317
|
+
hate?: AzureFilterThreshold;
|
|
238
318
|
/**
|
|
239
319
|
* The filter category for self-harm content.
|
|
240
320
|
*/
|
|
241
|
-
|
|
321
|
+
self_harm?: AzureFilterThreshold;
|
|
242
322
|
/**
|
|
243
323
|
* The filter category for sexual content.
|
|
244
324
|
*/
|
|
245
|
-
|
|
325
|
+
sexual?: AzureFilterThreshold;
|
|
246
326
|
/**
|
|
247
327
|
* The filter category for violence content.
|
|
248
328
|
*/
|
|
249
|
-
|
|
329
|
+
violence?: AzureFilterThreshold;
|
|
250
330
|
}
|
|
251
331
|
/**
|
|
252
332
|
* A descriptive constant for Azure content safety filter threshold.
|
|
@@ -260,7 +340,6 @@ export declare const supportedAzureFilterThresholds: {
|
|
|
260
340
|
};
|
|
261
341
|
/**
|
|
262
342
|
* The Azure threshold level supported for each azure content filter category.
|
|
263
|
-
*
|
|
264
343
|
*/
|
|
265
344
|
export type AzureFilterThreshold = keyof typeof supportedAzureFilterThresholds;
|
|
266
345
|
/**
|
|
@@ -291,4 +370,5 @@ export type AzureContentSafety = AzureContentSafetyOutput;
|
|
|
291
370
|
* Representation of the Azure Content Safety filter config schema.
|
|
292
371
|
*/
|
|
293
372
|
export type AzureContentSafetyFilterConfig = AzureContentSafetyOutputFilterConfig;
|
|
373
|
+
export {};
|
|
294
374
|
//# sourceMappingURL=orchestration-types.d.ts.map
|