Skip to content

Commit 36c1803

Browse files
authored
feat: Update to Orchestration 0.36.1 (#333)
* feat: Update to Orchestration 0.36.1 * update spec, remove help.sap.com
1 parent 1b4ae61 commit 36c1803

15 files changed

+385
-66
lines changed

packages/orchestration/src/client/api/schema/data-repository-type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
/**
88
* Representation of the 'DataRepositoryType' schema.
99
*/
10-
export type DataRepositoryType = 'vector' | 'help.sap.com' | any;
10+
export type DataRepositoryType = 'vector' | any;

packages/orchestration/src/client/api/schema/dpi-config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ export type DpiConfig = {
2121
* Min Items: 1.
2222
*/
2323
entities: DpiEntityConfig[];
24+
/**
25+
* List of strings that should not be masked
26+
*/
27+
allowlist?: string[];
2428
} & Record<string, any>;

packages/orchestration/src/client/api/schema/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
export * from './completion-post-request.js';
77
export * from './chat-messages.js';
8+
export * from './templating-chat-message.js';
89
export * from './chat-message.js';
910
export * from './chat-delta.js';
1011
export * from './completion-post-response.js';
@@ -23,6 +24,9 @@ export * from './llm-choice-streaming.js';
2324
export * from './token-usage.js';
2425
export * from './templating-module-config.js';
2526
export * from './template.js';
27+
export * from './template-ref.js';
28+
export * from './template-ref-by-id.js';
29+
export * from './template-ref-by-scenario-name-version.js';
2630
export * from './filtering-module-config.js';
2731
export * from './input-filtering-config.js';
2832
export * from './output-filtering-config.js';

packages/orchestration/src/client/api/schema/llm-module-result.ts

+5-34
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,11 @@
33
*
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
6-
import type { LlmChoice } from './llm-choice.js';
7-
import type { TokenUsage } from './token-usage.js';
6+
import type { LLMModuleResultSynchronous } from './llm-module-result-synchronous.js';
7+
import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js';
88
/**
99
* Output of LLM module. Follows the OpenAI spec.
1010
*/
11-
export type LlmModuleResult = {
12-
/**
13-
* ID of the response.
14-
* @example "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr"
15-
*/
16-
id: string;
17-
/**
18-
* Object type.
19-
* @example "chat.completion"
20-
*/
21-
object: string;
22-
/**
23-
* Unix timestamp.
24-
* @example 1722510700
25-
*/
26-
created: number;
27-
/**
28-
* Model name.
29-
* @example "gpt-4"
30-
*/
31-
model: string;
32-
/**
33-
* System fingerprint.
34-
* @example "fp_44709d6fcb"
35-
*/
36-
system_fingerprint?: string;
37-
/**
38-
* Choices.
39-
*/
40-
choices: LlmChoice[];
41-
usage: TokenUsage;
42-
} & Record<string, any>;
11+
export type LlmModuleResult =
12+
| LLMModuleResultSynchronous
13+
| LLMModuleResultStreaming;

packages/orchestration/src/client/api/schema/module-results.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
66
import type { GenericModuleResult } from './generic-module-result.js';
7-
import type { ChatMessages } from './chat-messages.js';
7+
import type { TemplatingChatMessage } from './templating-chat-message.js';
88
import type { LlmModuleResult } from './llm-module-result.js';
99
import type { LlmChoice } from './llm-choice.js';
10+
import type { LLMChoiceStreaming } from './llm-choice-streaming.js';
1011
/**
1112
* Results of each module.
1213
*/
1314
export type ModuleResults = {
1415
grounding?: GenericModuleResult;
15-
templating?: ChatMessages;
16+
templating?: TemplatingChatMessage;
1617
input_masking?: GenericModuleResult;
1718
input_filtering?: GenericModuleResult;
1819
llm?: LlmModuleResult;
1920
output_filtering?: GenericModuleResult;
20-
output_unmasking?: LlmChoice[];
21+
output_unmasking?: (LlmChoice | LLMChoiceStreaming)[];
2122
};

packages/orchestration/src/client/api/schema/orchestration-config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
66
import type { ModuleConfigs } from './module-configs.js';
7+
import type { GlobalStreamOptions } from './global-stream-options.js';
78
/**
89
* Representation of the 'OrchestrationConfig' schema.
910
*/
1011
export type OrchestrationConfig = {
1112
module_configurations: ModuleConfigs;
13+
/**
14+
* If true, the response will be streamed back to the client
15+
*/
16+
stream?: boolean;
17+
stream_options?: GlobalStreamOptions;
1218
} & Record<string, any>;

packages/orchestration/src/client/api/schema/output-filtering-config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
66
import type { FilterConfig } from './filter-config.js';
7+
import type { FilteringStreamOptions } from './filtering-stream-options.js';
78
/**
89
* Representation of the 'OutputFilteringConfig' schema.
910
*/
@@ -13,4 +14,5 @@ export type OutputFilteringConfig = {
1314
* Min Items: 1.
1415
*/
1516
filters: FilterConfig[];
17+
stream_options?: FilteringStreamOptions;
1618
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
3+
*
4+
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
5+
*/
6+
7+
/**
8+
* Representation of the 'TemplateRefByID' schema.
9+
*/
10+
export type TemplateRefByID = {
11+
/**
12+
* ID of the template in prompt registry
13+
* @example "template_id"
14+
*/
15+
id: string;
16+
} & Record<string, any>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
3+
*
4+
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
5+
*/
6+
7+
/**
8+
* Representation of the 'TemplateRefByScenarioNameVersion' schema.
9+
*/
10+
export type TemplateRefByScenarioNameVersion = {
11+
/**
12+
* Scenario name
13+
* @example "some-scenario"
14+
*/
15+
scenario: string;
16+
/**
17+
* Name of the template
18+
* @example "some-template-name"
19+
*/
20+
name: string;
21+
/**
22+
* Version of the template
23+
* @example "some version, can be `latest`"
24+
*/
25+
version: string;
26+
} & Record<string, any>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
3+
*
4+
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
5+
*/
6+
import type { TemplateRefByID } from './template-ref-by-id.js';
7+
import type { TemplateRefByScenarioNameVersion } from './template-ref-by-scenario-name-version.js';
8+
/**
9+
* Representation of the 'TemplateRef' schema.
10+
*/
11+
export type TemplateRef = {
12+
/**
13+
* Reference to a template in the prompt registry by ID or by scenario, name and version
14+
*/
15+
template_ref: TemplateRefByID | TemplateRefByScenarioNameVersion;
16+
} & Record<string, any>;

packages/orchestration/src/client/api/schema/template.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
6-
import type { ChatMessages } from './chat-messages.js';
6+
import type { TemplatingChatMessage } from './templating-chat-message.js';
77
/**
88
* Representation of the 'Template' schema.
99
* @example {
1010
* "template": [
1111
* {
1212
* "role": "user",
13-
* "content": "How can the features of AI in SAP BTP specifially {​{?product}}, be applied to {{?inputContext}}"
13+
* "content": "How can the features of AI in SAP BTP specifically {{?groundingOutput}}, be applied to {{?inputContext}}"
1414
* }
1515
* ],
1616
* "defaults": {
@@ -22,7 +22,7 @@ export type Template = {
2222
/**
2323
* A chat message array to be formatted with values from input_params. Both role and content can be templated. If messages_history is provided, the templated messages will be appended.
2424
*/
25-
template: ChatMessages;
25+
template: TemplatingChatMessage;
2626
/**
2727
* Optional default values for the template. If a parameter has no default it is required.
2828
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
3+
*
4+
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
5+
*/
6+
import type { ChatMessage } from './chat-message.js';
7+
/**
8+
* Representation of the 'TemplatingChatMessage' schema.
9+
* Min Items: 1.
10+
*/
11+
export type TemplatingChatMessage = ChatMessage[];

packages/orchestration/src/client/api/schema/templating-module-config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
55
*/
66
import type { Template } from './template.js';
7+
import type { TemplateRef } from './template-ref.js';
78
/**
89
* Representation of the 'TemplatingModuleConfig' schema.
910
*/
10-
export type TemplatingModuleConfig = Template;
11+
export type TemplatingModuleConfig = Template | TemplateRef;

packages/orchestration/src/orchestration-response.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class OrchestrationResponse {
2121
* @returns Token usage.
2222
*/
2323
getTokenUsage(): TokenUsage {
24-
return this.data.orchestration_result.usage;
24+
return this.data.orchestration_result.usage!;
2525
}
2626
/**
2727
* Reason for stopping the completion.

0 commit comments

Comments
 (0)