@sap-ai-sdk/orchestration 2.0.0-20250909013106.0 → 2.0.0-20250911013109.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/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/orchestration-client.d.ts +2 -2
- package/dist/orchestration-client.d.ts.map +1 -1
- package/dist/orchestration-client.js +5 -6
- package/dist/orchestration-client.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DeploymentIdConfig, ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
|
|
2
|
+
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
|
|
3
|
+
/**
|
|
4
|
+
* Get the deployment ID for an orchestration scenario.
|
|
5
|
+
* @param deploymentConfig - The deployment configuration (resource group or deployment ID).
|
|
6
|
+
* @param destination - The destination to use for the request.
|
|
7
|
+
* @returns The ID of the deployment, if found.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOrchestrationDeploymentId(deploymentConfig: ResourceGroupConfig | DeploymentIdConfig, destination?: HttpDestinationOrFetchOptions): Promise<string>;
|
|
11
|
+
//# sourceMappingURL=deployment-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-resolver.d.ts","sourceRoot":"","sources":["../src/deployment-resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEjF;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,gBAAgB,EAAE,mBAAmB,GAAG,kBAAkB,EAC1D,WAAW,CAAC,EAAE,6BAA6B,GAC1C,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
|
@@ -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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
4
|
+
import type { DeploymentIdConfig, ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
|
|
5
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';
|
|
@@ -18,7 +18,7 @@ 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);
|
|
21
|
+
constructor(config: OrchestrationModuleConfig | string, deploymentConfig?: (ResourceGroupConfig | DeploymentIdConfig) | undefined, destination?: HttpDestinationOrFetchOptions | undefined);
|
|
22
22
|
chatCompletion(request?: ChatCompletionRequest, requestConfig?: CustomRequestConfig): Promise<OrchestrationResponse>;
|
|
23
23
|
stream(request?: ChatCompletionRequest, signal?: AbortSignal, options?: StreamOptions, requestConfig?: CustomRequestConfig): Promise<OrchestrationStreamResponse<OrchestrationStreamChunkResponse>>;
|
|
24
24
|
private executeRequest;
|
|
@@ -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,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AC,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';
|
|
@@ -74,11 +74,10 @@ export class OrchestrationClient {
|
|
|
74
74
|
const body = typeof this.config === 'string'
|
|
75
75
|
? constructCompletionPostRequestFromJsonModuleConfig(JSON.parse(this.config), request, stream)
|
|
76
76
|
: constructCompletionPostRequest(this.config, request, stream, streamOptions);
|
|
77
|
-
const deploymentId = await
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
77
|
+
const deploymentId = await getOrchestrationDeploymentId(this.deploymentConfig ?? {}, this.destination);
|
|
78
|
+
if (!deploymentId) {
|
|
79
|
+
throw new Error('Failed to resolve deployment ID');
|
|
80
|
+
}
|
|
82
81
|
return executeRequest({
|
|
83
82
|
url: `/inference/deployments/${deploymentId}/v2/completion`,
|
|
84
83
|
...(this.deploymentConfig ?? {})
|
|
@@ -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,cA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-ai-sdk/orchestration",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-20250911013109.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@sap-cloud-sdk/util": "^4.1.1",
|
|
24
24
|
"yaml": "^2.8.1",
|
|
25
|
-
"@sap-ai-sdk/core": "^2.0.0-
|
|
26
|
-
"@sap-ai-sdk/ai-api": "^2.0.0-
|
|
27
|
-
"@sap-ai-sdk/prompt-registry": "^2.0.0-
|
|
25
|
+
"@sap-ai-sdk/core": "^2.0.0-20250911013109.0",
|
|
26
|
+
"@sap-ai-sdk/ai-api": "^2.0.0-20250911013109.0",
|
|
27
|
+
"@sap-ai-sdk/prompt-registry": "^2.0.0-20250911013109.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@sap-cloud-sdk/http-client": "^4.1.1",
|