@sap-ai-sdk/orchestration 1.16.1-20250716013258.0 → 1.16.1-20250718013320.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.
@@ -1,5 +1,5 @@
1
1
  import type { HttpResponse } from '@sap-cloud-sdk/http-client';
2
- import type { CompletionPostResponse, TokenUsage, ChatMessages, AssistantChatMessage, MessageToolCalls } from './client/api/schema/index.js';
2
+ import type { CompletionPostResponse, TokenUsage, ChatMessages, AssistantChatMessage, MessageToolCalls, LlmChoice } from './client/api/schema/index.js';
3
3
  /**
4
4
  * Representation of an orchestration response.
5
5
  */
@@ -52,7 +52,12 @@ export declare class OrchestrationResponse {
52
52
  * @returns The assistant message.
53
53
  */
54
54
  getAssistantMessage(choiceIndex?: number): AssistantChatMessage | undefined;
55
+ /**
56
+ * Parses the response and returns the choice by index.
57
+ * @param index - The index of the choice to find.
58
+ * @returns An {@link LLMChoice} object associated with the index.
59
+ */
60
+ findChoiceByIndex(index: number): LlmChoice | undefined;
55
61
  private getChoices;
56
- private findChoiceByIndex;
57
62
  }
58
63
  //# sourceMappingURL=orchestration-response.d.ts.map
@@ -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,EACjB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,qBAAa,qBAAqB;aAKJ,WAAW,EAAE,YAAY;IAJrD;;OAEG;IACH,SAAgB,IAAI,EAAE,sBAAsB,CAAC;gBACjB,WAAW,EAAE,YAAY;IAIrD;;;OAGG;IACH,aAAa,IAAI,UAAU;IAG3B;;;;OAIG;IACH,eAAe,CAAC,WAAW,SAAI,GAAG,MAAM,GAAG,SAAS;IAIpD;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AoB,GAAG,SAAS;IAItE;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIvD,OAAO,CAAC,UAAU;CAGnB"}
@@ -76,14 +76,16 @@ export class OrchestrationResponse {
76
76
  getAssistantMessage(choiceIndex = 0) {
77
77
  return this.findChoiceByIndex(choiceIndex)?.message;
78
78
  }
79
- getChoices() {
80
- return this.data.orchestration_result.choices;
81
- }
79
+ /**
80
+ * Parses the response and returns the choice by index.
81
+ * @param index - The index of the choice to find.
82
+ * @returns An {@link LLMChoice} object associated with the index.
83
+ */
82
84
  findChoiceByIndex(index) {
83
- // TODO: replace cast with LLMChoice[] after the bug in orchestration, where
84
- // 'role' in ResponseChatMessage is optional when it should be mandatory, is fixed.
85
- // https://github.com/SAP/ai-sdk-js-backlog/issues/306
86
85
  return this.getChoices().find((c) => c.index === index);
87
86
  }
87
+ getChoices() {
88
+ return this.data.orchestration_result.choices;
89
+ }
88
90
  }
89
91
  //# sourceMappingURL=orchestration-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestration-response.js","sourceRoot":"","sources":["../src/orchestration-response.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAKJ;IAJ5B;;OAEG;IACa,IAAI,CAAyB;IAC7C,YAA4B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAM,CAAC;IAC/C,CAAC;IACD;;;;OAIG;IACH,eAAe,CAAC,WAAW,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,WAAW,GAAG,CAAC;QACxB,MAAM,MAAM,G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AC,WAAW,GAAG,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACnD,OAAO,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,WAAW,GAAG,CAAC;QAC5B,MAAM,QAAQ,GAAkB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAC7D,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,WAAW,GAAG,CAAC;QACjC,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtD,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,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;IAChD,CAAC;CACF"}
@@ -31,7 +31,7 @@ export declare class OrchestrationStreamChunkResponse {
31
31
  /**
32
32
  * Parses the chunk response and returns the choice by index.
33
33
  * @param index - The index of the choice to find.
34
- * @returns An {@link LLMChoiceStreaming} object associated withe index.
34
+ * @returns An {@link LLMChoiceStreaming} object associated with the index.
35
35
  */
36
36
  findChoiceByIndex(index: number): LlmChoiceStreaming | undefined;
37
37
  private getChoices;
@@ -41,7 +41,7 @@ export class OrchestrationStreamChunkResponse {
41
41
  /**
42
42
  * Parses the chunk response and returns the choice by index.
43
43
  * @param index - The index of the choice to find.
44
- * @returns An {@link LLMChoiceStreaming} object associated withe index.
44
+ * @returns An {@link LLMChoiceStreaming} object associated with the index.
45
45
  */
46
46
  findChoiceByIndex(index) {
47
47
  return this.getChoices()?.find((c) => c.index === index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ai-sdk/orchestration",
3
- "version": "1.16.1-20250716013258.0",
3
+ "version": "1.16.1-20250718013320.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.0.2",
24
24
  "yaml": "^2.8.0",
25
- "@sap-ai-sdk/core": "^1.16.1-20250716013258.0",
26
- "@sap-ai-sdk/ai-api": "^1.16.1-20250716013258.0",
27
- "@sap-ai-sdk/prompt-registry": "^1.16.1-20250716013258.0"
25
+ "@sap-ai-sdk/core": "^1.16.1-20250718013320.0",
26
+ "@sap-ai-sdk/ai-api": "^1.16.1-20250718013320.0",
27
+ "@sap-ai-sdk/prompt-registry": "^1.16.1-20250718013320.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@sap-cloud-sdk/http-client": "^4.0.2",