From 16100d4d38ceaca2e516566b8a60ed7b0921584b Mon Sep 17 00:00:00 2001 From: Junjie Tang Date: Wed, 6 Nov 2024 12:50:22 +0100 Subject: [PATCH 1/4] spec updates --- packages/orchestration/src/spec/api.yaml | 355 ++++++++++++----------- 1 file changed, 190 insertions(+), 165 deletions(-) diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index f19aee51a..3ef72aa65 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -1,25 +1,44 @@ openapi: 3.0.0 - info: - title: Internal Orchestration Service API - description: SAP AI Core - Orchestration Service API - contact: - name: SAP AI Core - version: 0.0.1 - + title: Orchestration + description: Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + version: 0.29.3 +x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. servers: - - url: '/v1' - + - url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id} + description: Production endpoint for SAP AI Core + variables: + region: + enum: + - prod.eu-central-1.aws + - prodeuonly.eu-central-1.aws + - prod.us-east-1.aws + - prod.ap-northeast-1.aws + - prod.ap-southeast-2.aws + - prod-eu20.westeurope.azure + - prod-us21.eastus.azure + - prod-eu30.europe-west3.gcp + - prod-us30.us-central1.gcp + default: prod.eu-central-1 + orchestration_deployment_id: + description: The deployment ID of the orchestration service. To be obtained from the SAP AI Core service using the deployments endpoint. + default: x111111 +externalDocs: + description: Documentation for SAP AI Core - Orchestration + url: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration +security: + - Oauth2: [] tags: - name: Orchestrated Completion description: Run an orchestrated completion inference request - paths: /completion: post: tags: - - OrchestrationCompletion + - Orchestration Completion operationId: orchestration.v1.endpoints.create + summary: Orchestrated Completion + description: Run an orchestrated completion inference request requestBody: required: true content: @@ -27,42 +46,25 @@ paths: schema: $ref: '#/components/schemas/CompletionPostRequest' responses: - 200: - description: 'Successful response' + '200': + description: Successful response content: application/json: schema: $ref: '#/components/schemas/CompletionPostResponse' - 400: + '400': $ref: '#/components/responses/BadRequest' default: $ref: '#/components/responses/CommonError' - - /healthz: - get: - tags: - - OrchestrationHealthz - operationId: orchestration.v1.endpoints.healthz - responses: - '200': - description: 'Service is up and running.' - content: - text/plain: - schema: - type: string - example: 'OK' - '503': - description: 'Service is unavailable.' - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: 'Service Unavailable' - components: + securitySchemes: + Oauth2: + type: oauth2 + description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit. + flows: + clientCredentials: + tokenUrl: https://(subdomain_identity_zone).authentication.(host)/oauth/token + scopes: {} schemas: CompletionPostRequest: type: object @@ -74,20 +76,17 @@ components: input_params: type: object example: - groundingInput: 'What is SAP Joule?' - inputContext: 'optimizing supply chain management' + inputContext: optimizing supply chain management additionalProperties: type: string messages_history: allOf: - $ref: '#/components/schemas/ChatMessages' description: 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 - ChatMessages: type: array items: $ref: '#/components/schemas/ChatMessage' - ChatMessage: type: object required: @@ -99,8 +98,16 @@ components: example: user content: type: string - example: 'What is SAP S/4HANA?' - + ChatDelta: + type: object + required: + - content + properties: + role: + type: string + content: + type: string + default: '' CompletionPostResponse: type: object required: @@ -111,12 +118,23 @@ components: request_id: description: ID of the request type: string - example: 'd4a67ea1-2bf9-4df7-8105-d48203ccff76' + example: d4a67ea1-2bf9-4df7-8105-d48203ccff76 module_results: $ref: '#/components/schemas/ModuleResults' orchestration_result: $ref: '#/components/schemas/LLMModuleResult' - + CompletionPostResponseStreaming: + type: object + required: + - request_id + properties: + request_id: + description: ID of the request + type: string + module_results: + $ref: '#/components/schemas/ModuleResults' + orchestration_result: + $ref: '#/components/schemas/LLMModuleResultStreaming' OrchestrationConfig: type: object required: @@ -124,7 +142,12 @@ components: properties: module_configurations: $ref: '#/components/schemas/ModuleConfigs' - + stream: + type: boolean + description: If true, the response will be streamed back to the client + default: false + stream_options: + $ref: '#/components/schemas/GlobalStreamOptions' ModuleConfigs: type: object required: @@ -139,16 +162,11 @@ components: $ref: '#/components/schemas/FilteringModuleConfig' masking_module_config: $ref: '#/components/schemas/MaskingModuleConfig' - grounding_module_config: - $ref: '#/components/schemas/GroundingModuleConfig' - ModuleResults: description: Results of each module. type: object additionalProperties: false properties: - grounding: - $ref: '#/components/schemas/GenericModuleResult' templating: $ref: '#/components/schemas/ChatMessages' input_masking: @@ -162,9 +180,20 @@ components: output_unmasking: type: array items: - $ref: '#/components/schemas/LLMChoice' - - # --- LLM MODULE --- + oneOf: + - $ref: '#/components/schemas/LLMChoice' + - $ref: '#/components/schemas/LLMChoiceStreaming' + GlobalStreamOptions: + description: Options for streaming. Will be ignored if stream is false. + type: object + additionalProperties: false + properties: + chunk_size: + type: integer + description: Number of characters per chunk that post-LLM modules operate on. + default: 100 + minimum: 1 + maximum: 10000 LLMModuleConfig: type: object required: @@ -173,7 +202,7 @@ components: properties: model_name: description: Model name as in LLM Access configuration - example: 'gpt-4' + example: gpt-4 type: string model_params: description: Model parameters @@ -187,8 +216,7 @@ components: model_version: description: Version of the model to use type: string - default: 'latest' - + default: latest GenericModuleResult: type: object description: Generic module result @@ -202,8 +230,12 @@ components: data: type: object description: Additional data object from the module - LLMModuleResult: + description: Output of LLM module. Follows the OpenAI spec. + oneOf: + - $ref: '#/components/schemas/LLMModuleResultSynchronous' + - $ref: '#/components/schemas/LLMModuleResultStreaming' + LLMModuleResultSynchronous: type: object description: Output of LLM module. Follows the OpenAI spec. required: @@ -217,7 +249,7 @@ components: id: type: string description: ID of the response - example: 'chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr' + example: chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr object: type: string description: Object type @@ -229,11 +261,11 @@ components: model: type: string description: Model name - example: 'gpt-4' + example: gpt-4 system_fingerprint: type: string description: System fingerprint - example: 'fp_44709d6fcb' + example: fp_44709d6fcb choices: type: array description: Choices @@ -241,7 +273,38 @@ components: $ref: '#/components/schemas/LLMChoice' usage: $ref: '#/components/schemas/TokenUsage' - + LLMModuleResultStreaming: + type: object + description: Output of LLM module. Follows the OpenAI spec. + required: + - id + - object + - created + - model + - choices + properties: + id: + type: string + description: ID of the response + object: + type: string + description: Object type + created: + type: integer + description: Unix timestamp + model: + type: string + description: Model name + system_fingerprint: + type: string + description: System fingerprint + choices: + type: array + description: Choices + items: + $ref: '#/components/schemas/LLMChoiceStreaming' + usage: + $ref: '#/components/schemas/TokenUsage' LLMChoice: type: object required: @@ -264,9 +327,29 @@ components: type: number finish_reason: type: string - description: "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" + description: 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 - + LLMChoiceStreaming: + type: object + required: + - index + - delta + properties: + index: + type: integer + description: Index of the choice + delta: + $ref: '#/components/schemas/ChatDelta' + logprobs: + type: object + description: Log probabilities + additionalProperties: + type: array + items: + type: number + finish_reason: + type: string + description: Reason for stopping the model TokenUsage: type: object description: Usage of tokens in the response @@ -287,10 +370,10 @@ components: type: integer description: Total number of tokens used example: 50 - - # --- Templating Module --- - TemplatingModuleConfig: + oneOf: + - $ref: '#/components/schemas/Template' + Template: type: object required: - template @@ -305,28 +388,38 @@ components: example: template: - role: user - content: 'How can the features of AI in SAP BTP specifially {{?groundingOutput}}, be applied to {{?inputContext}}' + content: How can the features of AI in SAP BTP specifially {​{?product}}, be applied to {​{?inputContext}} defaults: inputContext: The default text that will be used in the template if inputContext is not set - - # --- Filtering Module --- FilteringModuleConfig: type: object properties: input: allOf: - - $ref: '#/components/schemas/FilteringConfig' + - $ref: '#/components/schemas/InputFilteringConfig' description: List of provider type and filters output: allOf: - - $ref: '#/components/schemas/FilteringConfig' + - $ref: '#/components/schemas/OutputFilteringConfig' description: List of provider type and filters additionalProperties: false - - FilteringConfig: + InputFilteringConfig: + type: object + required: + - filters + additionalProperties: false + properties: + filters: + description: Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering). + type: array + minItems: 1 + items: + $ref: '#/components/schemas/FilterConfig' + OutputFilteringConfig: type: object required: - filters + additionalProperties: false properties: filters: description: Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering). @@ -334,11 +427,22 @@ components: minItems: 1 items: $ref: '#/components/schemas/FilterConfig' - + stream_options: + $ref: '#/components/schemas/FilteringStreamOptions' + FilteringStreamOptions: + description: Stream options for output filtering. Will be ignored if stream is false. + type: object + additionalProperties: false + properties: + overlap: + type: integer + description: Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. + default: 0 + minimum: 0 + maximum: 10000 FilterConfig: oneOf: - $ref: '#/components/schemas/AzureContentSafetyFilterConfig' - AzureContentSafetyFilterConfig: type: object required: @@ -352,32 +456,28 @@ components: example: azure_content_safety config: $ref: '#/components/schemas/AzureContentSafety' - AzureContentSafety: description: Filter configuration for Azure Content Safety type: object additionalProperties: false properties: - 'Hate': + Hate: $ref: '#/components/schemas/AzureThreshold' - 'SelfHarm': + SelfHarm: $ref: '#/components/schemas/AzureThreshold' - 'Sexual': + Sexual: $ref: '#/components/schemas/AzureThreshold' - 'Violence': + Violence: $ref: '#/components/schemas/AzureThreshold' - AzureThreshold: type: integer + description: 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 enum: - 0 - 2 - 4 - 6 example: 0 - - # --- Masking module --- - MaskingModuleConfig: type: object required: @@ -390,11 +490,9 @@ components: $ref: '#/components/schemas/MaskingProviderConfig' description: List of masking service providers additionalProperties: false - MaskingProviderConfig: oneOf: - $ref: '#/components/schemas/DPIConfig' - DPIConfig: type: object required: @@ -419,7 +517,6 @@ components: minItems: 1 items: $ref: '#/components/schemas/DPIEntityConfig' - DPIEntityConfig: type: object required: @@ -429,7 +526,6 @@ components: description: Type of entity to be masked allOf: - $ref: '#/components/schemas/DPIEntities' - DPIEntities: description: Default entities supported by data privacy and integration service type: string @@ -459,76 +555,6 @@ components: - profile-sexual-orientation - profile-trade-union - profile-sensitive-data - - # --- Grounding Module --- - - GroundingModuleConfig: - type: object - required: - - grounding_service - properties: - grounding_service: - type: string - enum: - - document_grounding_service - example: document_grounding_service - grounding_service_configuration: - type: object - required: - - grounding_input_parameters - - grounding_output_parameter - properties: - filters: - type: array - items: - $ref: '#/components/schemas/GroundingFilter' - description: Document grounding service filters to be used - grounding_input_parameters: - type: array - items: - type: string - example: groundingInput - description: Contains the input parameters used for grounding input questions - grounding_output_parameter: - type: string - description: Parameter name used for grounding output - example: groundingOutput - GroundingFilter: - type: object - properties: - id: - type: string - example: 'string' - search_configuration: - type: object - example: {} - data_repositories: - type: array - items: - type: string - example: ['*'] - data_repository_type: - type: string - enum: - - vector - - help.sap.com - example: help.sap.com - data_repository_metadata: - type: array - items: - type: object - example: [] - document_metadata: - type: array - items: - type: object - example: [] - chunk_metadata: - type: array - items: - type: object - example: [] - ErrorResponse: type: object required: @@ -539,20 +565,19 @@ components: properties: request_id: type: string - example: 'd4a67ea1-2bf9-4df7-8105-d48203ccff76' + example: d4a67ea1-2bf9-4df7-8105-d48203ccff76 code: type: integer example: 400 message: type: string - example: "Model name must be one of ['gpt-4', ...]" + example: Model name must be one of ['gpt-4', ...] location: type: string description: Where the error occurred - example: 'LLM Module' + example: LLM Module module_results: $ref: '#/components/schemas/ModuleResults' - responses: BadRequest: description: Bad Request From 1661a8a8b33c8751442bcc4fb1f7ce5c37d77b14 Mon Sep 17 00:00:00 2001 From: Junjie Tang Date: Wed, 6 Nov 2024 13:04:25 +0100 Subject: [PATCH 2/4] update clients --- .../azure-content-safety-filter-config.ts | 4 +- .../client/api/schema/azure-content-safety.ts | 8 +-- .../src/client/api/schema/azure-threshold.ts | 2 +- .../src/client/api/schema/chat-delta.ts | 13 ++++ .../src/client/api/schema/chat-message.ts | 3 - .../src/client/api/schema/chat-messages.ts | 2 +- .../api/schema/completion-post-request.ts | 7 +-- .../completion-post-response-streaming.ts | 18 ++++++ .../api/schema/completion-post-response.ts | 8 +-- .../src/client/api/schema/dpi-config.ts | 12 ++-- .../src/client/api/schema/dpi-entities.ts | 4 +- .../client/api/schema/dpi-entity-config.ts | 10 +-- .../src/client/api/schema/error-response.ts | 4 +- .../src/client/api/schema/filter-config.ts | 2 +- .../api/schema/filtering-module-config.ts | 15 ++--- .../api/schema/filtering-stream-options.ts | 16 +++++ .../api/schema/generic-module-result.ts | 6 +- .../api/schema/global-stream-options.ts | 18 ++++++ .../src/client/api/schema/grounding-filter.ts | 41 ------------- .../api/schema/grounding-module-config.ts | 30 --------- .../src/client/api/schema/index.ts | 61 +++++++++++-------- ...ng-config.ts => input-filtering-config.ts} | 8 +-- .../client/api/schema/llm-choice-streaming.ts | 24 ++++++++ .../src/client/api/schema/llm-choice.ts | 12 ++-- .../client/api/schema/llm-module-config.ts | 8 +-- .../api/schema/llm-module-result-streaming.ts | 37 +++++++++++ .../schema/llm-module-result-synchronous.ts | 42 +++++++++++++ .../client/api/schema/llm-module-result.ts | 39 ++---------- .../api/schema/masking-module-config.ts | 6 +- .../api/schema/masking-provider-config.ts | 4 +- .../src/client/api/schema/module-configs.ts | 12 ++-- .../src/client/api/schema/module-results.ts | 18 +++--- .../client/api/schema/orchestration-config.ts | 8 ++- .../api/schema/output-filtering-config.ts | 18 ++++++ .../src/client/api/schema/template.ts | 30 +++++++++ .../api/schema/templating-module-config.ts | 24 +------- .../src/client/api/schema/token-usage.ts | 8 +-- 37 files changed, 343 insertions(+), 239 deletions(-) create mode 100644 packages/orchestration/src/client/api/schema/chat-delta.ts create mode 100644 packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts create mode 100644 packages/orchestration/src/client/api/schema/filtering-stream-options.ts create mode 100644 packages/orchestration/src/client/api/schema/global-stream-options.ts 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 rename packages/orchestration/src/client/api/schema/{filtering-config.ts => input-filtering-config.ts} (69%) create mode 100644 packages/orchestration/src/client/api/schema/llm-choice-streaming.ts create mode 100644 packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts create mode 100644 packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts create mode 100644 packages/orchestration/src/client/api/schema/output-filtering-config.ts create mode 100644 packages/orchestration/src/client/api/schema/template.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 2f3e77ffb..d1f719b13 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 @@ -3,13 +3,13 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureContentSafety } from './azure-content-safety.js'; +import type { AzureContentSafety } from './azure-content-safety'; /** * Representation of the 'AzureContentSafetyFilterConfig' schema. */ 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-content-safety.ts b/packages/orchestration/src/client/api/schema/azure-content-safety.ts index 3df7f9dda..70bdeb4d6 100644 --- a/packages/orchestration/src/client/api/schema/azure-content-safety.ts +++ b/packages/orchestration/src/client/api/schema/azure-content-safety.ts @@ -3,13 +3,13 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureThreshold } from './azure-threshold.js'; +import type { AzureThreshold } from './azure-threshold'; /** - * Filter configuration for Azure Content Safety. + * Filter configuration for Azure Content Safety */ -export interface AzureContentSafety { +export type AzureContentSafety = { Hate?: AzureThreshold; SelfHarm?: AzureThreshold; Sexual?: AzureThreshold; Violence?: AzureThreshold; -} +}; diff --git a/packages/orchestration/src/client/api/schema/azure-threshold.ts b/packages/orchestration/src/client/api/schema/azure-threshold.ts index c423d917b..7c3a827d2 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-delta.ts b/packages/orchestration/src/client/api/schema/chat-delta.ts new file mode 100644 index 000000000..125880852 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/chat-delta.ts @@ -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 = { + role?: string; + content: string; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/chat-message.ts b/packages/orchestration/src/client/api/schema/chat-message.ts index e70366028..910982aaa 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/chat-messages.ts b/packages/orchestration/src/client/api/schema/chat-messages.ts index 6ba214e1c..1956e5fc2 100644 --- a/packages/orchestration/src/client/api/schema/chat-messages.ts +++ b/packages/orchestration/src/client/api/schema/chat-messages.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessage } from './chat-message.js'; +import type { ChatMessage } from './chat-message'; /** * Representation of the 'ChatMessages' schema. */ 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 f1fbbbbfc..31d3ea3d1 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-request.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-request.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { OrchestrationConfig } from './orchestration-config.js'; -import type { ChatMessages } from './chat-messages.js'; +import type { OrchestrationConfig } from './orchestration-config'; +import type { ChatMessages } from './chat-messages'; /** * Representation of the 'CompletionPostRequest' schema. */ @@ -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-streaming.ts b/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts new file mode 100644 index 000000000..0d518b82f --- /dev/null +++ b/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts @@ -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'; +import type { LLMModuleResultStreaming } from './llm-module-result-streaming'; +/** + * Representation of the 'CompletionPostResponseStreaming' schema. + */ +export type CompletionPostResponseStreaming = { + /** + * ID of the request + */ + request_id: string; + module_results?: ModuleResults; + orchestration_result?: LLMModuleResultStreaming; +} & 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 6dd05dd47..4b809fcc2 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-response.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-response.ts @@ -3,17 +3,17 @@ * * 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 { ModuleResults } from './module-results'; +import type { LLMModuleResult } from './llm-module-result'; /** * 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; } & Record; diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index 8a4d7a9a9..4519c6ef2 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -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'; /** - * 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; diff --git a/packages/orchestration/src/client/api/schema/dpi-entities.ts b/packages/orchestration/src/client/api/schema/dpi-entities.ts index 8ad075c1f..2df8c56bb 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entities.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entities.ts @@ -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' 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 a59d7531e..f8597b827 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entity-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entity-config.ts @@ -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'; /** - * 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; diff --git a/packages/orchestration/src/client/api/schema/error-response.ts b/packages/orchestration/src/client/api/schema/error-response.ts index 142c97e0b..c966e7d0c 100644 --- a/packages/orchestration/src/client/api/schema/error-response.ts +++ b/packages/orchestration/src/client/api/schema/error-response.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleResults } from './module-results.js'; +import type { ModuleResults } from './module-results'; /** * Representation of the 'ErrorResponse' schema. */ @@ -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/filter-config.ts b/packages/orchestration/src/client/api/schema/filter-config.ts index 4528aa1fd..270bd1c95 100644 --- a/packages/orchestration/src/client/api/schema/filter-config.ts +++ b/packages/orchestration/src/client/api/schema/filter-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureContentSafetyFilterConfig } from './azure-content-safety-filter-config.js'; +import type { AzureContentSafetyFilterConfig } from './azure-content-safety-filter-config'; /** * Representation of the 'FilterConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/filtering-module-config.ts b/packages/orchestration/src/client/api/schema/filtering-module-config.ts index f4e10b677..ee0239992 100644 --- a/packages/orchestration/src/client/api/schema/filtering-module-config.ts +++ b/packages/orchestration/src/client/api/schema/filtering-module-config.ts @@ -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'; +import type { OutputFilteringConfig } from './output-filtering-config'; /** * Representation of the 'FilteringModuleConfig' schema. */ -export interface FilteringModuleConfig { +export type FilteringModuleConfig = { /** - * List of provider type and filters. + * List of provider type and filters */ - input?: FilteringConfig; + input?: InputFilteringConfig; /** - * List of provider type and filters. + * List of provider type and filters */ - output?: FilteringConfig; -} + output?: OutputFilteringConfig; +}; diff --git a/packages/orchestration/src/client/api/schema/filtering-stream-options.ts b/packages/orchestration/src/client/api/schema/filtering-stream-options.ts new file mode 100644 index 000000000..5beb92f30 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/filtering-stream-options.ts @@ -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 = { + /** + * Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. + * Maximum: 10000. + */ + overlap?: number; +}; 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 8c7fbf382..fdc60dd98 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/global-stream-options.ts b/packages/orchestration/src/client/api/schema/global-stream-options.ts new file mode 100644 index 000000000..90d876b20 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/global-stream-options.ts @@ -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 = { + /** + * Number of characters per chunk that post-LLM modules operate on. + * Default: 100. + * Maximum: 10000. + * Minimum: 1. + */ + chunk_size?: number; +}; 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 2ada4fcfc..000000000 --- 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 5523d085f..000000000 --- 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 7d72e8579..680b9cace 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -3,30 +3,37 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -export * from './completion-post-request.js'; -export * from './chat-messages.js'; -export * from './chat-message.js'; -export * from './completion-post-response.js'; -export * from './orchestration-config.js'; -export * from './module-configs.js'; -export * from './module-results.js'; -export * from './llm-module-config.js'; -export * from './generic-module-result.js'; -export * from './llm-module-result.js'; -export * from './llm-choice.js'; -export * from './token-usage.js'; -export * from './templating-module-config.js'; -export * from './filtering-module-config.js'; -export * from './filtering-config.js'; -export * from './filter-config.js'; -export * from './azure-content-safety-filter-config.js'; -export * from './azure-content-safety.js'; -export * from './azure-threshold.js'; -export * from './masking-module-config.js'; -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'; +export * from './completion-post-request'; +export * from './chat-messages'; +export * from './chat-message'; +export * from './chat-delta'; +export * from './completion-post-response'; +export * from './completion-post-response-streaming'; +export * from './orchestration-config'; +export * from './module-configs'; +export * from './module-results'; +export * from './global-stream-options'; +export * from './llm-module-config'; +export * from './generic-module-result'; +export * from './llm-module-result'; +export * from './llm-module-result-synchronous'; +export * from './llm-module-result-streaming'; +export * from './llm-choice'; +export * from './llm-choice-streaming'; +export * from './token-usage'; +export * from './templating-module-config'; +export * from './template'; +export * from './filtering-module-config'; +export * from './input-filtering-config'; +export * from './output-filtering-config'; +export * from './filtering-stream-options'; +export * from './filter-config'; +export * from './azure-content-safety-filter-config'; +export * from './azure-content-safety'; +export * from './azure-threshold'; +export * from './masking-module-config'; +export * from './masking-provider-config'; +export * from './dpi-config'; +export * from './dpi-entity-config'; +export * from './dpi-entities'; +export * from './error-response'; diff --git a/packages/orchestration/src/client/api/schema/filtering-config.ts b/packages/orchestration/src/client/api/schema/input-filtering-config.ts similarity index 69% rename from packages/orchestration/src/client/api/schema/filtering-config.ts rename to packages/orchestration/src/client/api/schema/input-filtering-config.ts index 343418f81..498b3fcc6 100644 --- a/packages/orchestration/src/client/api/schema/filtering-config.ts +++ b/packages/orchestration/src/client/api/schema/input-filtering-config.ts @@ -3,14 +3,14 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { FilterConfig } from './filter-config.js'; +import type { FilterConfig } from './filter-config'; /** - * 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; +}; diff --git a/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts b/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts new file mode 100644 index 000000000..c4a002c6d --- /dev/null +++ b/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts @@ -0,0 +1,24 @@ +/* + * 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 { ChatDelta } from './chat-delta'; +/** + * Representation of the 'LLMChoiceStreaming' schema. + */ +export type LLMChoiceStreaming = { + /** + * Index of the choice + */ + index: number; + delta: ChatDelta; + /** + * Log probabilities + */ + logprobs?: Record; + /** + * Reason for stopping the model + */ + finish_reason?: string; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/llm-choice.ts b/packages/orchestration/src/client/api/schema/llm-choice.ts index 3040b1a74..8d39a4d3b 100644 --- a/packages/orchestration/src/client/api/schema/llm-choice.ts +++ b/packages/orchestration/src/client/api/schema/llm-choice.ts @@ -3,22 +3,22 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessage } from './chat-message.js'; +import type { ChatMessage } from './chat-message'; /** - * Representation of the 'LlmChoice' schema. + * Representation of the 'LLMChoice' schema. */ -export type LlmChoice = { +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 d45665336..c570cd396 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-config.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-config.ts @@ -5,16 +5,16 @@ */ /** - * Representation of the 'LlmModuleConfig' schema. + * Representation of the 'LLMModuleConfig' schema. */ -export type LlmModuleConfig = { +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/llm-module-result-streaming.ts b/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts new file mode 100644 index 000000000..3b7bdd904 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts @@ -0,0 +1,37 @@ +/* + * 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 { LLMChoiceStreaming } from './llm-choice-streaming'; +import type { TokenUsage } from './token-usage'; +/** + * Output of LLM module. Follows the OpenAI spec. + */ +export type LLMModuleResultStreaming = { + /** + * ID of the response + */ + id: string; + /** + * Object type + */ + object: string; + /** + * Unix timestamp + */ + created: number; + /** + * Model name + */ + model: string; + /** + * System fingerprint + */ + system_fingerprint?: string; + /** + * Choices + */ + choices: LLMChoiceStreaming[]; + usage?: TokenUsage; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts new file mode 100644 index 000000000..08da14551 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts @@ -0,0 +1,42 @@ +/* + * 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 { LLMChoice } from './llm-choice'; +import type { TokenUsage } from './token-usage'; +/** + * Output of LLM module. Follows the OpenAI spec. + */ +export type LLMModuleResultSynchronous = { + /** + * ID of the response + * @example "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr" + */ + id: string; + /** + * Object type + * @example "chat.completion" + */ + object: string; + /** + * Unix timestamp + * @example 1722510700 + */ + created: number; + /** + * Model name + * @example "gpt-4" + */ + model: string; + /** + * System fingerprint + * @example "fp_44709d6fcb" + */ + system_fingerprint?: string; + /** + * Choices + */ + choices: LLMChoice[]; + usage: TokenUsage; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/llm-module-result.ts b/packages/orchestration/src/client/api/schema/llm-module-result.ts index a7c2ad015..5a16c7b19 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result.ts @@ -3,40 +3,11 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LlmChoice } from './llm-choice.js'; -import type { TokenUsage } from './token-usage.js'; +import type { LLMModuleResultSynchronous } from './llm-module-result-synchronous'; +import type { LLMModuleResultStreaming } from './llm-module-result-streaming'; /** * Output of LLM module. Follows the OpenAI spec. */ -export type LlmModuleResult = { - /** - * ID of the response. - * @example "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr" - */ - id: string; - /** - * Object type. - * @example "chat.completion" - */ - object: string; - /** - * Unix timestamp. - * @example 1722510700 - */ - created: number; - /** - * Model name. - * @example "gpt-4" - */ - model: string; - /** - * System fingerprint. - * @example "fp_44709d6fcb" - */ - system_fingerprint?: string; - /** - * Choices. - */ - choices: LlmChoice[]; - usage: TokenUsage; -} & Record; +export type LLMModuleResult = + | LLMModuleResultSynchronous + | LLMModuleResultStreaming; diff --git a/packages/orchestration/src/client/api/schema/masking-module-config.ts b/packages/orchestration/src/client/api/schema/masking-module-config.ts index cf22074a6..a392ab0a1 100644 --- a/packages/orchestration/src/client/api/schema/masking-module-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-module-config.ts @@ -3,14 +3,14 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { MaskingProviderConfig } from './masking-provider-config.js'; +import type { MaskingProviderConfig } from './masking-provider-config'; /** * Representation of the 'MaskingModuleConfig' schema. */ -export interface MaskingModuleConfig { +export type MaskingModuleConfig = { /** * List of masking service providers * Min Items: 1. */ masking_providers: MaskingProviderConfig[]; -} +}; diff --git a/packages/orchestration/src/client/api/schema/masking-provider-config.ts b/packages/orchestration/src/client/api/schema/masking-provider-config.ts index c42f886e6..87757e1b9 100644 --- a/packages/orchestration/src/client/api/schema/masking-provider-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-provider-config.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { DpiConfig } from './dpi-config.js'; +import type { DPIConfig } from './dpi-config'; /** * Representation of the 'MaskingProviderConfig' schema. */ -export type MaskingProviderConfig = DpiConfig; +export type MaskingProviderConfig = DPIConfig; diff --git a/packages/orchestration/src/client/api/schema/module-configs.ts b/packages/orchestration/src/client/api/schema/module-configs.ts index b9967b5f7..6e74d0040 100644 --- a/packages/orchestration/src/client/api/schema/module-configs.ts +++ b/packages/orchestration/src/client/api/schema/module-configs.ts @@ -3,18 +3,16 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -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'; +import type { LLMModuleConfig } from './llm-module-config'; +import type { TemplatingModuleConfig } from './templating-module-config'; +import type { FilteringModuleConfig } from './filtering-module-config'; +import type { MaskingModuleConfig } from './masking-module-config'; /** * Representation of the 'ModuleConfigs' schema. */ export type ModuleConfigs = { - llm_module_config: LlmModuleConfig; + llm_module_config: LLMModuleConfig; 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/module-results.ts b/packages/orchestration/src/client/api/schema/module-results.ts index 15c89b8e7..15df84edc 100644 --- a/packages/orchestration/src/client/api/schema/module-results.ts +++ b/packages/orchestration/src/client/api/schema/module-results.ts @@ -3,19 +3,19 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { GenericModuleResult } from './generic-module-result.js'; -import type { ChatMessages } from './chat-messages.js'; -import type { LlmModuleResult } from './llm-module-result.js'; -import type { LlmChoice } from './llm-choice.js'; +import type { ChatMessages } from './chat-messages'; +import type { GenericModuleResult } from './generic-module-result'; +import type { LLMModuleResult } from './llm-module-result'; +import type { LLMChoice } from './llm-choice'; +import type { LLMChoiceStreaming } from './llm-choice-streaming'; /** * Results of each module. */ -export interface ModuleResults { - grounding?: GenericModuleResult; +export type ModuleResults = { templating?: ChatMessages; input_masking?: GenericModuleResult; input_filtering?: GenericModuleResult; - llm?: LlmModuleResult; + llm?: LLMModuleResult; output_filtering?: GenericModuleResult; - output_unmasking?: LlmChoice[]; -} + output_unmasking?: (LLMChoice | LLMChoiceStreaming)[]; +}; diff --git a/packages/orchestration/src/client/api/schema/orchestration-config.ts b/packages/orchestration/src/client/api/schema/orchestration-config.ts index 6c5f4bbf1..301789837 100644 --- a/packages/orchestration/src/client/api/schema/orchestration-config.ts +++ b/packages/orchestration/src/client/api/schema/orchestration-config.ts @@ -3,10 +3,16 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleConfigs } from './module-configs.js'; +import type { ModuleConfigs } from './module-configs'; +import type { GlobalStreamOptions } from './global-stream-options'; /** * Representation of the 'OrchestrationConfig' schema. */ export type OrchestrationConfig = { module_configurations: ModuleConfigs; + /** + * If true, the response will be streamed back to the client + */ + stream?: boolean; + stream_options?: GlobalStreamOptions; } & Record; diff --git a/packages/orchestration/src/client/api/schema/output-filtering-config.ts b/packages/orchestration/src/client/api/schema/output-filtering-config.ts new file mode 100644 index 000000000..59d6efa76 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/output-filtering-config.ts @@ -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 { FilterConfig } from './filter-config'; +import type { FilteringStreamOptions } from './filtering-stream-options'; +/** + * Representation of the 'OutputFilteringConfig' schema. + */ +export type OutputFilteringConfig = { + /** + * Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering). + * Min Items: 1. + */ + filters: FilterConfig[]; + stream_options?: FilteringStreamOptions; +}; diff --git a/packages/orchestration/src/client/api/schema/template.ts b/packages/orchestration/src/client/api/schema/template.ts new file mode 100644 index 000000000..719029817 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/template.ts @@ -0,0 +1,30 @@ +/* + * 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 { ChatMessages } from './chat-messages'; +/** + * Representation of the 'Template' schema. + * @example { + * "template": [ + * { + * "role": "user", + * "content": "How can the features of AI in SAP BTP specifially {​{?product}}, be applied to {​{?inputContext}}" + * } + * ], + * "defaults": { + * "inputContext": "The default text that will be used in the template if inputContext is not set" + * } + * } + */ +export type Template = { + /** + * 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. + */ + template: ChatMessages; + /** + * Optional default values for the template. If a parameter has no default it is required. + */ + defaults?: Record; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/templating-module-config.ts b/packages/orchestration/src/client/api/schema/templating-module-config.ts index fca0a7ff3..7421cb2a6 100644 --- a/packages/orchestration/src/client/api/schema/templating-module-config.ts +++ b/packages/orchestration/src/client/api/schema/templating-module-config.ts @@ -3,28 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessages } from './chat-messages.js'; +import type { Template } from './template'; /** * Representation of the 'TemplatingModuleConfig' schema. - * @example { - * "template": [ - * { - * "role": "user", - * "content": "How can the features of AI in SAP BTP specifially {{?groundingOutput}}, be applied to {{?inputContext}}" - * } - * ], - * "defaults": { - * "inputContext": "The default text that will be used in the template if inputContext is not set" - * } - * } */ -export type TemplatingModuleConfig = { - /** - * 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. - */ - template: ChatMessages; - /** - * Optional default values for the template. If a parameter has no default it is required. - */ - defaults?: Record; -} & Record; +export type TemplatingModuleConfig = Template; diff --git a/packages/orchestration/src/client/api/schema/token-usage.ts b/packages/orchestration/src/client/api/schema/token-usage.ts index 9d31be769..cbf5ffa63 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; From 1323c7b0b5a7d494b9e5fc61faa19f6bec4f22ac Mon Sep 17 00:00:00 2001 From: Junjie Tang Date: Wed, 6 Nov 2024 13:14:52 +0100 Subject: [PATCH 3/4] update to esm --- .../azure-content-safety-filter-config.ts | 2 +- .../client/api/schema/azure-content-safety.ts | 2 +- .../src/client/api/schema/chat-messages.ts | 2 +- .../api/schema/completion-post-request.ts | 4 +- .../completion-post-response-streaming.ts | 4 +- .../api/schema/completion-post-response.ts | 4 +- .../src/client/api/schema/dpi-config.ts | 2 +- .../client/api/schema/dpi-entity-config.ts | 2 +- .../src/client/api/schema/error-response.ts | 2 +- .../src/client/api/schema/filter-config.ts | 2 +- .../api/schema/filtering-module-config.ts | 4 +- .../src/client/api/schema/index.ts | 68 +++++++++---------- .../api/schema/input-filtering-config.ts | 2 +- .../client/api/schema/llm-choice-streaming.ts | 2 +- .../src/client/api/schema/llm-choice.ts | 2 +- .../api/schema/llm-module-result-streaming.ts | 4 +- .../schema/llm-module-result-synchronous.ts | 4 +- .../client/api/schema/llm-module-result.ts | 4 +- .../api/schema/masking-module-config.ts | 2 +- .../api/schema/masking-provider-config.ts | 2 +- .../src/client/api/schema/module-configs.ts | 8 +-- .../src/client/api/schema/module-results.ts | 10 +-- .../client/api/schema/orchestration-config.ts | 4 +- .../api/schema/output-filtering-config.ts | 4 +- .../src/client/api/schema/template.ts | 2 +- .../api/schema/templating-module-config.ts | 2 +- 26 files changed, 75 insertions(+), 75 deletions(-) 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 d1f719b13..14b2dda38 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 @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureContentSafety } from './azure-content-safety'; +import type { AzureContentSafety } from './azure-content-safety.js'; /** * Representation of the 'AzureContentSafetyFilterConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/azure-content-safety.ts b/packages/orchestration/src/client/api/schema/azure-content-safety.ts index 70bdeb4d6..02d28c890 100644 --- a/packages/orchestration/src/client/api/schema/azure-content-safety.ts +++ b/packages/orchestration/src/client/api/schema/azure-content-safety.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureThreshold } from './azure-threshold'; +import type { AzureThreshold } from './azure-threshold.js'; /** * Filter configuration for Azure Content Safety */ diff --git a/packages/orchestration/src/client/api/schema/chat-messages.ts b/packages/orchestration/src/client/api/schema/chat-messages.ts index 1956e5fc2..6ba214e1c 100644 --- a/packages/orchestration/src/client/api/schema/chat-messages.ts +++ b/packages/orchestration/src/client/api/schema/chat-messages.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessage } from './chat-message'; +import type { ChatMessage } from './chat-message.js'; /** * Representation of the 'ChatMessages' schema. */ 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 31d3ea3d1..01ecf8129 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-request.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-request.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { OrchestrationConfig } from './orchestration-config'; -import type { ChatMessages } from './chat-messages'; +import type { OrchestrationConfig } from './orchestration-config.js'; +import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'CompletionPostRequest' schema. */ diff --git a/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts b/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts index 0d518b82f..79a4c7cfd 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleResults } from './module-results'; -import type { LLMModuleResultStreaming } from './llm-module-result-streaming'; +import type { ModuleResults } from './module-results.js'; +import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js'; /** * Representation of the 'CompletionPostResponseStreaming' schema. */ 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 4b809fcc2..427c2e3b7 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-response.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-response.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleResults } from './module-results'; -import type { LLMModuleResult } from './llm-module-result'; +import type { ModuleResults } from './module-results.js'; +import type { LLMModuleResult } from './llm-module-result.js'; /** * Representation of the 'CompletionPostResponse' schema. */ diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index 4519c6ef2..6c45a1032 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { DPIEntityConfig } from './dpi-entity-config'; +import type { DPIEntityConfig } from './dpi-entity-config.js'; /** * Representation of the 'DPIConfig' schema. */ 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 f8597b827..89724ac1e 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entity-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entity-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { DPIEntities } from './dpi-entities'; +import type { DPIEntities } from './dpi-entities.js'; /** * Representation of the 'DPIEntityConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/error-response.ts b/packages/orchestration/src/client/api/schema/error-response.ts index c966e7d0c..4846ca58e 100644 --- a/packages/orchestration/src/client/api/schema/error-response.ts +++ b/packages/orchestration/src/client/api/schema/error-response.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleResults } from './module-results'; +import type { ModuleResults } from './module-results.js'; /** * Representation of the 'ErrorResponse' schema. */ diff --git a/packages/orchestration/src/client/api/schema/filter-config.ts b/packages/orchestration/src/client/api/schema/filter-config.ts index 270bd1c95..4528aa1fd 100644 --- a/packages/orchestration/src/client/api/schema/filter-config.ts +++ b/packages/orchestration/src/client/api/schema/filter-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { AzureContentSafetyFilterConfig } from './azure-content-safety-filter-config'; +import type { AzureContentSafetyFilterConfig } from './azure-content-safety-filter-config.js'; /** * Representation of the 'FilterConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/filtering-module-config.ts b/packages/orchestration/src/client/api/schema/filtering-module-config.ts index ee0239992..6d65b1611 100644 --- a/packages/orchestration/src/client/api/schema/filtering-module-config.ts +++ b/packages/orchestration/src/client/api/schema/filtering-module-config.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { InputFilteringConfig } from './input-filtering-config'; -import type { OutputFilteringConfig } from './output-filtering-config'; +import type { InputFilteringConfig } from './input-filtering-config.js'; +import type { OutputFilteringConfig } from './output-filtering-config.js'; /** * Representation of the 'FilteringModuleConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index 680b9cace..5ba5a2bec 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -3,37 +3,37 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -export * from './completion-post-request'; -export * from './chat-messages'; -export * from './chat-message'; -export * from './chat-delta'; -export * from './completion-post-response'; -export * from './completion-post-response-streaming'; -export * from './orchestration-config'; -export * from './module-configs'; -export * from './module-results'; -export * from './global-stream-options'; -export * from './llm-module-config'; -export * from './generic-module-result'; -export * from './llm-module-result'; -export * from './llm-module-result-synchronous'; -export * from './llm-module-result-streaming'; -export * from './llm-choice'; -export * from './llm-choice-streaming'; -export * from './token-usage'; -export * from './templating-module-config'; -export * from './template'; -export * from './filtering-module-config'; -export * from './input-filtering-config'; -export * from './output-filtering-config'; -export * from './filtering-stream-options'; -export * from './filter-config'; -export * from './azure-content-safety-filter-config'; -export * from './azure-content-safety'; -export * from './azure-threshold'; -export * from './masking-module-config'; -export * from './masking-provider-config'; -export * from './dpi-config'; -export * from './dpi-entity-config'; -export * from './dpi-entities'; -export * from './error-response'; +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 './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'; +export * from './azure-threshold.js'; +export * from './masking-module-config.js'; +export * from './masking-provider-config.js'; +export * from './dpi-config.js'; +export * from './dpi-entity-config.js'; +export * from './dpi-entities.js'; +export * from './error-response.js'; diff --git a/packages/orchestration/src/client/api/schema/input-filtering-config.ts b/packages/orchestration/src/client/api/schema/input-filtering-config.ts index 498b3fcc6..8116af3d1 100644 --- a/packages/orchestration/src/client/api/schema/input-filtering-config.ts +++ b/packages/orchestration/src/client/api/schema/input-filtering-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { FilterConfig } from './filter-config'; +import type { FilterConfig } from './filter-config.js'; /** * Representation of the 'InputFilteringConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts b/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts index c4a002c6d..a6b850221 100644 --- a/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts +++ b/packages/orchestration/src/client/api/schema/llm-choice-streaming.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatDelta } from './chat-delta'; +import type { ChatDelta } from './chat-delta.js'; /** * Representation of the 'LLMChoiceStreaming' schema. */ diff --git a/packages/orchestration/src/client/api/schema/llm-choice.ts b/packages/orchestration/src/client/api/schema/llm-choice.ts index 8d39a4d3b..660aa77c8 100644 --- a/packages/orchestration/src/client/api/schema/llm-choice.ts +++ b/packages/orchestration/src/client/api/schema/llm-choice.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessage } from './chat-message'; +import type { ChatMessage } from './chat-message.js'; /** * Representation of the 'LLMChoice' schema. */ diff --git a/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts b/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts index 3b7bdd904..6a2dcf74d 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMChoiceStreaming } from './llm-choice-streaming'; -import type { TokenUsage } from './token-usage'; +import type { LLMChoiceStreaming } from './llm-choice-streaming.js'; +import type { TokenUsage } from './token-usage.js'; /** * Output of LLM module. Follows the OpenAI spec. */ diff --git a/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts index 08da14551..7f3a781f0 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMChoice } from './llm-choice'; -import type { TokenUsage } from './token-usage'; +import type { LLMChoice } from './llm-choice.js'; +import type { TokenUsage } from './token-usage.js'; /** * Output of LLM module. Follows the OpenAI spec. */ diff --git a/packages/orchestration/src/client/api/schema/llm-module-result.ts b/packages/orchestration/src/client/api/schema/llm-module-result.ts index 5a16c7b19..ca56b8e91 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMModuleResultSynchronous } from './llm-module-result-synchronous'; -import type { LLMModuleResultStreaming } from './llm-module-result-streaming'; +import type { LLMModuleResultSynchronous } from './llm-module-result-synchronous.js'; +import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js'; /** * Output of LLM module. Follows the OpenAI spec. */ diff --git a/packages/orchestration/src/client/api/schema/masking-module-config.ts b/packages/orchestration/src/client/api/schema/masking-module-config.ts index a392ab0a1..267e302e4 100644 --- a/packages/orchestration/src/client/api/schema/masking-module-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-module-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { MaskingProviderConfig } from './masking-provider-config'; +import type { MaskingProviderConfig } from './masking-provider-config.js'; /** * Representation of the 'MaskingModuleConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/masking-provider-config.ts b/packages/orchestration/src/client/api/schema/masking-provider-config.ts index 87757e1b9..9d07d32fb 100644 --- a/packages/orchestration/src/client/api/schema/masking-provider-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-provider-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { DPIConfig } from './dpi-config'; +import type { DPIConfig } from './dpi-config.js'; /** * Representation of the 'MaskingProviderConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/module-configs.ts b/packages/orchestration/src/client/api/schema/module-configs.ts index 6e74d0040..5bb7aa993 100644 --- a/packages/orchestration/src/client/api/schema/module-configs.ts +++ b/packages/orchestration/src/client/api/schema/module-configs.ts @@ -3,10 +3,10 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMModuleConfig } from './llm-module-config'; -import type { TemplatingModuleConfig } from './templating-module-config'; -import type { FilteringModuleConfig } from './filtering-module-config'; -import type { MaskingModuleConfig } from './masking-module-config'; +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'; /** * Representation of the 'ModuleConfigs' schema. */ diff --git a/packages/orchestration/src/client/api/schema/module-results.ts b/packages/orchestration/src/client/api/schema/module-results.ts index 15df84edc..97b995efe 100644 --- a/packages/orchestration/src/client/api/schema/module-results.ts +++ b/packages/orchestration/src/client/api/schema/module-results.ts @@ -3,11 +3,11 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessages } from './chat-messages'; -import type { GenericModuleResult } from './generic-module-result'; -import type { LLMModuleResult } from './llm-module-result'; -import type { LLMChoice } from './llm-choice'; -import type { LLMChoiceStreaming } from './llm-choice-streaming'; +import type { ChatMessages } from './chat-messages.js'; +import type { GenericModuleResult } from './generic-module-result.js'; +import type { LLMModuleResult } from './llm-module-result.js'; +import type { LLMChoice } from './llm-choice.js'; +import type { LLMChoiceStreaming } from './llm-choice-streaming.js'; /** * Results of each module. */ diff --git a/packages/orchestration/src/client/api/schema/orchestration-config.ts b/packages/orchestration/src/client/api/schema/orchestration-config.ts index 301789837..c388ab052 100644 --- a/packages/orchestration/src/client/api/schema/orchestration-config.ts +++ b/packages/orchestration/src/client/api/schema/orchestration-config.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ModuleConfigs } from './module-configs'; -import type { GlobalStreamOptions } from './global-stream-options'; +import type { ModuleConfigs } from './module-configs.js'; +import type { GlobalStreamOptions } from './global-stream-options.js'; /** * Representation of the 'OrchestrationConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/output-filtering-config.ts b/packages/orchestration/src/client/api/schema/output-filtering-config.ts index 59d6efa76..25bfdb494 100644 --- a/packages/orchestration/src/client/api/schema/output-filtering-config.ts +++ b/packages/orchestration/src/client/api/schema/output-filtering-config.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { FilterConfig } from './filter-config'; -import type { FilteringStreamOptions } from './filtering-stream-options'; +import type { FilterConfig } from './filter-config.js'; +import type { FilteringStreamOptions } from './filtering-stream-options.js'; /** * Representation of the 'OutputFilteringConfig' schema. */ diff --git a/packages/orchestration/src/client/api/schema/template.ts b/packages/orchestration/src/client/api/schema/template.ts index 719029817..48d6510dc 100644 --- a/packages/orchestration/src/client/api/schema/template.ts +++ b/packages/orchestration/src/client/api/schema/template.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessages } from './chat-messages'; +import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'Template' schema. * @example { diff --git a/packages/orchestration/src/client/api/schema/templating-module-config.ts b/packages/orchestration/src/client/api/schema/templating-module-config.ts index 7421cb2a6..2dbe2febb 100644 --- a/packages/orchestration/src/client/api/schema/templating-module-config.ts +++ b/packages/orchestration/src/client/api/schema/templating-module-config.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { Template } from './template'; +import type { Template } from './template.js'; /** * Representation of the 'TemplatingModuleConfig' schema. */ From 3641b62bda14c523adafd4f18509c7827f13f522 Mon Sep 17 00:00:00 2001 From: Junjie Tang Date: Wed, 6 Nov 2024 23:53:22 +0100 Subject: [PATCH 4/4] post generate --- .../src/client/api/schema/completion-post-response.ts | 4 ++-- .../orchestration/src/client/api/schema/dpi-config.ts | 8 ++++---- .../orchestration/src/client/api/schema/dpi-entities.ts | 2 +- .../src/client/api/schema/dpi-entity-config.ts | 8 ++++---- .../orchestration/src/client/api/schema/llm-choice.ts | 4 ++-- .../src/client/api/schema/llm-module-config.ts | 4 ++-- .../client/api/schema/llm-module-result-synchronous.ts | 4 ++-- .../src/client/api/schema/llm-module-result.ts | 2 +- .../src/client/api/schema/masking-provider-config.ts | 4 ++-- .../orchestration/src/client/api/schema/module-configs.ts | 4 ++-- .../orchestration/src/client/api/schema/module-results.ts | 8 ++++---- 11 files changed, 26 insertions(+), 26 deletions(-) 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 427c2e3b7..3cb024abd 100644 --- a/packages/orchestration/src/client/api/schema/completion-post-response.ts +++ b/packages/orchestration/src/client/api/schema/completion-post-response.ts @@ -4,7 +4,7 @@ * 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. */ @@ -15,5 +15,5 @@ export type CompletionPostResponse = { */ request_id: string; module_results: ModuleResults; - orchestration_result: LLMModuleResult; + orchestration_result: LlmModuleResult; } & Record; diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index 6c45a1032..524dca17b 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -3,11 +3,11 @@ * * 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'; /** - * Representation of the 'DPIConfig' schema. + * Representation of the 'DpiConfig' schema. */ -export type DPIConfig = { +export type DpiConfig = { /** * Type of masking service provider */ @@ -20,5 +20,5 @@ export type DPIConfig = { * List of entities to be masked * Min Items: 1. */ - entities: DPIEntityConfig[]; + entities: DpiEntityConfig[]; } & Record; diff --git a/packages/orchestration/src/client/api/schema/dpi-entities.ts b/packages/orchestration/src/client/api/schema/dpi-entities.ts index 2df8c56bb..13923bad5 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entities.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entities.ts @@ -7,7 +7,7 @@ /** * Default entities supported by data privacy and integration service */ -export type DPIEntities = +export type DpiEntities = | 'profile-person' | 'profile-org' | 'profile-university' 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 89724ac1e..f48ac6805 100644 --- a/packages/orchestration/src/client/api/schema/dpi-entity-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-entity-config.ts @@ -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: DPIEntities; + type: DpiEntities; } & Record; diff --git a/packages/orchestration/src/client/api/schema/llm-choice.ts b/packages/orchestration/src/client/api/schema/llm-choice.ts index 660aa77c8..86776d01e 100644 --- a/packages/orchestration/src/client/api/schema/llm-choice.ts +++ b/packages/orchestration/src/client/api/schema/llm-choice.ts @@ -5,9 +5,9 @@ */ import type { ChatMessage } from './chat-message.js'; /** - * Representation of the 'LLMChoice' schema. + * Representation of the 'LlmChoice' schema. */ -export type LLMChoice = { +export type LlmChoice = { /** * Index of the choice */ 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 c570cd396..89dc2b64c 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-config.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-config.ts @@ -5,9 +5,9 @@ */ /** - * Representation of the 'LLMModuleConfig' schema. + * Representation of the 'LlmModuleConfig' schema. */ -export type LLMModuleConfig = { +export type LlmModuleConfig = { /** * Model name as in LLM Access configuration * @example "gpt-4" diff --git a/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts index 7f3a781f0..fcc15c18f 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMChoice } from './llm-choice.js'; +import type { LlmChoice } from './llm-choice.js'; import type { TokenUsage } from './token-usage.js'; /** * Output of LLM module. Follows the OpenAI spec. @@ -37,6 +37,6 @@ export type LLMModuleResultSynchronous = { /** * Choices */ - choices: LLMChoice[]; + choices: LlmChoice[]; usage: TokenUsage; } & Record; diff --git a/packages/orchestration/src/client/api/schema/llm-module-result.ts b/packages/orchestration/src/client/api/schema/llm-module-result.ts index ca56b8e91..132dd040f 100644 --- a/packages/orchestration/src/client/api/schema/llm-module-result.ts +++ b/packages/orchestration/src/client/api/schema/llm-module-result.ts @@ -8,6 +8,6 @@ import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js' /** * Output of LLM module. Follows the OpenAI spec. */ -export type LLMModuleResult = +export type LlmModuleResult = | LLMModuleResultSynchronous | LLMModuleResultStreaming; diff --git a/packages/orchestration/src/client/api/schema/masking-provider-config.ts b/packages/orchestration/src/client/api/schema/masking-provider-config.ts index 9d07d32fb..c42f886e6 100644 --- a/packages/orchestration/src/client/api/schema/masking-provider-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-provider-config.ts @@ -3,8 +3,8 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { DPIConfig } from './dpi-config.js'; +import type { DpiConfig } from './dpi-config.js'; /** * Representation of the 'MaskingProviderConfig' schema. */ -export type MaskingProviderConfig = DPIConfig; +export type MaskingProviderConfig = DpiConfig; diff --git a/packages/orchestration/src/client/api/schema/module-configs.ts b/packages/orchestration/src/client/api/schema/module-configs.ts index 5bb7aa993..d89d65a6c 100644 --- a/packages/orchestration/src/client/api/schema/module-configs.ts +++ b/packages/orchestration/src/client/api/schema/module-configs.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { LLMModuleConfig } from './llm-module-config.js'; +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'; @@ -11,7 +11,7 @@ import type { MaskingModuleConfig } from './masking-module-config.js'; * Representation of the 'ModuleConfigs' schema. */ export type ModuleConfigs = { - llm_module_config: LLMModuleConfig; + llm_module_config: LlmModuleConfig; templating_module_config: TemplatingModuleConfig; filtering_module_config?: FilteringModuleConfig; masking_module_config?: MaskingModuleConfig; diff --git a/packages/orchestration/src/client/api/schema/module-results.ts b/packages/orchestration/src/client/api/schema/module-results.ts index 97b995efe..9fd86a289 100644 --- a/packages/orchestration/src/client/api/schema/module-results.ts +++ b/packages/orchestration/src/client/api/schema/module-results.ts @@ -5,8 +5,8 @@ */ import type { ChatMessages } from './chat-messages.js'; import type { GenericModuleResult } from './generic-module-result.js'; -import type { LLMModuleResult } from './llm-module-result.js'; -import type { LLMChoice } from './llm-choice.js'; +import type { LlmModuleResult } from './llm-module-result.js'; +import type { LlmChoice } from './llm-choice.js'; import type { LLMChoiceStreaming } from './llm-choice-streaming.js'; /** * Results of each module. @@ -15,7 +15,7 @@ export type ModuleResults = { templating?: ChatMessages; input_masking?: GenericModuleResult; input_filtering?: GenericModuleResult; - llm?: LLMModuleResult; + llm?: LlmModuleResult; output_filtering?: GenericModuleResult; - output_unmasking?: (LLMChoice | LLMChoiceStreaming)[]; + output_unmasking?: (LlmChoice | LLMChoiceStreaming)[]; };