Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: Update orchestration spec #269

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { AzureContentSafety } from './azure-content-safety.js';
*/
export type AzureContentSafetyFilterConfig = {
/**
* String represents name of the filter provider.
* String represents name of the filter provider
* @example "azure_content_safety"
*/
type: 'azure_content_safety';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/
import type { AzureThreshold } from './azure-threshold.js';
/**
* Filter configuration for Azure Content Safety.
* Filter configuration for Azure Content Safety
*/
export interface AzureContentSafety {
export type AzureContentSafety = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
Hate?: AzureThreshold;
SelfHarm?: AzureThreshold;
Sexual?: AzureThreshold;
Violence?: AzureThreshold;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/

/**
* Representation of the 'AzureThreshold' schema.
* Threshold for the filter. Setting it to `0` blocks content with low severity, whereas `6` is the most permissive and blocks only the highest severity
*/
export type AzureThreshold = 0 | 2 | 4 | 6;
13 changes: 13 additions & 0 deletions packages/orchestration/src/client/api/schema/chat-delta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'ChatDelta' schema.
*/
export type ChatDelta = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
role?: string;
content: string;
} & Record<string, any>;
3 changes: 0 additions & 3 deletions packages/orchestration/src/client/api/schema/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ export type ChatMessage = {
* @example "user"
*/
role: string;
/**
* @example "What is SAP S/4HANA?"
*/
content: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export type CompletionPostRequest = {
orchestration_config: OrchestrationConfig;
/**
* @example {
* "groundingInput": "What is SAP Joule?",
* "inputContext": "optimizing supply chain management"
* }
*/
input_params?: Record<string, string>;
/**
* History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message.
* History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message
*/
messages_history?: ChatMessages;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { ModuleResults } from './module-results.js';
import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js';
/**
* Representation of the 'CompletionPostResponseStreaming' schema.
*/
export type CompletionPostResponseStreaming = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* ID of the request
*/
request_id: string;
module_results?: ModuleResults;
orchestration_result?: LLMModuleResultStreaming;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { ModuleResults } from './module-results.js';
import type { LlmModuleResult } from './llm-module-result.js';
import type { LLMModuleResult } from './llm-module-result.js';
/**
* Representation of the 'CompletionPostResponse' schema.
*/
export type CompletionPostResponse = {
/**
* ID of the request.
* ID of the request
* @example "d4a67ea1-2bf9-4df7-8105-d48203ccff76"
*/
request_id: string;
module_results: ModuleResults;
orchestration_result: LlmModuleResult;
orchestration_result: LLMModuleResult;
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
} & Record<string, any>;
12 changes: 6 additions & 6 deletions packages/orchestration/src/client/api/schema/dpi-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { DpiEntityConfig } from './dpi-entity-config.js';
import type { DPIEntityConfig } from './dpi-entity-config.js';
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Representation of the 'DpiConfig' schema.
* Representation of the 'DPIConfig' schema.
*/
export type DpiConfig = {
export type DPIConfig = {
/**
* Type of masking service provider.
* Type of masking service provider
*/
type: 'sap_data_privacy_integration';
/**
* Type of masking method to be used.
* Type of masking method to be used
*/
method: 'anonymization' | 'pseudonymization';
/**
* List of entities to be masked
* Min Items: 1.
*/
entities: DpiEntityConfig[];
entities: DPIEntityConfig[];
} & Record<string, any>;
4 changes: 2 additions & 2 deletions packages/orchestration/src/client/api/schema/dpi-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

/**
* Default entities supported by data privacy and integration service.
* Default entities supported by data privacy and integration service
*/
export type DpiEntities =
export type DPIEntities =
| 'profile-person'
| 'profile-org'
| 'profile-university'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { DpiEntities } from './dpi-entities.js';
import type { DPIEntities } from './dpi-entities.js';
/**
* Representation of the 'DpiEntityConfig' schema.
* Representation of the 'DPIEntityConfig' schema.
*/
export type DpiEntityConfig = {
export type DPIEntityConfig = {
/**
* Type of entity to be masked.
* Type of entity to be masked
*/
type: DpiEntities;
type: DPIEntities;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type ErrorResponse = {
*/
message: string;
/**
* Where the error occurred.
* Where the error occurred
* @example "LLM Module"
*/
location: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { FilteringConfig } from './filtering-config.js';
import type { InputFilteringConfig } from './input-filtering-config.js';
import type { OutputFilteringConfig } from './output-filtering-config.js';
/**
* Representation of the 'FilteringModuleConfig' schema.
*/
export interface FilteringModuleConfig {
export type FilteringModuleConfig = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* List of provider type and filters.
* List of provider type and filters
*/
input?: FilteringConfig;
input?: InputFilteringConfig;
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* List of provider type and filters.
* List of provider type and filters
*/
output?: FilteringConfig;
}
output?: OutputFilteringConfig;
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Stream options for output filtering. Will be ignored if stream is false.
*/
export type FilteringStreamOptions = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Number of characters that should be additionally sent to content filtering services from previous chunks as additional context.
* Maximum: 10000.
*/
overlap?: number;
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/

/**
* Generic module result.
* Generic module result
*/
export type GenericModuleResult = {
/**
* Some message created from the module.
* Some message created from the module
* @example "Input to LLM is masked successfully."
*/
message: string;
/**
* Additional data object from the module.
* Additional data object from the module
*/
data?: Record<string, any>;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Options for streaming. Will be ignored if stream is false.
*/
export type GlobalStreamOptions = {
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Number of characters per chunk that post-LLM modules operate on.
* Default: 100.
* Maximum: 10000.
* Minimum: 1.
*/
chunk_size?: number;
};
41 changes: 0 additions & 41 deletions packages/orchestration/src/client/api/schema/grounding-filter.ts

This file was deleted.

This file was deleted.

13 changes: 10 additions & 3 deletions packages/orchestration/src/client/api/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@
export * from './completion-post-request.js';
export * from './chat-messages.js';
export * from './chat-message.js';
export * from './chat-delta.js';
export * from './completion-post-response.js';
export * from './completion-post-response-streaming.js';
export * from './orchestration-config.js';
export * from './module-configs.js';
export * from './module-results.js';
export * from './global-stream-options.js';
export * from './llm-module-config.js';
export * from './generic-module-result.js';
export * from './llm-module-result.js';
export * from './llm-module-result-synchronous.js';
export * from './llm-module-result-streaming.js';
export * from './llm-choice.js';
export * from './llm-choice-streaming.js';
export * from './token-usage.js';
export * from './templating-module-config.js';
export * from './template.js';
export * from './filtering-module-config.js';
export * from './filtering-config.js';
export * from './input-filtering-config.js';
export * from './output-filtering-config.js';
export * from './filtering-stream-options.js';
export * from './filter-config.js';
export * from './azure-content-safety-filter-config.js';
export * from './azure-content-safety.js';
Expand All @@ -27,6 +36,4 @@ export * from './masking-provider-config.js';
export * from './dpi-config.js';
export * from './dpi-entity-config.js';
export * from './dpi-entities.js';
export * from './grounding-module-config.js';
export * from './grounding-filter.js';
export * from './error-response.js';
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
import type { FilterConfig } from './filter-config.js';
/**
* Representation of the 'FilteringConfig' schema.
* Representation of the 'InputFilteringConfig' schema.
*/
export type FilteringConfig = {
export type InputFilteringConfig = {
/**
* Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering).
* Min Items: 1.
*/
filters: FilterConfig[];
} & Record<string, any>;
};
jjtang1985 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading