From b850dc90358b3e116bc9c52b67429167c2d5e778 Mon Sep 17 00:00:00 2001 From: Junjie Tang <33489572+jjtang1985@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:48:54 +0100 Subject: [PATCH] fix: Remove grounding module related types (#270) * updates for non breaking changes * compatibility notes * fix * updates * remove compatibility notes --------- Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- .../azure-content-safety-filter-config.ts | 2 +- .../src/client/api/schema/azure-threshold.ts | 2 +- .../src/client/api/schema/chat-message.ts | 3 -- .../api/schema/completion-post-request.ts | 3 +- .../api/schema/completion-post-response.ts | 2 +- .../src/client/api/schema/dpi-config.ts | 4 +- .../src/client/api/schema/dpi-entities.ts | 2 +- .../client/api/schema/dpi-entity-config.ts | 2 +- .../src/client/api/schema/error-response.ts | 2 +- .../api/schema/generic-module-result.ts | 6 +-- .../src/client/api/schema/grounding-filter.ts | 41 ------------------- .../api/schema/grounding-module-config.ts | 30 -------------- .../src/client/api/schema/index.ts | 2 - .../src/client/api/schema/llm-choice.ts | 6 +-- .../client/api/schema/llm-module-config.ts | 4 +- .../src/client/api/schema/module-configs.ts | 2 - .../src/client/api/schema/token-usage.ts | 8 ++-- 17 files changed, 21 insertions(+), 100 deletions(-) delete mode 100644 packages/orchestration/src/client/api/schema/grounding-filter.ts delete mode 100644 packages/orchestration/src/client/api/schema/grounding-module-config.ts diff --git a/packages/orchestration/src/client/api/schema/azure-content-safety-filter-config.ts b/packages/orchestration/src/client/api/schema/azure-content-safety-filter-config.ts index 2f3e77ff..14b2dda3 100644 --- a/packages/orchestration/src/client/api/schema/azure-content-safety-filter-config.ts +++ b/packages/orchestration/src/client/api/schema/azure-content-safety-filter-config.ts @@ -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'; diff --git a/packages/orchestration/src/client/api/schema/azure-threshold.ts b/packages/orchestration/src/client/api/schema/azure-threshold.ts index c423d917..7c3a827d 100644 --- a/packages/orchestration/src/client/api/schema/azure-threshold.ts +++ b/packages/orchestration/src/client/api/schema/azure-threshold.ts @@ -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; diff --git a/packages/orchestration/src/client/api/schema/chat-message.ts b/packages/orchestration/src/client/api/schema/chat-message.ts index e7036602..910982aa 100644 --- a/packages/orchestration/src/client/api/schema/chat-message.ts +++ b/packages/orchestration/src/client/api/schema/chat-message.ts @@ -12,8 +12,5 @@ export type ChatMessage = { * @example "user" */ role: string; - /** - * @example "What is SAP S/4HANA?" - */ content: string; } & Record; diff --git a/packages/orchestration/src/client/api/schema/completion-post-request.ts b/packages/orchestration/src/client/api/schema/completion-post-request.ts index f1fbbbbf..01ecf812 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-request.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-request.ts @@ -12,13 +12,12 @@ export type CompletionPostRequest = { orchestration_config: OrchestrationConfig; /** * @example { - * "groundingInput": "What is SAP Joule?", * "inputContext": "optimizing supply chain management" * } */ input_params?: Record; /** - * 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; diff --git a/packages/orchestration/src/client/api/schema/completion-post-response.ts b/packages/orchestration/src/client/api/schema/completion-post-response.ts index 6dd05dd4..3cb024ab 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-response.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-response.ts @@ -10,7 +10,7 @@ import type { LlmModuleResult } from './llm-module-result.js'; */ export type CompletionPostResponse = { /** - * ID of the request. + * ID of the request * @example "d4a67ea1-2bf9-4df7-8105-d48203ccff76" */ request_id: string; diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index 8a4d7a9a..524dca17 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -9,11 +9,11 @@ import type { DpiEntityConfig } from './dpi-entity-config.js'; */ 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'; /** diff --git a/packages/orchestration/src/client/api/schema/dpi-entities.ts b/packages/orchestration/src/client/api/schema/dpi-entities.ts index 8ad075c1..13923bad 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entities.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entities.ts @@ -5,7 +5,7 @@ */ /** - * Default entities supported by data privacy and integration service. + * Default entities supported by data privacy and integration service */ export type DpiEntities = | 'profile-person' diff --git a/packages/orchestration/src/client/api/schema/dpi-entity-config.ts b/packages/orchestration/src/client/api/schema/dpi-entity-config.ts index a59d7531..f48ac680 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entity-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entity-config.ts @@ -9,7 +9,7 @@ import type { DpiEntities } from './dpi-entities.js'; */ export type DpiEntityConfig = { /** - * Type of entity to be masked. + * Type of entity to be masked */ type: DpiEntities; } & Record; diff --git a/packages/orchestration/src/client/api/schema/error-response.ts b/packages/orchestration/src/client/api/schema/error-response.ts index 142c97e0..4846ca58 100644 --- a/packages/orchestration/src/client/api/schema/error-response.ts +++ b/packages/orchestration/src/client/api/schema/error-response.ts @@ -21,7 +21,7 @@ export type ErrorResponse = { */ message: string; /** - * Where the error occurred. + * Where the error occurred * @example "LLM Module" */ location: string; diff --git a/packages/orchestration/src/client/api/schema/generic-module-result.ts b/packages/orchestration/src/client/api/schema/generic-module-result.ts index 8c7fbf38..fdc60dd9 100644 --- a/packages/orchestration/src/client/api/schema/generic-module-result.ts +++ b/packages/orchestration/src/client/api/schema/generic-module-result.ts @@ -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; } & Record; diff --git a/packages/orchestration/src/client/api/schema/grounding-filter.ts b/packages/orchestration/src/client/api/schema/grounding-filter.ts deleted file mode 100644 index 2ada4fcf..00000000 --- a/packages/orchestration/src/client/api/schema/grounding-filter.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 'GroundingFilter' schema. - */ -export type GroundingFilter = { - /** - * @example "string" - */ - id?: string; - /** - * @example {} - */ - search_configuration?: Record; - /** - * @example [ - * "*" - * ] - */ - data_repositories?: string[]; - /** - * @example "help.sap.com" - */ - data_repository_type?: 'vector' | 'help.sap.com'; - /** - * @example [] - */ - data_repository_metadata?: Record[]; - /** - * @example [] - */ - document_metadata?: Record[]; - /** - * @example [] - */ - chunk_metadata?: Record[]; -} & Record; diff --git a/packages/orchestration/src/client/api/schema/grounding-module-config.ts b/packages/orchestration/src/client/api/schema/grounding-module-config.ts deleted file mode 100644 index 5523d085..00000000 --- a/packages/orchestration/src/client/api/schema/grounding-module-config.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 { GroundingFilter } from './grounding-filter.js'; -/** - * Representation of the 'GroundingModuleConfig' schema. - */ -export type GroundingModuleConfig = { - /** - * @example "document_grounding_service" - */ - grounding_service: 'document_grounding_service'; - grounding_service_configuration?: { - /** - * Document grounding service filters to be used. - */ - filters?: GroundingFilter[]; - /** - * Contains the input parameters used for grounding input questions. - */ - grounding_input_parameters: string[]; - /** - * Parameter name used for grounding output. - * @example "groundingOutput" - */ - grounding_output_parameter: string; - } & Record; -} & Record; diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index 7d72e857..cceaeecb 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -27,6 +27,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'; diff --git a/packages/orchestration/src/client/api/schema/llm-choice.ts b/packages/orchestration/src/client/api/schema/llm-choice.ts index 3040b1a7..86776d01 100644 --- a/packages/orchestration/src/client/api/schema/llm-choice.ts +++ b/packages/orchestration/src/client/api/schema/llm-choice.ts @@ -9,16 +9,16 @@ import type { ChatMessage } from './chat-message.js'; */ export type LlmChoice = { /** - * Index of the choice. + * Index of the choice */ index: number; message: ChatMessage; /** - * Log probabilities. + * Log probabilities */ logprobs?: Record; /** - * Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module. + * Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module * @example "stop" */ finish_reason: string; diff --git a/packages/orchestration/src/client/api/schema/llm-module-config.ts b/packages/orchestration/src/client/api/schema/llm-module-config.ts index d4566533..89dc2b64 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-config.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-config.ts @@ -9,12 +9,12 @@ */ export type LlmModuleConfig = { /** - * Model name as in LLM Access configuration. + * Model name as in LLM Access configuration * @example "gpt-4" */ model_name: string; /** - * Model parameters. + * Model parameters * @example { * "max_tokens": 300, * "temperature": 0.1, diff --git a/packages/orchestration/src/client/api/schema/module-configs.ts b/packages/orchestration/src/client/api/schema/module-configs.ts index b9967b5f..d89d65a6 100644 --- a/packages/orchestration/src/client/api/schema/module-configs.ts +++ b/packages/orchestration/src/client/api/schema/module-configs.ts @@ -7,7 +7,6 @@ import type { LlmModuleConfig } from './llm-module-config.js'; import type { TemplatingModuleConfig } from './templating-module-config.js'; import type { FilteringModuleConfig } from './filtering-module-config.js'; import type { MaskingModuleConfig } from './masking-module-config.js'; -import type { GroundingModuleConfig } from './grounding-module-config.js'; /** * Representation of the 'ModuleConfigs' schema. */ @@ -16,5 +15,4 @@ export type ModuleConfigs = { templating_module_config: TemplatingModuleConfig; filtering_module_config?: FilteringModuleConfig; masking_module_config?: MaskingModuleConfig; - grounding_module_config?: GroundingModuleConfig; } & Record; diff --git a/packages/orchestration/src/client/api/schema/token-usage.ts b/packages/orchestration/src/client/api/schema/token-usage.ts index 9d31be76..cbf5ffa6 100644 --- a/packages/orchestration/src/client/api/schema/token-usage.ts +++ b/packages/orchestration/src/client/api/schema/token-usage.ts @@ -5,21 +5,21 @@ */ /** - * Usage of tokens in the response. + * Usage of tokens in the response */ export type TokenUsage = { /** - * Number of tokens used in the input. + * Number of tokens used in the input * @example 20 */ completion_tokens: number; /** - * Number of tokens used in the output. + * Number of tokens used in the output * @example 30 */ prompt_tokens: number; /** - * Total number of tokens used. + * Total number of tokens used * @example 50 */ total_tokens: number;