@sap-ai-sdk/orchestration 1.17.1-20250825032219.0 → 1.17.1-20250920013049.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/deployment-resolver.d.ts +11 -0
- package/dist/deployment-resolver.d.ts.map +1 -0
- package/dist/deployment-resolver.js +20 -0
- package/dist/deployment-resolver.js.map +1 -0
- package/dist/index.d.ts +8 -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 +5 -5
- package/dist/orchestration-client.d.ts.map +1 -1
- package/dist/orchestration-client.js +31 -22
- package/dist/orchestration-client.js.map +1 -1
- package/dist/orchestration-response.d.ts +7 -2
- package/dist/orchestration-response.d.ts.map +1 -1
- package/dist/orchestration-response.js +12 -5
- package/dist/orchestration-response.js.map +1 -1
- package/dist/orchestration-stream-chunk-response.d.ts +8 -3
- package/dist/orchestration-stream-chunk-response.d.ts.map +1 -1
- package/dist/orchestration-stream-chunk-response.js +13 -6
- package/dist/orchestration-stream-chunk-response.js.map +1 -1
- package/dist/orchestration-stream-response.d.ts +12 -3
- package/dist/orchestration-stream-response.d.ts.map +1 -1
- package/dist/orchestration-stream-response.js +20 -8
- package/dist/orchestration-stream-response.js.map +1 -1
- package/dist/orchestration-stream.js +1 -1
- package/dist/orchestration-stream.js.map +1 -1
- package/dist/orchestration-types.d.ts +216 -82
- package/dist/orchestration-types.d.ts.map +1 -1
- package/dist/orchestration-types.js.map +1 -1
- package/dist/util/filtering.d.ts +10 -16
- package/dist/util/filtering.d.ts.map +1 -1
- package/dist/util/filtering.js +33 -34
- package/dist/util/filtering.js.map +1 -1
- package/dist/util/grounding.d.ts +2 -3
- 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/masking.d.ts +2 -3
- package/dist/util/masking.d.ts.map +1 -1
- package/dist/util/masking.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/dist/util/translation.d.ts +5 -5
- package/dist/util/translation.d.ts.map +1 -1
- package/dist/util/translation.js +4 -3
- package/dist/util/translation.js.map +1 -1
- package/package.json +7 -7
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveDeploymentId } from '@sap-ai-sdk/ai-api/internal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the deployment ID for an orchestration scenario.
|
|
4
|
+
* @param deploymentConfig - The deployment configuration (resource group or deployment ID).
|
|
5
|
+
* @param destination - The destination to use for the request.
|
|
6
|
+
* @returns The ID of the deployment, if found.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export async function getOrchestrationDeploymentId(deploymentConfig, destination) {
|
|
10
|
+
if (typeof deploymentConfig === 'object' &&
|
|
11
|
+
'deploymentId' in deploymentConfig) {
|
|
12
|
+
return deploymentConfig.deploymentId;
|
|
13
|
+
}
|
|
14
|
+
return resolveDeploymentId({
|
|
15
|
+
scenarioId: 'orchestration',
|
|
16
|
+
...(deploymentConfig ?? {}),
|
|
17
|
+
destination
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=deployment-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-resolver.js","sourceRoot":"","sources":["../src/deployment-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAOrE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,gBAA0D,EAC1D,WAA2C;IAE3C,IACE,OAAO,gBAAgB,KAAK,QAAQ;QACpC,cAAc,IAAI,gBAAgB,EAClC,CAAC;QACD,OAAO,gBAAgB,CAAC,YAAY,CAAC;IACvC,CAAC;IAED,OAAO,mBAAmB,CAAC;QACzB,UAAU,EAAE,eAAe;QAC3B,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAC3B,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type { OrchestrationModuleConfig, LlmModuleConfig, TemplatingModuleConfig, Template, Prompt, RequestOptions, StreamOptions, DocumentGroundingServiceConfig, DocumentGroundingServiceFilter, DpiMaskingConfig, LlmModelParams, LlamaGuardCategory, AzureContentFilter, AzureFilterThreshold, TranslationConfigParams, AzureContentSafety, AzureContentSafetyFilterConfig } from './orchestration-types.js';
|
|
1
|
+
export type { OrchestrationModuleConfig, PromptTemplatingModule, MaskingModule, GroundingModule, FilteringModule, TranslationModule, PromptTemplate, ChatCompletionRequest, RequestOptions, StreamOptions, DocumentGroundingServiceConfig, DocumentGroundingServiceFilter, DpiMaskingConfig, LlmModelParams, LlmModelDetails, LlamaGuard38BCategory, LlamaGuard38BFilterReturnType, LlamaGuard38BInputFilterConfig, LlamaGuard38BOutputFilterConfig, AzureFilterThreshold, AzureContentSafetyFilterInputParameters, AzureContentSafetyFilterOutputParameters, AzureContentSafetyFilterParameters, AzureContentSafetyFilterReturnType, OrchestrationErrorResponse, DpiMaskingProviderConfig, TranslationConfigParams, TranslationInputParameters, TranslationOutputParameters, TranslationReturnType, TranslationInputConfig, TranslationOutputConfig } from './orchestration-types.js';
|
|
3
2
|
export { OrchestrationStreamResponse } from './orchestration-stream-response.js';
|
|
4
3
|
export { OrchestrationStreamChunkResponse } from './orchestration-stream-chunk-response.js';
|
|
5
4
|
export { OrchestrationStream } from './orchestration-stream.js';
|
|
6
5
|
export { OrchestrationClient } from './orchestration-client.js';
|
|
7
|
-
export { buildAzureContentFilter, buildAzureContentSafetyFilter, buildLlamaGuardFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildTranslationConfig } from './util/index.js';
|
|
8
6
|
export { OrchestrationResponse } from './orchestration-response.js';
|
|
9
7
|
export type { ChatModel } from './model-types.js';
|
|
8
|
+
export { buildAzureContentSafetyFilter, buildLlamaGuard38BFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildTranslationConfig } from './util/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Exporting frequently used types.
|
|
11
|
+
* In case of breaking changes, create wrappers in `orchestration-types.ts`.
|
|
12
|
+
* Explicitly export the wrapper also in `internal.ts`.
|
|
13
|
+
*/
|
|
14
|
+
export type { ChatMessage, SystemChatMessage, UserChatMessage, AssistantChatMessage, ToolChatMessage, DeveloperChatMessage, ChatCompletionTool, FunctionObject } from './client/api/schema/index.js';
|
|
10
15
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,8BAA8B,EAC9B,8BAA8B,EAC9B,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,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,EACxB,MAAM,0BAA0B,CAAC;AAClC,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;AACpE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC"}
|
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, buildLlamaGuard38BFilter, 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":"AAkCA,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,wBAAwB,EACxB,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import type { ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
|
|
5
|
-
import type { OrchestrationModuleConfig,
|
|
4
|
+
import type { DeploymentIdConfig, ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
|
|
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
|
/**
|
|
@@ -18,9 +18,9 @@ export declare class OrchestrationClient {
|
|
|
18
18
|
* @param deploymentConfig - Deployment configuration.
|
|
19
19
|
* @param destination - The destination to use for the request.
|
|
20
20
|
*/
|
|
21
|
-
constructor(config: OrchestrationModuleConfig | string, deploymentConfig?: ResourceGroupConfig | undefined, destination?: HttpDestinationOrFetchOptions | undefined);
|
|
22
|
-
chatCompletion(
|
|
23
|
-
stream(
|
|
21
|
+
constructor(config: OrchestrationModuleConfig | string, deploymentConfig?: (ResourceGroupConfig | DeploymentIdConfig) | undefined, destination?: HttpDestinationOrFetchOptions | undefined);
|
|
22
|
+
chatCompletion(request?: ChatCompletionRequest, requestConfig?: CustomRequestConfig): Promise<OrchestrationResponse>;
|
|
23
|
+
stream(request?: ChatCompletionRequest, signal?: AbortSignal, 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,
|
|
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,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AACxC,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,GAAE,mBAAmB,GAAG,kBAAkB,aAAA,EAC3D,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,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,2BAA2B,CAAC,gCAAgC,CAAC,CAAC;YA8B3D,cAAc;YAqCd,oBAAoB;IA4BlC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CAuChC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { executeRequest } from '@sap-ai-sdk/core';
|
|
2
|
-
import { resolveDeploymentId } from '@sap-ai-sdk/ai-api/internal.js';
|
|
3
2
|
import { createLogger } from '@sap-cloud-sdk/util';
|
|
4
3
|
import yaml from 'yaml';
|
|
5
4
|
import { registryControllerPromptControllerCreateUpdatePromptTemplateBody } from '@sap-ai-sdk/prompt-registry/internal.js';
|
|
5
|
+
import { getOrchestrationDeploymentId } from './deployment-resolver.js';
|
|
6
6
|
import { OrchestrationStream } from './orchestration-stream.js';
|
|
7
7
|
import { OrchestrationStreamResponse } from './orchestration-stream-response.js';
|
|
8
8
|
import { OrchestrationResponse } from './orchestration-response.js';
|
|
@@ -33,26 +33,32 @@ 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, signal, options, requestConfig) {
|
|
50
|
+
const controller = new AbortController();
|
|
51
|
+
if (signal) {
|
|
52
|
+
signal.addEventListener('abort', () => {
|
|
53
|
+
controller.abort();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
50
56
|
try {
|
|
51
57
|
if (typeof this.config === 'string' && options) {
|
|
52
58
|
logger.warn('Stream options are not supported when using a JSON module config.');
|
|
53
59
|
}
|
|
54
60
|
return await this.createStreamResponse({
|
|
55
|
-
|
|
61
|
+
request,
|
|
56
62
|
requestConfig,
|
|
57
63
|
stream: true,
|
|
58
64
|
streamOptions: options
|
|
@@ -64,17 +70,16 @@ export class OrchestrationClient {
|
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
async executeRequest(options) {
|
|
67
|
-
const {
|
|
73
|
+
const { request, requestConfig, stream, streamOptions } = options;
|
|
68
74
|
const body = typeof this.config === 'string'
|
|
69
|
-
? constructCompletionPostRequestFromJsonModuleConfig(JSON.parse(this.config),
|
|
70
|
-
: constructCompletionPostRequest(this.config,
|
|
71
|
-
const deploymentId = await
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
75
|
+
? constructCompletionPostRequestFromJsonModuleConfig(JSON.parse(this.config), request, stream)
|
|
76
|
+
: constructCompletionPostRequest(this.config, request, stream, streamOptions);
|
|
77
|
+
const deploymentId = await getOrchestrationDeploymentId(this.deploymentConfig ?? {}, this.destination);
|
|
78
|
+
if (!deploymentId) {
|
|
79
|
+
throw new Error('Failed to resolve deployment ID');
|
|
80
|
+
}
|
|
76
81
|
return executeRequest({
|
|
77
|
-
url: `/inference/deployments/${deploymentId}/completion`,
|
|
82
|
+
url: `/inference/deployments/${deploymentId}/v2/completion`,
|
|
78
83
|
...(this.deploymentConfig ?? {})
|
|
79
84
|
}, body, requestConfig, this.destination);
|
|
80
85
|
}
|
|
@@ -115,11 +120,12 @@ export class OrchestrationClient {
|
|
|
115
120
|
*/
|
|
116
121
|
parseAndMergeTemplating(config) {
|
|
117
122
|
let parsedObject;
|
|
118
|
-
if (typeof config.
|
|
123
|
+
if (typeof config.promptTemplating.prompt === 'string' &&
|
|
124
|
+
!config.promptTemplating.prompt.trim()) {
|
|
119
125
|
throw new Error('Templating YAML string must be non-empty.');
|
|
120
126
|
}
|
|
121
127
|
try {
|
|
122
|
-
parsedObject = yaml.parse(config.
|
|
128
|
+
parsedObject = yaml.parse(config.promptTemplating.prompt);
|
|
123
129
|
}
|
|
124
130
|
catch (error) {
|
|
125
131
|
throw new Error(`Error parsing YAML: ${error}`);
|
|
@@ -131,11 +137,14 @@ export class OrchestrationClient {
|
|
|
131
137
|
const { template, defaults, response_format, tools } = result.data.spec;
|
|
132
138
|
return {
|
|
133
139
|
...config,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
promptTemplating: {
|
|
141
|
+
...config.promptTemplating,
|
|
142
|
+
prompt: {
|
|
143
|
+
template: template,
|
|
144
|
+
...(defaults && { defaults }),
|
|
145
|
+
...(response_format && { response_format }),
|
|
146
|
+
...(tools && { tools })
|
|
147
|
+
}
|
|
139
148
|
}
|
|
140
149
|
};
|
|
141
150
|
}
|
|
@@ -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,
|
|
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,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gE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AAK,QAAQ;YAClD,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,EACtC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC;YACH,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAgB,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,MAAM,GACV,gEAAgE,CAAC,SAAS,CACxE,YAAY,CACb,CAAC;QACJ,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,iFAAiF,MAAM,CAAC,KAAK,EAAE,CAChG,CAAC;QACJ,CAAC;QACD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACxE,OAAO;YACL,GAAG,MAAM;YACT,gBAAgB,EAAE;gBAChB,GAAG,MAAM,CAAC,gBAAgB;gBAC1B,MAAM,EAAE;oBACN,QAAQ,EAAE,QAAiC;oBAC3C,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;oBAC7B,GAAG,CAAC,eAAe,IAAI,EAAE,eAAe,EAAE,CAAC;oBAC3C,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;iBACxB;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpResponse } from '@sap-cloud-sdk/http-client';
|
|
2
|
-
import type { CompletionPostResponse, TokenUsage, ChatMessages, AssistantChatMessage, MessageToolCalls, LlmChoice } from './client/api/schema/index.js';
|
|
2
|
+
import type { CompletionPostResponse, TokenUsage, ChatMessages, AssistantChatMessage, MessageToolCalls, LlmChoice, ModuleResults } from './client/api/schema/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Representation of an orchestration response.
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@ export declare class OrchestrationResponse {
|
|
|
8
8
|
/**
|
|
9
9
|
* The completion post response.
|
|
10
10
|
*/
|
|
11
|
-
readonly
|
|
11
|
+
readonly _data: CompletionPostResponse;
|
|
12
12
|
constructor(rawResponse: HttpResponse);
|
|
13
13
|
/**
|
|
14
14
|
* Usage of tokens in the response.
|
|
@@ -52,6 +52,11 @@ export declare class OrchestrationResponse {
|
|
|
52
52
|
* @returns The assistant message.
|
|
53
53
|
*/
|
|
54
54
|
getAssistantMessage(choiceIndex?: number): AssistantChatMessage | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the intermediate results from the orchestration response.
|
|
57
|
+
* @returns The intermediate results.
|
|
58
|
+
*/
|
|
59
|
+
getIntermediateResults(): ModuleResults;
|
|
55
60
|
/**
|
|
56
61
|
* Parses the response and returns the choice by index.
|
|
57
62
|
* @param index - The index of the choice to find.
|
|
@@ -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,
|
|
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,EACT,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,qBAAqB;aAKJ,WAAW,EAAE,YAAY;IAJrD;;OAEG;IACH,SAAgB,KAAK,EAAE,sBAAsB,CAAC;gBAClB,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;;;OAGG;IACH,sBAAsB,IAAI,aAAa;IAIvC;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIvD,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -6,17 +6,17 @@ export class OrchestrationResponse {
|
|
|
6
6
|
/**
|
|
7
7
|
* The completion post response.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
_data;
|
|
10
10
|
constructor(rawResponse) {
|
|
11
11
|
this.rawResponse = rawResponse;
|
|
12
|
-
this.
|
|
12
|
+
this._data = rawResponse.data;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Usage of tokens in the response.
|
|
16
16
|
* @returns Token usage.
|
|
17
17
|
*/
|
|
18
18
|
getTokenUsage() {
|
|
19
|
-
return this.
|
|
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.
|
|
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
|
}
|
|
@@ -76,6 +76,13 @@ export class OrchestrationResponse {
|
|
|
76
76
|
getAssistantMessage(choiceIndex = 0) {
|
|
77
77
|
return this.findChoiceByIndex(choiceIndex)?.message;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Gets the intermediate results from the orchestration response.
|
|
81
|
+
* @returns The intermediate results.
|
|
82
|
+
*/
|
|
83
|
+
getIntermediateResults() {
|
|
84
|
+
return this._data.intermediate_results;
|
|
85
|
+
}
|
|
79
86
|
/**
|
|
80
87
|
* Parses the response and returns the choice by index.
|
|
81
88
|
* @param index - The index of the choice to find.
|
|
@@ -85,7 +92,7 @@ export class OrchestrationResponse {
|
|
|
85
92
|
return this.getChoices().find((c) => c.index === index);
|
|
86
93
|
}
|
|
87
94
|
getChoices() {
|
|
88
|
-
return this.
|
|
95
|
+
return this._data.final_result.choices;
|
|
89
96
|
}
|
|
90
97
|
}
|
|
91
98
|
//# sourceMappingURL=orchestration-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-response.js","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestration-response.js","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAKJ;IAJ5B;;OAEG;IACa,KAAK,CAAyB;IAC9C,YAA4B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;QACnD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAA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;;;OAIG;IACH,mBAAmB,CAAC,WAAW,GAAG,CAAC;QACjC,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtD,CAAC;IAED;;;OAGG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC7E,CAAC;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { CompletionPostResponseStreaming, LlmChoiceStreaming, TokenUsage, ToolCallChunk } from './client/api/schema/index.js';
|
|
1
|
+
import type { CompletionPostResponseStreaming, LlmChoiceStreaming, ModuleResultsStreaming, TokenUsage, ToolCallChunk } from './client/api/schema/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Orchestration stream chunk response.
|
|
4
4
|
*/
|
|
5
5
|
export declare class OrchestrationStreamChunkResponse {
|
|
6
|
-
readonly
|
|
7
|
-
constructor(
|
|
6
|
+
readonly _data: CompletionPostResponseStreaming;
|
|
7
|
+
constructor(_data: CompletionPostResponseStreaming);
|
|
8
8
|
/**
|
|
9
9
|
* Usage of tokens in the chunk response.
|
|
10
10
|
* @returns Token usage.
|
|
@@ -28,6 +28,11 @@ export declare class OrchestrationStreamChunkResponse {
|
|
|
28
28
|
* @returns The message delta content.
|
|
29
29
|
*/
|
|
30
30
|
getDeltaContent(choiceIndex?: number): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the intermediate results from the chunk.
|
|
33
|
+
* @returns The intermediate results.
|
|
34
|
+
*/
|
|
35
|
+
getIntermediateResults(): ModuleResultsStreaming | undefined;
|
|
31
36
|
/**
|
|
32
37
|
* Parses the chunk response and returns the choice by index.
|
|
33
38
|
* @param index - The index of the choice to find.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream-chunk-response.d.ts","sourceRoot":"","sources":["../src/orchestration-stream-chunk-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,kBAAkB,EAClB,UAAU,EACV,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,gCAAgC;aACf,
|
|
1
|
+
{"version":3,"file":"orchestration-stream-chunk-response.d.ts","sourceRoot":"","sources":["../src/orchestration-stream-chunk-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,gCAAgC;aACf,KAAK,EAAE,+BAA+B;gBAAtC,KAAK,EAAE,+BAA+B;IAIlE;;;OAGG;IACH,aAAa,IAAI,UAAU,GAAG,SAAS;IAIvC;;;;OAIG;IACH,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAIpD;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,SAAI,GAAG,aAAa,EAAE,GAAG,SAAS;IAI/D;;;;OAIG;IACH,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAIpD;;;OAGG;IACH,sBAAsB,IAAI,sBAAsB,GAAG,SAAS;IAI5D;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAMhE,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Orchestration stream chunk response.
|
|
3
3
|
*/
|
|
4
4
|
export class OrchestrationStreamChunkResponse {
|
|
5
|
-
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
5
|
+
_data;
|
|
6
|
+
constructor(_data) {
|
|
7
|
+
this._data = _data;
|
|
8
|
+
this._data = _data;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Usage of tokens in the chunk response.
|
|
12
12
|
* @returns Token usage.
|
|
13
13
|
*/
|
|
14
14
|
getTokenUsage() {
|
|
15
|
-
return this.
|
|
15
|
+
return this._data.final_result?.usage;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Reason for stopping the completion stream chunk.
|
|
@@ -38,6 +38,13 @@ export class OrchestrationStreamChunkResponse {
|
|
|
38
38
|
getDeltaContent(choiceIndex = 0) {
|
|
39
39
|
return this.findChoiceByIndex(choiceIndex)?.delta.content;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the intermediate results from the chunk.
|
|
43
|
+
* @returns The intermediate results.
|
|
44
|
+
*/
|
|
45
|
+
getIntermediateResults() {
|
|
46
|
+
return this._data.intermediate_results;
|
|
47
|
+
}
|
|
41
48
|
/**
|
|
42
49
|
* Parses the chunk response and returns the choice by index.
|
|
43
50
|
* @param index - The index of the choice to find.
|
|
@@ -47,7 +54,7 @@ export class OrchestrationStreamChunkResponse {
|
|
|
47
54
|
return this.getChoices()?.find((c) => c.index === index);
|
|
48
55
|
}
|
|
49
56
|
getChoices() {
|
|
50
|
-
return this.
|
|
57
|
+
return this._data.final_result?.choices;
|
|
51
58
|
}
|
|
52
59
|
}
|
|
53
60
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"orchestration-stream-chunk-response.js","sourceRoot":"","sources":["../src/orchestration-stream-chunk-response.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,OAAO,gCAAgC;IACf;IAA5B,YAA4B,KAAsC;QAAtC,UAAK,GAAL,KAAK,CAAiC;QAChE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC;IACxC,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;;;OAGG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACzC,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,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssistantChatMessage, ChatMessages, CompletionPostResponse, MessageToolCalls, TokenUsage } from './client/api/schema/index.js';
|
|
1
|
+
import type { AssistantChatMessage, ChatMessages, CompletionPostResponse, LlmChoice, MessageToolCalls, ModuleResults, TokenUsage } from './client/api/schema/index.js';
|
|
2
2
|
import type { OrchestrationStream } from './orchestration-stream.js';
|
|
3
3
|
/**
|
|
4
4
|
* Orchestration stream response.
|
|
@@ -49,10 +49,19 @@ export declare class OrchestrationStreamResponse<T> {
|
|
|
49
49
|
* @returns The assistant message.
|
|
50
50
|
*/
|
|
51
51
|
getAssistantMessage(choiceIndex?: number): AssistantChatMessage | undefined;
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Gets the intermediate results from the orchestration response.
|
|
54
|
+
* @returns The intermediate results.
|
|
55
|
+
*/
|
|
56
|
+
getIntermediateResults(): ModuleResults | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Parses the response and returns the choice by index.
|
|
59
|
+
* @param index - The index of the choice to find.
|
|
60
|
+
* @returns An {@link LLMChoice} object associated with the index.
|
|
61
|
+
*/
|
|
62
|
+
findChoiceByIndex(index: number): LlmChoice | undefined;
|
|
53
63
|
get stream(): OrchestrationStream<T>;
|
|
54
64
|
private getChoices;
|
|
55
|
-
private findChoiceByIndex;
|
|
56
65
|
private isStreamOpen;
|
|
57
66
|
/**
|
|
58
67
|
* @internal
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"orchestration-stream-response.d.ts","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEp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.
|
|
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
|
}
|
|
@@ -87,11 +87,26 @@ export class OrchestrationStreamResponse {
|
|
|
87
87
|
}
|
|
88
88
|
return this.findChoiceByIndex(choiceIndex)?.message;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Gets the intermediate results from the orchestration response.
|
|
92
|
+
* @returns The intermediate results.
|
|
93
|
+
*/
|
|
94
|
+
getIntermediateResults() {
|
|
91
95
|
if (this.isStreamOpen()) {
|
|
92
96
|
return;
|
|
93
97
|
}
|
|
94
|
-
return this._data;
|
|
98
|
+
return this._data.intermediate_results;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Parses the response and returns the choice by index.
|
|
102
|
+
* @param index - The index of the choice to find.
|
|
103
|
+
* @returns An {@link LLMChoice} object associated with the index.
|
|
104
|
+
*/
|
|
105
|
+
findChoiceByIndex(index) {
|
|
106
|
+
if (this.isStreamOpen()) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
return this.getChoices().find((c) => c.index === index);
|
|
95
110
|
}
|
|
96
111
|
get stream() {
|
|
97
112
|
if (!this._stream) {
|
|
@@ -100,10 +115,7 @@ export class OrchestrationStreamResponse {
|
|
|
100
115
|
return this._stream;
|
|
101
116
|
}
|
|
102
117
|
getChoices() {
|
|
103
|
-
return this._data.
|
|
104
|
-
}
|
|
105
|
-
findChoiceByIndex(index) {
|
|
106
|
-
return this.getChoices().find((c) => c.index === index);
|
|
118
|
+
return this._data.final_result?.choices ?? [];
|
|
107
119
|
}
|
|
108
120
|
isStreamOpen() {
|
|
109
121
|
if (this._openStream) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream-response.js","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestration-stream-response.js","sourceRoot":"","sources":["../src/orchestration-stream-response.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAC/B,WAAW,GAAG,IAAI,CAAC;IACnB,KAAK,GAAoC,EAAE,CAAC;IAC3C,OAAO,CAAqC;IAEpD;;;OAGG;IACH,aAAa;QACX,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,WAAW,GAAG,CAAC;QAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,WAAW,GAAG,CAAC;QACxB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACnD,OAAO,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,WAAW,GAAG,CAAC;QAC1B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC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CAAC,CAAC,CAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC;IAChD,CAAC;IAEO,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"}
|
|
@@ -31,7 +31,7 @@ export class OrchestrationStream extends SseStream {
|
|
|
31
31
|
throw new Error('Response is required to process completion post response streaming.');
|
|
32
32
|
}
|
|
33
33
|
for await (const chunk of stream) {
|
|
34
|
-
mergeStreamResponse(response, chunk.
|
|
34
|
+
mergeStreamResponse(response, chunk._data);
|
|
35
35
|
yield chunk;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-stream.js","sourceRoot":"","sources":["../src/orchestration-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAKtD;;GAEG;AACH,MAAM,OAAO,mBAA0B,SAAQ,SAAe;IAgFnD;IA/ET;;;;;OAKG;IACI,MAAM,CAAC,OA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