@sap-ai-sdk/orchestration 2.18.0 → 2.18.1-20261111011042.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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/orchestration-client.d.ts +2 -2
- package/dist/orchestration-client.js +2 -2
- package/dist/orchestration-types.d.ts +20 -1
- package/dist/orchestration-types.d.ts.map +1 -1
- package/dist/orchestration-types.js.map +1 -1
- package/dist/util/completion-prompt-util.d.ts +44 -0
- package/dist/util/completion-prompt-util.d.ts.map +1 -0
- package/dist/util/completion-prompt-util.js +116 -0
- package/dist/util/completion-prompt-util.js.map +1 -0
- package/dist/util/completion-request-builder.d.ts +17 -0
- package/dist/util/completion-request-builder.d.ts.map +1 -0
- package/dist/util/completion-request-builder.js +166 -0
- package/dist/util/completion-request-builder.js.map +1 -0
- package/dist/util/completion-stream-options.d.ts +29 -0
- package/dist/util/completion-stream-options.d.ts.map +1 -0
- package/dist/util/{module-config.js → completion-stream-options.js} +11 -175
- package/dist/util/completion-stream-options.js.map +1 -0
- package/dist/util/embedding-request-builder.d.ts +8 -0
- package/dist/util/embedding-request-builder.d.ts.map +1 -0
- package/dist/util/embedding-request-builder.js +35 -0
- package/dist/util/embedding-request-builder.js.map +1 -0
- package/dist/util/index.d.ts +4 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -1
- package/dist/util/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/util/module-config.d.ts +0 -34
- package/dist/util/module-config.d.ts.map +0 -1
- package/dist/util/module-config.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ export { buildAzureContentSafetyFilter, buildLlamaGuard38BFilter, buildGraniteGu
|
|
|
14
14
|
* In case of breaking changes, create wrappers in `orchestration-types.ts`.
|
|
15
15
|
* Explicitly export the wrapper also in `internal.ts`.
|
|
16
16
|
*/
|
|
17
|
-
export type { ChatMessage, ChatMessages, ChatMessageContent, SystemChatMessage, UserChatMessage, UserChatMessageContent, UserChatMessageContentItem, ImageContentUrl, FileContent, AssistantChatMessage, ToolChatMessage, DeveloperChatMessage, ChatCompletionTool, FunctionObject, Error as OrchestrationError, Citation, ReasoningBlock } from './client/api/schema/index.ts';
|
|
17
|
+
export type { ChatMessage, ChatMessages, ChatMessageContent, SystemChatMessage, UserChatMessage, UserChatMessageContent, UserChatMessageContentItem, ImageContentUrl, FileContent, AssistantChatMessage, ToolChatMessage, DeveloperChatMessage, ChatCompletionTool, FunctionObject, Error as OrchestrationError, Citation, ReasoningBlock, TemplateRef } from './client/api/schema/index.ts';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,8BAA8B,EAC9B,8BAA8B,EAC9B,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,iCAAiC,EACjC,8BAA8B,EAC9B,oBAAoB,EACpB,uCAAuC,EACvC,wCAAwC,EACxC,kCAAkC,EAClC,kCAAkC,EAClC,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,kCAAkC,EAClC,0BAA0B,EAC1B,yBAAyB,EACzB,gBA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,EACvB,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,KAAK,IAAI,kBAAkB,EAC3B,QAAQ,EACR,cAAc,EACd,WAAW,EACZ,MAAM,8BAA8B,CAAC"}
|
|
@@ -55,7 +55,7 @@ export declare class OrchestrationClient {
|
|
|
55
55
|
constructor(config: string | Xor<OrchestrationConfigRefById, Xor<OrchestrationConfigRefByName, OrchestrationModuleConfig>> | OrchestrationModuleConfigList, deploymentConfig?: ResourceGroupConfig | DeploymentIdConfig, destination?: HttpDestinationOrFetchOptions);
|
|
56
56
|
/**
|
|
57
57
|
* Send a chat completion request to the orchestration service.
|
|
58
|
-
* @param request - Request containing
|
|
58
|
+
* @param request - Request containing the prompt, placeholder values, and message history.
|
|
59
59
|
* @param requestConfig - Additional request configuration. Use `requestConfig.headers` to pass service-specific headers:
|
|
60
60
|
* - `AI-Object-Store-Secret-Name`: Name of the object store secret used by the feedback service.
|
|
61
61
|
* @returns The orchestration service response.
|
|
@@ -65,7 +65,7 @@ export declare class OrchestrationClient {
|
|
|
65
65
|
}): Promise<OrchestrationResponse>;
|
|
66
66
|
/**
|
|
67
67
|
* Create a streaming chat completion request to the orchestration service.
|
|
68
|
-
* @param request - Request containing
|
|
68
|
+
* @param request - Request containing the prompt, placeholder values, and message history.
|
|
69
69
|
* @param signal - An abort signal to cancel the request.
|
|
70
70
|
* @param options - Streaming options, e.g., for input/output filtering.
|
|
71
71
|
* @param requestConfig - Additional request configuration. Use `requestConfig.headers` to pass service-specific headers:
|
|
@@ -41,7 +41,7 @@ export class OrchestrationClient {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Send a chat completion request to the orchestration service.
|
|
44
|
-
* @param request - Request containing
|
|
44
|
+
* @param request - Request containing the prompt, placeholder values, and message history.
|
|
45
45
|
* @param requestConfig - Additional request configuration. Use `requestConfig.headers` to pass service-specific headers:
|
|
46
46
|
* - `AI-Object-Store-Secret-Name`: Name of the object store secret used by the feedback service.
|
|
47
47
|
* @returns The orchestration service response.
|
|
@@ -60,7 +60,7 @@ export class OrchestrationClient {
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Create a streaming chat completion request to the orchestration service.
|
|
63
|
-
* @param request - Request containing
|
|
63
|
+
* @param request - Request containing the prompt, placeholder values, and message history.
|
|
64
64
|
* @param signal - An abort signal to cancel the request.
|
|
65
65
|
* @param options - Streaming options, e.g., for input/output filtering.
|
|
66
66
|
* @param requestConfig - Additional request configuration. Use `requestConfig.headers` to pass service-specific headers:
|
|
@@ -4,7 +4,6 @@ import type { ChatMessages, DataRepositoryType, DocumentGroundingFilter, DpiConf
|
|
|
4
4
|
import type { ChatModel, EmbeddingModel } from './model-types.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Per-request inputs for a chat completion call.
|
|
7
|
-
* Only `messages`, `messagesHistory`, and `placeholderValues` are accepted here.
|
|
8
7
|
* Model parameters (`temperature`, `max_tokens`, etc.), `tools`, and `response_format`
|
|
9
8
|
* must be configured in the {@link OrchestrationModuleConfig} passed to the constructor.
|
|
10
9
|
*/
|
|
@@ -13,8 +12,27 @@ export interface ChatCompletionRequest {
|
|
|
13
12
|
* Chat History.
|
|
14
13
|
*/
|
|
15
14
|
messagesHistory?: ChatMessages;
|
|
15
|
+
/**
|
|
16
|
+
* The prompt template or reference to use for this call. Can be either a user defined template or a reference to a template in the prompt registry.
|
|
17
|
+
* It cannot be combined with a constructor prompt or with the deprecated `messages` field, and a {@link TemplateRef} cannot be combined with a local prompt or prompt template.
|
|
18
|
+
* @example
|
|
19
|
+
* prompt: {
|
|
20
|
+
* template: [
|
|
21
|
+
* {
|
|
22
|
+
* role: 'system',
|
|
23
|
+
* content: 'You are a helpful assistant answering questions about {{?product}}.'
|
|
24
|
+
* },
|
|
25
|
+
* {
|
|
26
|
+
* role: 'user',
|
|
27
|
+
* content: 'Can you give me an overview of its key benefits?'
|
|
28
|
+
* }
|
|
29
|
+
* ]
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
prompt?: Xor<PromptTemplate, TemplateRef>;
|
|
16
33
|
/**
|
|
17
34
|
* New chat messages, including template messages.
|
|
35
|
+
* @deprecated Since v2.18.0. Pass the current turn via the request-level `prompt` field instead. Use {@link ChatCompletionRequest.prompt} instead.
|
|
18
36
|
* @example
|
|
19
37
|
* messages: [
|
|
20
38
|
* {
|
|
@@ -66,6 +84,7 @@ export interface PromptTemplatingModule {
|
|
|
66
84
|
*
|
|
67
85
|
* This is meant for static instructions included with every call.
|
|
68
86
|
* For per-request templating, use `messages` in `.chatCompletion()` instead.
|
|
87
|
+
* @deprecated Since v2.18.0. Supply the prompt per call via the request-level `prompt` field instead. Use {@link ChatCompletionRequest.prompt} instead.
|
|
69
88
|
* @example
|
|
70
89
|
* prompt: {
|
|
71
90
|
* template: [
|
|
@@ -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,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,eAAe,IAAI,uBAAuB,EAC1C,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,mCAAmC,EACnC,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,IAAI,8BAA8B,EACxD,qBAAqB,IAAI,6BAA6B,EACtD,2BAA2B,EAC3B,4BAA4B,EAC5B,SAAS,EACT,oBAAoB,EACpB,cAAc,EACd,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE
|
|
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,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,eAAe,IAAI,uBAAuB,EAC1C,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,mCAAmC,EACnC,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,IAAI,8BAA8B,EACxD,qBAAqB,IAAI,6BAA6B,EACtD,2BAA2B,EAC3B,4BAA4B,EAC5B,SAAS,EACT,oBAAoB,EACpB,cAAc,EACd,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAE1C;;;;;;;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,EAAE,cAAc,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,6BAA6B,EAC7B,iBAAiB,CAClB,GAAG;IACF,eAAe,CAAC,EAAE,cAAc,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,UAAU,EAAE,oBAAoB,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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":"AAuWA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAKgC;IAEhC,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACtB,CAAC,IAAI,IAAI,MAAM;YACb,CAAC,UAAU,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,CAAC,CACrE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qCAAqC,CACnD,MAKgC;IAEhC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,qDAAqD,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAAC,wCAAwC,CAAC,CAAC;IACjE,CAAC;IAED,mEAAmE;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAC3B,IAAI,CAAC,EAAE,CACL,IAAI;QACJ,OAAO,IAAI,KAAK,QAAQ;QACxB,kBAAkB,IAAI,IAAI;QAC1B,IAAI,CAAC,gBAAgB;QACrB,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,CAC5C,CAAC;IAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,SAAS,CACjB,0GAA0G,CAC3G,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAKgC;IAEhC,IAAI,CAAC;QACH,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAuPD;;;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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ModuleConfigs, Template, TemplateRef } from '../client/api/schema/index.ts';
|
|
2
|
+
import type { ChatCompletionRequest, OrchestrationModuleConfig } from '../orchestration-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Builds the error message for rejecting a request-level prompt on an entry
|
|
6
|
+
* point that structurally cannot carry one.
|
|
7
|
+
* @param context - The rejecting entry point, e.g. `'a config reference'`.
|
|
8
|
+
* @param hint - What the caller should use instead.
|
|
9
|
+
* @returns The error message.
|
|
10
|
+
*/
|
|
11
|
+
export declare function rejectRequestPromptMessage(context: string, hint: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* Throws if any module configuration already carries a prompt, which conflicts
|
|
15
|
+
* with a request-level prompt. A prompt counts as present when it is a non-null
|
|
16
|
+
* object (a template or template reference) or a non-empty string. Works for
|
|
17
|
+
* both typed (camelCase) and JSON (snake_case) configs: the caller extracts the
|
|
18
|
+
* prompt from each config in its own casing.
|
|
19
|
+
* @param prompts - The prompt extracted from each module configuration.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertConfigHasNoPrompt(prompts: unknown[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* Validates a request-level prompt's shape, independent of the config type. The
|
|
25
|
+
* prompt is mutually exclusive with the deprecated `messages` field, must
|
|
26
|
+
* already be parsed, and must contain at least one message.
|
|
27
|
+
* @param request - The request carrying the request-level prompt.
|
|
28
|
+
* @returns The validated template or template reference.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateRequestPromptShape(request: ChatCompletionRequest): Template | TemplateRef;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
* Builds a single module configuration with an already-resolved request-level prompt.
|
|
34
|
+
* @param config - The module configuration to build from.
|
|
35
|
+
* @param prompt - The resolved template or template reference, or undefined to
|
|
36
|
+
* omit the prompt entirely (history-only request).
|
|
37
|
+
* @returns The module configuration with the prompt applied.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildModuleConfigs(config: OrchestrationModuleConfig, prompt?: Template | TemplateRef): ModuleConfigs;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare function buildLegacyModuleConfigs(config: OrchestrationModuleConfig, request?: ChatCompletionRequest): ModuleConfigs;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare function isTemplateRef<T>(template: T): template is Extract<T, TemplateRef>;
|
|
44
|
+
//# sourceMappingURL=completion-prompt-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-prompt-util.d.ts","sourceRoot":"","sources":["../../src/util/completion-prompt-util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAOhE;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,qBAAqB,GAC7B,QAAQ,GAAG,WAAW,CAuBxB;AA4CD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,GAC9B,aAAa,CAmBf;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAKf;AAQD,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAC7B,QAAQ,EAAE,CAAC,GACV,QAAQ,IAAI,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAIrC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Builds the error message for rejecting a request-level prompt on an entry
|
|
4
|
+
* point that structurally cannot carry one.
|
|
5
|
+
* @param context - The rejecting entry point, e.g. `'a config reference'`.
|
|
6
|
+
* @param hint - What the caller should use instead.
|
|
7
|
+
* @returns The error message.
|
|
8
|
+
*/
|
|
9
|
+
export function rejectRequestPromptMessage(context, hint) {
|
|
10
|
+
return `Cannot set 'prompt' in the request when using ${context}. ${hint}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* Throws if any module configuration already carries a prompt, which conflicts
|
|
15
|
+
* with a request-level prompt. A prompt counts as present when it is a non-null
|
|
16
|
+
* object (a template or template reference) or a non-empty string. Works for
|
|
17
|
+
* both typed (camelCase) and JSON (snake_case) configs: the caller extracts the
|
|
18
|
+
* prompt from each config in its own casing.
|
|
19
|
+
* @param prompts - The prompt extracted from each module configuration.
|
|
20
|
+
*/
|
|
21
|
+
export function assertConfigHasNoPrompt(prompts) {
|
|
22
|
+
const hasPrompt = prompts.some(prompt => prompt);
|
|
23
|
+
if (hasPrompt) {
|
|
24
|
+
throw new Error("Cannot set 'prompt' in the request when the config already defines a prompt. Remove the prompt from the config, or omit the request-level prompt.");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* Validates a request-level prompt's shape, independent of the config type. The
|
|
30
|
+
* prompt is mutually exclusive with the deprecated `messages` field, must
|
|
31
|
+
* already be parsed, and must contain at least one message.
|
|
32
|
+
* @param request - The request carrying the request-level prompt.
|
|
33
|
+
* @returns The validated template or template reference.
|
|
34
|
+
*/
|
|
35
|
+
export function validateRequestPromptShape(request) {
|
|
36
|
+
if (request.messages?.length) {
|
|
37
|
+
throw new Error("Cannot set both 'prompt' and 'messages' in the request. Use the request-level 'prompt' field for the current turn.");
|
|
38
|
+
}
|
|
39
|
+
const { prompt } = request;
|
|
40
|
+
if (typeof prompt === 'string') {
|
|
41
|
+
throw new TypeError('Request-level prompt must be parsed before use.');
|
|
42
|
+
}
|
|
43
|
+
if (isTemplateRef(prompt)) {
|
|
44
|
+
return prompt;
|
|
45
|
+
}
|
|
46
|
+
if (!isTemplate(prompt) || !prompt.template?.length) {
|
|
47
|
+
throw new Error('The request-level prompt template must contain at least one message.');
|
|
48
|
+
}
|
|
49
|
+
return prompt;
|
|
50
|
+
}
|
|
51
|
+
function mergePromptWithMessages(promptTemplating, request) {
|
|
52
|
+
// Legacy path only: the request-level prompt routes to buildRequestPromptCompletion.
|
|
53
|
+
const messages = request?.messages;
|
|
54
|
+
if (typeof promptTemplating.prompt === 'string') {
|
|
55
|
+
throw new TypeError('Prompt must be parsed before merging with messages.');
|
|
56
|
+
}
|
|
57
|
+
const prompt = promptTemplating.prompt;
|
|
58
|
+
// With no configured prompt, the current turn comes from `messages`; failing
|
|
59
|
+
// that, a non-empty history is sent on its own with no prompt template.
|
|
60
|
+
if (!prompt) {
|
|
61
|
+
if (messages?.length) {
|
|
62
|
+
return { template: messages };
|
|
63
|
+
}
|
|
64
|
+
if (request?.messagesHistory?.length) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
throw new Error('Either a prompt template, messages, or messagesHistory must be defined.');
|
|
68
|
+
}
|
|
69
|
+
if (isTemplate(prompt)) {
|
|
70
|
+
if (!prompt.template?.length && !messages?.length) {
|
|
71
|
+
throw new Error('A configured prompt template must contain at least one message.');
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
...prompt,
|
|
75
|
+
template: [...(prompt.template || []), ...(messages || [])]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return prompt;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* Builds a single module configuration with an already-resolved request-level prompt.
|
|
83
|
+
* @param config - The module configuration to build from.
|
|
84
|
+
* @param prompt - The resolved template or template reference, or undefined to
|
|
85
|
+
* omit the prompt entirely (history-only request).
|
|
86
|
+
* @returns The module configuration with the prompt applied.
|
|
87
|
+
*/
|
|
88
|
+
export function buildModuleConfigs(config, prompt) {
|
|
89
|
+
const { promptTemplating, filtering, masking, grounding, translation } = config;
|
|
90
|
+
// Drop the constructor-level prompt
|
|
91
|
+
// legacy: the resolved `prompt` already incorporates it
|
|
92
|
+
// new approach: it is always empty anyways
|
|
93
|
+
const { prompt: _configuredPrompt, ...promptTemplatingWithoutPrompt } = promptTemplating;
|
|
94
|
+
return {
|
|
95
|
+
prompt_templating: {
|
|
96
|
+
...promptTemplatingWithoutPrompt,
|
|
97
|
+
...(prompt !== undefined && { prompt })
|
|
98
|
+
},
|
|
99
|
+
...(filtering && Object.keys(filtering).length && { filtering }),
|
|
100
|
+
...(masking && Object.keys(masking).length && { masking }),
|
|
101
|
+
...(grounding && Object.keys(grounding).length && { grounding }),
|
|
102
|
+
...(translation && Object.keys(translation).length && { translation })
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** @internal */
|
|
106
|
+
export function buildLegacyModuleConfigs(config, request) {
|
|
107
|
+
return buildModuleConfigs(config, mergePromptWithMessages(config.promptTemplating, request));
|
|
108
|
+
}
|
|
109
|
+
function isTemplate(template) {
|
|
110
|
+
return (!!template && typeof template === 'object' && !('template_ref' in template));
|
|
111
|
+
}
|
|
112
|
+
/** @internal */
|
|
113
|
+
export function isTemplateRef(template) {
|
|
114
|
+
return (!!template && typeof template === 'object' && 'template_ref' in template);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=completion-prompt-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-prompt-util.js","sourceRoot":"","sources":["../../src/util/completion-prompt-util.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAe,EACf,IAAY;IAEZ,OAAO,iDAAiD,OAAO,KAAK,IAAI,EAAE,CAAC;AAC7E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAkB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,mJAAmJ,CACpJ,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;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I,EAAE,WAAW,EAAE,CAAC;KACvE,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,wBAAwB,CACtC,MAAiC,EACjC,OAA+B;IAE/B,OAAO,kBAAkB,CACvB,MAAM,EACN,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,QAAiB;IACnC,OAAO,CACL,CAAC,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,cAAc,IAAI,QAAQ,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAC3B,QAAW;IAEX,OAAO,CACL,CAAC,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,cAAc,IAAI,QAAQ,CACzE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ChatCompletionRequest, type StreamOptions, type BaseStreamOptions, type OrchestrationConfigRefById, type OrchestrationConfigRefByName, type OrchestrationModuleConfig, type OrchestrationModuleConfigList } from '../orchestration-types.ts';
|
|
2
|
+
import type { CompletionPostRequest, CompletionRequestConfigurationReferenceById, CompletionRequestConfigurationReferenceByNameScenarioVersion } from '../client/api/schema/index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function constructCompletionPostRequestFromJsonModuleConfig(config: Record<string, any>, request?: ChatCompletionRequest, stream?: boolean): Record<string, any>;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function constructCompletionPostRequestFromConfigReference(configRef: OrchestrationConfigRefById | OrchestrationConfigRefByName, request?: ChatCompletionRequest, stream?: boolean): CompletionRequestConfigurationReferenceById | CompletionRequestConfigurationReferenceByNameScenarioVersion;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function constructCompletionPostRequest(config: OrchestrationModuleConfig, request?: ChatCompletionRequest, stream?: boolean, streamOptions?: BaseStreamOptions): CompletionPostRequest;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare function constructCompletionPostRequest(config: OrchestrationModuleConfigList, request?: ChatCompletionRequest, stream?: boolean, streamOptions?: StreamOptions): CompletionPostRequest;
|
|
17
|
+
//# sourceMappingURL=completion-request-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-request-builder.d.ts","sourceRoot":"","sources":["../../src/util/completion-request-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAWnC,OAAO,KAAK,EACV,qBAAqB,EACrB,2CAA2C,EAC3C,4DAA4D,EAE7D,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,wBAAgB,kDAAkD,CAChE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA4CrB;AA8BD;;GAEG;AACH,wBAAgB,iDAAiD,CAC/D,SAAS,EAAE,0BAA0B,GAAG,4BAA4B,EACpE,OAAO,CAAC,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,OAAO,GAEd,2CAA2C,GAC3C,4DAA4D,CAwC/D;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,iBAAiB,GAChC,qBAAqB,CAAC;AAEzB,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,aAAa,GAC5B,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {} from '../orchestration-types.js';
|
|
2
|
+
import { assertConfigHasNoPrompt, buildLegacyModuleConfigs, buildModuleConfigs, isTemplateRef, rejectRequestPromptMessage, validateRequestPromptShape } from './completion-prompt-util.js';
|
|
3
|
+
import { addStreamIfEnabled } from './completion-stream-options.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function constructCompletionPostRequestFromJsonModuleConfig(config, request, stream) {
|
|
8
|
+
let { modules } = config;
|
|
9
|
+
const isModulesArray = Array.isArray(modules);
|
|
10
|
+
const moduleList = isModulesArray
|
|
11
|
+
? modules
|
|
12
|
+
: [modules];
|
|
13
|
+
validateJsonModuleConfigShape(moduleList);
|
|
14
|
+
if (request?.prompt) {
|
|
15
|
+
assertConfigHasNoPrompt(moduleList.map(mod => mod?.prompt_templating?.prompt));
|
|
16
|
+
const prompt = validateRequestPromptShape(request);
|
|
17
|
+
const modulesWithPrompt = moduleList.map(mod => ({
|
|
18
|
+
...mod,
|
|
19
|
+
prompt_templating: {
|
|
20
|
+
...mod.prompt_templating,
|
|
21
|
+
prompt
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
modules = isModulesArray ? modulesWithPrompt : modulesWithPrompt[0];
|
|
25
|
+
}
|
|
26
|
+
if (stream) {
|
|
27
|
+
config = {
|
|
28
|
+
...config,
|
|
29
|
+
modules,
|
|
30
|
+
stream: {
|
|
31
|
+
...config.stream,
|
|
32
|
+
enabled: true
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
config = { ...config, modules };
|
|
38
|
+
delete config.stream;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
messages_history: request?.messagesHistory || [],
|
|
42
|
+
placeholder_values: request?.placeholderValues || {},
|
|
43
|
+
config
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validates the structural shape of a parsed JSON orchestration module config.
|
|
48
|
+
* Checks only what the request builder relies on: every module is an object
|
|
49
|
+
* carrying a `prompt_templating` object. It does not verify the config is
|
|
50
|
+
* complete.
|
|
51
|
+
* @param moduleList - The parsed module configurations to validate.
|
|
52
|
+
*/
|
|
53
|
+
function validateJsonModuleConfigShape(moduleList) {
|
|
54
|
+
moduleList.forEach(mod => {
|
|
55
|
+
if (!mod || typeof mod !== 'object' || Array.isArray(mod)) {
|
|
56
|
+
throw new Error("Invalid JSON config: 'modules' must be an object or array.");
|
|
57
|
+
}
|
|
58
|
+
if (!mod.prompt_templating ||
|
|
59
|
+
typeof mod.prompt_templating !== 'object' ||
|
|
60
|
+
Array.isArray(mod.prompt_templating)) {
|
|
61
|
+
throw new Error("Invalid JSON config: each module's 'prompt_templating' must be an object.");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export function constructCompletionPostRequestFromConfigReference(configRef, request, stream) {
|
|
69
|
+
// Config references are single-turn by nature: the stored artifact defines the
|
|
70
|
+
// full template and cannot be extended with a request-level prompt (see ADR 012).
|
|
71
|
+
if (request?.prompt) {
|
|
72
|
+
throw new Error(rejectRequestPromptMessage('a config reference', "A config reference is single-turn and defines the template server-side. Use 'messagesHistory' for prior turns instead."));
|
|
73
|
+
}
|
|
74
|
+
// Route request.messages into messages_history since there is no local
|
|
75
|
+
// prompt.template to merge them into for config references.
|
|
76
|
+
const messagesHistory = [
|
|
77
|
+
...(request?.messagesHistory || []),
|
|
78
|
+
...(request?.messages || [])
|
|
79
|
+
];
|
|
80
|
+
const { overrideConfig, ...configReference } = configRef;
|
|
81
|
+
const partialConfig = {
|
|
82
|
+
...overrideConfig,
|
|
83
|
+
stream: {
|
|
84
|
+
...overrideConfig?.stream,
|
|
85
|
+
enabled: stream === true
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
config_ref: configReference,
|
|
90
|
+
config: partialConfig,
|
|
91
|
+
...(request?.placeholderValues && {
|
|
92
|
+
placeholder_values: request.placeholderValues
|
|
93
|
+
}),
|
|
94
|
+
...(messagesHistory.length && {
|
|
95
|
+
messages_history: messagesHistory
|
|
96
|
+
})
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** @internal */
|
|
100
|
+
export function constructCompletionPostRequest(config, request, stream, streamOptions) {
|
|
101
|
+
return request?.prompt
|
|
102
|
+
? buildRequestPromptCompletion(config, request, stream, streamOptions)
|
|
103
|
+
: buildLegacyMessagesCompletion(config, request, stream, streamOptions);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Builds the request from a request-level `prompt`, the current direction for
|
|
107
|
+
* supplying the turn's template or template reference per call.
|
|
108
|
+
* The deprecated `messages` field and constructor prompt are not supported here;
|
|
109
|
+
* they belong to {@link buildLegacyMessagesCompletion} and are rejected up front.
|
|
110
|
+
* @param config - Single or array of module configurations.
|
|
111
|
+
* @param request - The request carrying the request-level prompt.
|
|
112
|
+
* @param stream - Whether to enable streaming.
|
|
113
|
+
* @param streamOptions - Stream options with optional per-config overrides.
|
|
114
|
+
* @returns The completion post request.
|
|
115
|
+
*/
|
|
116
|
+
function buildRequestPromptCompletion(config, request, stream, streamOptions) {
|
|
117
|
+
const configs = Array.isArray(config) ? config : [config];
|
|
118
|
+
assertConfigHasNoPrompt(configs.map(c => c?.promptTemplating?.prompt));
|
|
119
|
+
const prompt = validateRequestPromptShape(request);
|
|
120
|
+
const moduleConfigurations = configs.map(c => buildModuleConfigs(c, prompt));
|
|
121
|
+
const configWithStream = addStreamIfEnabled(Array.isArray(config) ? moduleConfigurations : moduleConfigurations[0], stream, streamOptions);
|
|
122
|
+
return {
|
|
123
|
+
config: configWithStream,
|
|
124
|
+
...(request.placeholderValues && {
|
|
125
|
+
placeholder_values: request.placeholderValues
|
|
126
|
+
}),
|
|
127
|
+
...(request.messagesHistory && {
|
|
128
|
+
messages_history: request.messagesHistory
|
|
129
|
+
})
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated Builds the request from the deprecated `messages` field and the
|
|
134
|
+
* constructor prompt. Delete this path once `messages` is removed; the request
|
|
135
|
+
* is then built solely by {@link buildRequestPromptCompletion}.
|
|
136
|
+
* @param config - Single or array of module configurations.
|
|
137
|
+
* @param request - The request carrying the deprecated `messages` field.
|
|
138
|
+
* @param stream - Whether to enable streaming.
|
|
139
|
+
* @param streamOptions - Stream options with optional per-config overrides.
|
|
140
|
+
* @returns The completion post request.
|
|
141
|
+
*/
|
|
142
|
+
function buildLegacyMessagesCompletion(config, request, stream, streamOptions) {
|
|
143
|
+
const configs = Array.isArray(config) ? config : [config];
|
|
144
|
+
// When a TemplateRef is in the constructor, messages cannot be merged into
|
|
145
|
+
// prompt.template (the template lives remotely). Route them to history instead.
|
|
146
|
+
const routeMessagesToHistory = configs.some(c => isTemplateRef(c?.promptTemplating?.prompt || {}));
|
|
147
|
+
const moduleRequest = routeMessagesToHistory && request
|
|
148
|
+
? { ...request, messages: undefined }
|
|
149
|
+
: request;
|
|
150
|
+
const moduleConfigurations = configs.map(c => buildLegacyModuleConfigs(c, moduleRequest));
|
|
151
|
+
const configWithStream = addStreamIfEnabled(Array.isArray(config) ? moduleConfigurations : moduleConfigurations[0], stream, streamOptions);
|
|
152
|
+
// When routing messages to history, append request.messages after messagesHistory
|
|
153
|
+
const messagesHistory = routeMessagesToHistory && request?.messages?.length
|
|
154
|
+
? [...(request.messagesHistory || []), ...request.messages]
|
|
155
|
+
: request?.messagesHistory;
|
|
156
|
+
return {
|
|
157
|
+
config: configWithStream,
|
|
158
|
+
...(request?.placeholderValues && {
|
|
159
|
+
placeholder_values: request.placeholderValues
|
|
160
|
+
}),
|
|
161
|
+
...(messagesHistory && {
|
|
162
|
+
messages_history: messagesHistory
|
|
163
|
+
})
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=completion-request-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-request-builder.js","sourceRoot":"","sources":["../../src/util/completion-request-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASpE;;GAEG;AACH,MAAM,UAAU,kDAAkD,CAChE,MAA2B,EAC3B,OAA+B,EAC/B,MAAgB;IAEhB,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACzB,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C,MAAM,UAAU,GAA0B,cAAc;QACtD,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAEd,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAE1C,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,uBAAuB,CACrB,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,CAAC,CACtD,CAAC;QACF,MAAM,MAAM,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,iBAAiB,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/C,GAAG,GAAG;YACN,iBAAiB,EAAE;gBACjB,GAAG,GAAG,CAAC,iBAAiB;g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Aa,GACjB,sBAAsB,IAAI,OAAO;QAC/B,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE;QACrC,CAAC,CAAC,OAAO,CAAC;IAEd,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAC3C,wBAAwB,CAAC,CAAC,EAAE,aAAa,CAAC,CAC3C,CAAC;IAEF,MAAM,gBAAgB,GAAG,kBAAkB,CACzC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EACtE,MAAM,EACN,aAAa,CACd,CAAC;IAEF,kFAAkF;IAClF,MAAM,eAAe,GACnB,sBAAsB,IAAI,OAAO,EAAE,QAAQ,EAAE,MAAM;QACjD,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC3D,CAAC,CAAC,OAAO,EAAE,eAAe,CAAC;IAE/B,OAAO;QACL,MAAM,EAAE,gBAAgB;QACxB,GAAG,CAAC,OAAO,EAAE,iBAAiB,IAAI;YAChC,kBAAkB,EAAE,OAAO,CAAC,iBAAiB;SAC9C,CAAC;QACF,GAAG,CAAC,eAAe,IAAI;YACrB,gBAAgB,EAAE,eAAe;SAClC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FilteringStreamOptions, ModuleConfigs, OrchestrationConfig, OutputFilteringConfig, PromptTemplatingModuleConfig } from '../client/api/schema/index.ts';
|
|
2
|
+
import type { StreamOptions, ModuleStreamOptions } from '../orchestration-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function addStreamOptionsToPromptTemplatingModuleConfig(promptTemplatingModuleConfig: PromptTemplatingModuleConfig, streamOptions?: ModuleStreamOptions): PromptTemplatingModuleConfig;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function addStreamOptionsToOutputFilteringConfig(outputFilteringConfig: OutputFilteringConfig, filteringStreamOptions: FilteringStreamOptions): OutputFilteringConfig;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* Adds stream options to module configurations and returns an orchestration config for streaming requests.
|
|
14
|
+
* Validates overrides and warns about unused or invalid override indices.
|
|
15
|
+
* @param moduleConfigs - Single or array of module configurations.
|
|
16
|
+
* @param streamOptions - Stream options with optional per-config overrides.
|
|
17
|
+
* @returns Orchestration config with stream enabled and processed modules.
|
|
18
|
+
*/
|
|
19
|
+
export declare function addStreamOptions(moduleConfigs: ModuleConfigs | ModuleConfigs[], streamOptions?: StreamOptions): OrchestrationConfig;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
* Wraps module configurations in an orchestration config, enabling streaming when requested.
|
|
23
|
+
* @param moduleConfigurations - Single or array of module configurations.
|
|
24
|
+
* @param stream - Whether to enable streaming.
|
|
25
|
+
* @param streamOptions - Stream options with optional per-config overrides.
|
|
26
|
+
* @returns The orchestration config, with streaming enabled when requested.
|
|
27
|
+
*/
|
|
28
|
+
export declare function addStreamIfEnabled(moduleConfigurations: ModuleConfigs | ModuleConfigs[], stream?: boolean, streamOptions?: StreamOptions): OrchestrationConfig;
|
|
29
|
+
//# sourceMappingURL=completion-stream-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-stream-options.d.ts","sourceRoot":"","sources":["../../src/util/completion-stream-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAOnC;;GAEG;AACH,wBAAgB,8CAA8C,CAC5D,4BAA4B,EAAE,4BAA4B,EAC1D,aAAa,CAAC,EAAE,mBAAmB,GAClC,4BAA4B,CAoB9B;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,GAC7C,qBAAqB,CAQvB;AA6GD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,aAAa,GAAG,aAAa,EAAE,EAC9C,aAAa,CAAC,EAAE,aAAa,GAC5B,mBAAmB,CA4BrB;AA4BD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,oBAAoB,EAAE,aAAa,GAAG,aAAa,EAAE,EACrD,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,aAAa,GAC5B,mBAAmB,CAIrB"}
|
|
@@ -1,60 +1,8 @@
|
|
|
1
1
|
import { createLogger } from '@sap-cloud-sdk/util';
|
|
2
|
-
import {} from '../orchestration-types.js';
|
|
3
2
|
const logger = createLogger({
|
|
4
3
|
package: 'orchestration',
|
|
5
4
|
messageContext: 'orchestration-utils'
|
|
6
5
|
});
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export function constructCompletionPostRequestFromJsonModuleConfig(config, prompt, stream) {
|
|
11
|
-
if (stream) {
|
|
12
|
-
config = {
|
|
13
|
-
...config,
|
|
14
|
-
stream: {
|
|
15
|
-
...config.stream,
|
|
16
|
-
enabled: true
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
delete config.stream;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
messages_history: prompt?.messagesHistory || [],
|
|
25
|
-
placeholder_values: prompt?.placeholderValues || {},
|
|
26
|
-
config
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
export function constructCompletionPostRequestFromConfigReference(configRef, request, stream) {
|
|
33
|
-
// Route request.messages into messages_history since there is no local
|
|
34
|
-
// prompt.template to merge them into for config references.
|
|
35
|
-
const messagesHistory = [
|
|
36
|
-
...(request?.messagesHistory || []),
|
|
37
|
-
...(request?.messages || [])
|
|
38
|
-
];
|
|
39
|
-
const { overrideConfig, ...configReference } = configRef;
|
|
40
|
-
const partialConfig = {
|
|
41
|
-
...overrideConfig,
|
|
42
|
-
stream: {
|
|
43
|
-
...overrideConfig?.stream,
|
|
44
|
-
enabled: stream === true
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
config_ref: configReference,
|
|
49
|
-
config: partialConfig,
|
|
50
|
-
...(request?.placeholderValues && {
|
|
51
|
-
placeholder_values: request.placeholderValues
|
|
52
|
-
}),
|
|
53
|
-
...(messagesHistory.length && {
|
|
54
|
-
messages_history: messagesHistory
|
|
55
|
-
})
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
6
|
/**
|
|
59
7
|
* @internal
|
|
60
8
|
*/
|
|
@@ -166,16 +114,6 @@ function warnAboutMissingOutputFiltering(moduleConfigs, streamOptions) {
|
|
|
166
114
|
logger.warn(`Output filter stream options will not be applied to ${configWord} ${positions} because output filtering is not configured for those modules.`);
|
|
167
115
|
}
|
|
168
116
|
}
|
|
169
|
-
/**
|
|
170
|
-
* @internal
|
|
171
|
-
* Adds stream options to module configurations for streaming requests.
|
|
172
|
-
*/
|
|
173
|
-
function buildModules(configs, options) {
|
|
174
|
-
return configs.map((config, index) => {
|
|
175
|
-
const itemStreamOptions = getStreamOptionsForItem(options, index);
|
|
176
|
-
return addStreamOptionsToSingleModuleConfig(config, itemStreamOptions);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
117
|
/**
|
|
180
118
|
* @internal
|
|
181
119
|
* Adds stream options to module configurations and returns an orchestration config for streaming requests.
|
|
@@ -194,7 +132,7 @@ export function addStreamOptions(moduleConfigs, streamOptions) {
|
|
|
194
132
|
warnAboutUnusedOverrides(streamOptions, configs.length);
|
|
195
133
|
warnAboutShortOverridesArray(streamOptions, configs.length);
|
|
196
134
|
warnAboutMissingOutputFiltering(moduleConfigs, streamOptions);
|
|
197
|
-
const modules =
|
|
135
|
+
const modules = configs.map((config, index) => addStreamOptionsToSingleModuleConfig(config, getStreamOptionsForItem(streamOptions, index)));
|
|
198
136
|
return {
|
|
199
137
|
stream: {
|
|
200
138
|
enabled: true,
|
|
@@ -218,119 +156,17 @@ function addStreamOptionsToSingleModuleConfig(moduleConfigs, streamOptions) {
|
|
|
218
156
|
})
|
|
219
157
|
};
|
|
220
158
|
}
|
|
221
|
-
/** @internal */
|
|
222
|
-
export function constructCompletionPostRequest(config, request, stream, streamOptions) {
|
|
223
|
-
// Preserve format: single config → ModuleConfigs, array → ModuleConfigs[]
|
|
224
|
-
// The orchestration service expects the config structure to match the input:
|
|
225
|
-
// - Single config (OrchestrationModuleConfig) → single ModuleConfigs object
|
|
226
|
-
// - Config array (OrchestrationModuleConfigList) → array of ModuleConfigs for fallback behavior
|
|
227
|
-
// When any config uses a TemplateRef, messages cannot be merged into prompt.template
|
|
228
|
-
// (the template lives remotely). Route them to messages_history instead.
|
|
229
|
-
const configs = Array.isArray(config) ? config : [config];
|
|
230
|
-
const routeMessagesToHistory = configs.some(c => isTemplateRef(c?.promptTemplating?.prompt || {}));
|
|
231
|
-
const moduleRequest = routeMessagesToHistory && request
|
|
232
|
-
? { ...request, messages: undefined }
|
|
233
|
-
: request;
|
|
234
|
-
/**
|
|
235
|
-
* Module configurations for the orchestration request.
|
|
236
|
-
*/
|
|
237
|
-
const moduleConfigurations = Array.isArray(config)
|
|
238
|
-
? config.map(c => buildCompletionModulesConfig(c, moduleRequest))
|
|
239
|
-
: buildCompletionModulesConfig(config, moduleRequest);
|
|
240
|
-
/**
|
|
241
|
-
* Orchestration configuration with or without streaming enabled.
|
|
242
|
-
*/
|
|
243
|
-
const configWithStream = stream
|
|
244
|
-
? Array.isArray(moduleConfigurations)
|
|
245
|
-
? addStreamOptions(moduleConfigurations, streamOptions)
|
|
246
|
-
: addStreamOptions(moduleConfigurations, streamOptions)
|
|
247
|
-
: { modules: moduleConfigurations };
|
|
248
|
-
// When routing messages to history, append request.messages after messagesHistory
|
|
249
|
-
const messagesHistory = routeMessagesToHistory && request?.messages?.length
|
|
250
|
-
? [...(request.messagesHistory || []), ...request.messages]
|
|
251
|
-
: request?.messagesHistory;
|
|
252
|
-
return {
|
|
253
|
-
config: configWithStream,
|
|
254
|
-
...(request?.placeholderValues && {
|
|
255
|
-
placeholder_values: request.placeholderValues
|
|
256
|
-
}),
|
|
257
|
-
...(messagesHistory && {
|
|
258
|
-
messages_history: messagesHistory
|
|
259
|
-
})
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function resolvePromptTemplate(promptTemplating, messages) {
|
|
263
|
-
if (typeof promptTemplating.prompt === 'string') {
|
|
264
|
-
throw new TypeError('Prompt must be parsed before merging with messages.');
|
|
265
|
-
}
|
|
266
|
-
// If promptTemplating.prompt is not defined, we initialize it with an empty template object
|
|
267
|
-
const prompt = promptTemplating.prompt ?? { template: [] };
|
|
268
|
-
if (isTemplate(prompt)) {
|
|
269
|
-
if (!prompt.template?.length && !messages?.length) {
|
|
270
|
-
throw new Error('Either a prompt template or messages must be defined.');
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
...prompt,
|
|
274
|
-
template: [...(prompt.template || []), ...(messages || [])]
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
return prompt;
|
|
278
|
-
}
|
|
279
|
-
function buildCompletionModulesConfig(config, request) {
|
|
280
|
-
const { promptTemplating, filtering, masking, grounding, translation } = config;
|
|
281
|
-
const prompt = resolvePromptTemplate(promptTemplating, request?.messages);
|
|
282
|
-
return {
|
|
283
|
-
prompt_templating: {
|
|
284
|
-
...promptTemplating,
|
|
285
|
-
prompt
|
|
286
|
-
},
|
|
287
|
-
...(filtering && Object.keys(filtering).length && { filtering }),
|
|
288
|
-
...(masking && Object.keys(masking).length && { masking }),
|
|
289
|
-
...(grounding && Object.keys(grounding).length && { grounding }),
|
|
290
|
-
...(translation && Object.keys(translation).length && { translation })
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
function isTemplate(templating) {
|
|
294
|
-
return (!!templating &&
|
|
295
|
-
typeof templating === 'object' &&
|
|
296
|
-
!('template_ref' in templating));
|
|
297
|
-
}
|
|
298
|
-
function isTemplateRef(templating) {
|
|
299
|
-
return (!!templating &&
|
|
300
|
-
typeof templating === 'object' &&
|
|
301
|
-
'template_ref' in templating);
|
|
302
|
-
}
|
|
303
159
|
/**
|
|
304
|
-
* Constructs an embedding post request from the given configuration and request.
|
|
305
160
|
* @internal
|
|
161
|
+
* Wraps module configurations in an orchestration config, enabling streaming when requested.
|
|
162
|
+
* @param moduleConfigurations - Single or array of module configurations.
|
|
163
|
+
* @param stream - Whether to enable streaming.
|
|
164
|
+
* @param streamOptions - Stream options with optional per-config overrides.
|
|
165
|
+
* @returns The orchestration config, with streaming enabled when requested.
|
|
306
166
|
*/
|
|
307
|
-
export function
|
|
308
|
-
|
|
309
|
-
modules:
|
|
310
|
-
|
|
311
|
-
const embeddingRequest = {
|
|
312
|
-
config: orchestrationConfig,
|
|
313
|
-
input: {
|
|
314
|
-
text: request.input,
|
|
315
|
-
...(request.type && { type: request.type })
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
return embeddingRequest;
|
|
319
|
-
}
|
|
320
|
-
function buildEmbeddingModulesConfig(config) {
|
|
321
|
-
const { embeddings, masking } = config;
|
|
322
|
-
const { model } = embeddings;
|
|
323
|
-
const { name, version, params } = model;
|
|
324
|
-
const modules = {
|
|
325
|
-
embeddings: {
|
|
326
|
-
model: {
|
|
327
|
-
name,
|
|
328
|
-
...(version && { version }),
|
|
329
|
-
...(params && { params })
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
...(masking && Object.keys(masking).length && { masking })
|
|
333
|
-
};
|
|
334
|
-
return modules;
|
|
167
|
+
export function addStreamIfEnabled(moduleConfigurations, stream, streamOptions) {
|
|
168
|
+
return !stream
|
|
169
|
+
? { modules: moduleConfigurations }
|
|
170
|
+
: addStreamOptions(moduleConfigurations, streamOptions);
|
|
335
171
|
}
|
|
336
|
-
//# sourceMappingURL=
|
|
172
|
+
//# sourceMappingURL=completion-stream-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-stream-options.js","sourceRoot":"","sources":["../../src/util/completion-stream-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnD,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,eAAe;IACxB,cAAc,EAAE,qBAAqB;CACtC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,8CAA8C,CAC5D,4BAA0D,EAC1D,aAAmC;IAEnC,IAAI,aAAa,EAAE,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD,OAAO;QACL,GAAG,4BAA4B;QAC/B,KAAK,EAAE;YACL,GAAG,4BAA4B,CAAC,KAAK;YACrC,MAAM,EAAE;gBACN,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM;gBAC5C,GAAG,CAAC,aAAa,EAAE,gBAAgB,KAAK,IAAI,IAAI;oBAC9C,cAAc,EAAE;wBACd,aAAa,EAAE,IAAI;wBACnB,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,EAAE,cAAc;wBAC5D,GAAG,aAAa,EAAE,gBAAgB;qBACnC;iBACF,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uCAAuC,CACrD,qBAA4C,EAC5C,sBAA8C;IAE9C,OAAO;QACL,GAAG,qBAAqB;QACxB,cAAc,EAAE;YACd,GAAG,qBAAqB,CAAC,cAAc;YACvC,GAAG,sBAAs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E,SAAS,EAAE,GAAG,aAAa,CAAC;IACvD,MAAM,eAAe,GAAG,aAAa,EAAE,eAAe,CAAC;IAEvD,OAAO;QACL,GAAG,aAAa;QAChB,iBAAiB,EAAE,8CAA8C,CAC/D,iBAAiB,EACjB,aAAa,CACd;QACD,GAAG,CAAC,eAAe;YACjB,SAAS,EAAE,MAAM,IAAI;YACnB,SAAS,EAAE;gBACT,GAAG,SAAS;gBACZ,MAAM,EAAE,uCAAuC,CAC7C,SAAS,CAAC,MAAM,EAChB,eAAe,CAChB;aACF;SACF,CAAC;KACL,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,oBAAqD,EACrD,MAAgB,EAChB,aAA6B;IAE7B,OAAO,CAAC,MAAM;QACZ,CAAC,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACnC,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type EmbeddingModuleConfig, type EmbeddingRequest } from '../orchestration-types.ts';
|
|
2
|
+
import type { EmbeddingsPostRequest } from '../client/api/schema/index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Constructs an embedding post request from the given configuration and request.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function constructEmbeddingPostRequest(config: EmbeddingModuleConfig, request: EmbeddingRequest): EmbeddingsPostRequest;
|
|
8
|
+
//# sourceMappingURL=embedding-request-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding-request-builder.d.ts","sourceRoot":"","sources":["../../src/util/embedding-request-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,qBAAqB,CAavB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {} from '../orchestration-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Constructs an embedding post request from the given configuration and request.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export function constructEmbeddingPostRequest(config, request) {
|
|
7
|
+
const orchestrationConfig = {
|
|
8
|
+
modules: buildEmbeddingModulesConfig(config)
|
|
9
|
+
};
|
|
10
|
+
const embeddingRequest = {
|
|
11
|
+
config: orchestrationConfig,
|
|
12
|
+
input: {
|
|
13
|
+
text: request.input,
|
|
14
|
+
...(request.type && { type: request.type })
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return embeddingRequest;
|
|
18
|
+
}
|
|
19
|
+
function buildEmbeddingModulesConfig(config) {
|
|
20
|
+
const { embeddings, masking } = config;
|
|
21
|
+
const { model } = embeddings;
|
|
22
|
+
const { name, version, params } = model;
|
|
23
|
+
const modules = {
|
|
24
|
+
embeddings: {
|
|
25
|
+
model: {
|
|
26
|
+
name,
|
|
27
|
+
...(version && { version }),
|
|
28
|
+
...(params && { params })
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
...(masking && Object.keys(masking).length && { masking })
|
|
32
|
+
};
|
|
33
|
+
return modules;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=embedding-request-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding-request-builder.js","sourceRoot":"","sources":["../../src/util/embedding-request-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,2BAA2B,CAAC;AAQnC;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,MAA6B,EAC7B,OAAyB;IAEzB,MAAM,mBAAmB,GAAkC;QACzD,OAAO,EAAE,2BAA2B,CAAC,MAAM,CAAC;KAC7C,CAAC;IAEF,MAAM,gBAAgB,GAA0B;QAC9C,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE;YACL,IAAI,EAAE,OAAO,CAAC,KAAK;YACnB,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;SAC5C;KACF,CAAC;IACF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,2BAA2B,CAClC,MAA6B;IAE7B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,OAAO,GAA4B;QACvC,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI;gBACJ,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC;gBAC3B,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;aAC1B;SACF;QACD,GAAG,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,EAAE,OAAO,EAAE,CAAC;KAC3D,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './filtering.ts';
|
|
2
2
|
export * from './grounding.ts';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './completion-request-builder.ts';
|
|
4
|
+
export * from './completion-prompt-util.ts';
|
|
5
|
+
export * from './completion-stream-options.ts';
|
|
6
|
+
export * from './embedding-request-builder.ts';
|
|
4
7
|
export * from './masking.ts';
|
|
5
8
|
export * from './translation.ts';
|
|
6
9
|
export * from './stream.ts';
|
package/dist/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
package/dist/util/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './filtering.js';
|
|
2
2
|
export * from './grounding.js';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './completion-request-builder.js';
|
|
4
|
+
export * from './completion-prompt-util.js';
|
|
5
|
+
export * from './completion-stream-options.js';
|
|
6
|
+
export * from './embedding-request-builder.js';
|
|
4
7
|
export * from './masking.js';
|
|
5
8
|
export * from './translation.js';
|
|
6
9
|
export * from './stream.js';
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ai-sdk/orchestration",
|
|
3
|
-
"version": "2.18.0",
|
|
3
|
+
"version": "2.18.1-20261111011042.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm-access",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sap-ai-sdk/ai-api": "^2.18.0",
|
|
37
|
-
"@sap-ai-sdk/core": "^2.18.0",
|
|
38
|
-
"@sap-ai-sdk/prompt-registry": "^2.18.0",
|
|
36
|
+
"@sap-ai-sdk/ai-api": "^2.18.1-20261111011042.0",
|
|
37
|
+
"@sap-ai-sdk/core": "^2.18.1-20261111011042.0",
|
|
38
|
+
"@sap-ai-sdk/prompt-registry": "^2.18.1-20261111011042.0",
|
|
39
39
|
"@sap-cloud-sdk/util": "^4.10.0",
|
|
40
40
|
"yaml": "^2.9.0"
|
|
41
41
|
},
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type ChatCompletionRequest, type StreamOptions, type BaseStreamOptions, type ModuleStreamOptions, type OrchestrationConfigRefById, type OrchestrationConfigRefByName, type OrchestrationModuleConfig, type OrchestrationModuleConfigList, type EmbeddingModuleConfig, type EmbeddingRequest } from '../orchestration-types.ts';
|
|
2
|
-
import type { CompletionPostRequest, CompletionRequestConfigurationReferenceById, CompletionRequestConfigurationReferenceByNameScenarioVersion, FilteringStreamOptions, ModuleConfigs, OrchestrationConfig, OutputFilteringConfig, PromptTemplatingModuleConfig, EmbeddingsPostRequest } from '../client/api/schema/index.ts';
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare function constructCompletionPostRequestFromJsonModuleConfig(config: Record<string, any>, prompt?: ChatCompletionRequest, stream?: boolean): Record<string, any>;
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare function constructCompletionPostRequestFromConfigReference(configRef: OrchestrationConfigRefById | OrchestrationConfigRefByName, request?: ChatCompletionRequest, stream?: boolean): CompletionRequestConfigurationReferenceById | CompletionRequestConfigurationReferenceByNameScenarioVersion;
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare function addStreamOptionsToPromptTemplatingModuleConfig(promptTemplatingModuleConfig: PromptTemplatingModuleConfig, streamOptions?: ModuleStreamOptions): PromptTemplatingModuleConfig;
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare function addStreamOptionsToOutputFilteringConfig(outputFilteringConfig: OutputFilteringConfig, filteringStreamOptions: FilteringStreamOptions): OutputFilteringConfig;
|
|
19
|
-
/** @internal */
|
|
20
|
-
export declare function addStreamOptions(moduleConfigs: ModuleConfigs[], streamOptions?: StreamOptions): OrchestrationConfig;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare function addStreamOptions(moduleConfigs: ModuleConfigs, streamOptions?: BaseStreamOptions): OrchestrationConfig;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export declare function constructCompletionPostRequest(config: OrchestrationModuleConfig, request?: ChatCompletionRequest, stream?: boolean, streamOptions?: BaseStreamOptions): CompletionPostRequest;
|
|
27
|
-
/** @internal */
|
|
28
|
-
export declare function constructCompletionPostRequest(config: OrchestrationModuleConfigList, request?: ChatCompletionRequest, stream?: boolean, streamOptions?: StreamOptions): CompletionPostRequest;
|
|
29
|
-
/**
|
|
30
|
-
* Constructs an embedding post request from the given configuration and request.
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export declare function constructEmbeddingPostRequest(config: EmbeddingModuleConfig, request: EmbeddingRequest): EmbeddingsPostRequest;
|
|
34
|
-
//# sourceMappingURL=module-config.d.ts.map
|
|
@@ -1 +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