diff --git a/packages/orchestration/src/client/api/schema/data-repository-type.ts b/packages/orchestration/src/client/api/schema/data-repository-type.ts index 1bb5f1e6e..0d6df16fc 100644 --- a/packages/orchestration/src/client/api/schema/data-repository-type.ts +++ b/packages/orchestration/src/client/api/schema/data-repository-type.ts @@ -7,4 +7,4 @@ /** * Representation of the 'DataRepositoryType' schema. */ -export type DataRepositoryType = 'vector' | 'help.sap.com' | any; +export type DataRepositoryType = 'vector' | any; diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index 524dca17b..92d943ce1 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -21,4 +21,8 @@ export type DpiConfig = { * Min Items: 1. */ entities: DpiEntityConfig[]; + /** + * List of strings that should not be masked + */ + allowlist?: string[]; } & Record; diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index 09add0352..1ddbe4938 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -5,6 +5,7 @@ */ export * from './completion-post-request.js'; export * from './chat-messages.js'; +export * from './templating-chat-message.js'; export * from './chat-message.js'; export * from './chat-delta.js'; export * from './completion-post-response.js'; @@ -23,6 +24,9 @@ export * from './llm-choice-streaming.js'; export * from './token-usage.js'; export * from './templating-module-config.js'; export * from './template.js'; +export * from './template-ref.js'; +export * from './template-ref-by-id.js'; +export * from './template-ref-by-scenario-name-version.js'; export * from './filtering-module-config.js'; export * from './input-filtering-config.js'; export * from './output-filtering-config.js'; 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..132dd040f 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.js'; +import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js'; /** * 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/module-results.ts b/packages/orchestration/src/client/api/schema/module-results.ts index 91f414e92..3bb7d096a 100644 --- a/packages/orchestration/src/client/api/schema/module-results.ts +++ b/packages/orchestration/src/client/api/schema/module-results.ts @@ -4,18 +4,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 { TemplatingChatMessage } from './templating-chat-message.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. */ export type ModuleResults = { grounding?: GenericModuleResult; - templating?: ChatMessages; + templating?: TemplatingChatMessage; input_masking?: GenericModuleResult; input_filtering?: GenericModuleResult; 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..c388ab052 100644 --- a/packages/orchestration/src/client/api/schema/orchestration-config.ts +++ b/packages/orchestration/src/client/api/schema/orchestration-config.ts @@ -4,9 +4,15 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { ModuleConfigs } from './module-configs.js'; +import type { GlobalStreamOptions } from './global-stream-options.js'; /** * 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 index 32b663276..25bfdb494 100644 --- a/packages/orchestration/src/client/api/schema/output-filtering-config.ts +++ b/packages/orchestration/src/client/api/schema/output-filtering-config.ts @@ -4,6 +4,7 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { FilterConfig } from './filter-config.js'; +import type { FilteringStreamOptions } from './filtering-stream-options.js'; /** * Representation of the 'OutputFilteringConfig' schema. */ @@ -13,4 +14,5 @@ export type OutputFilteringConfig = { * Min Items: 1. */ filters: FilterConfig[]; + stream_options?: FilteringStreamOptions; }; diff --git a/packages/orchestration/src/client/api/schema/template-ref-by-id.ts b/packages/orchestration/src/client/api/schema/template-ref-by-id.ts new file mode 100644 index 000000000..76b1269aa --- /dev/null +++ b/packages/orchestration/src/client/api/schema/template-ref-by-id.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. + */ + +/** + * Representation of the 'TemplateRefByID' schema. + */ +export type TemplateRefByID = { + /** + * ID of the template in prompt registry + * @example "template_id" + */ + id: string; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/template-ref-by-scenario-name-version.ts b/packages/orchestration/src/client/api/schema/template-ref-by-scenario-name-version.ts new file mode 100644 index 000000000..18933ea02 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/template-ref-by-scenario-name-version.ts @@ -0,0 +1,26 @@ +/* + * 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 'TemplateRefByScenarioNameVersion' schema. + */ +export type TemplateRefByScenarioNameVersion = { + /** + * Scenario name + * @example "some-scenario" + */ + scenario: string; + /** + * Name of the template + * @example "some-template-name" + */ + name: string; + /** + * Version of the template + * @example "some version, can be `latest`" + */ + version: string; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/template-ref.ts b/packages/orchestration/src/client/api/schema/template-ref.ts new file mode 100644 index 000000000..ab3cd702f --- /dev/null +++ b/packages/orchestration/src/client/api/schema/template-ref.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. + */ +import type { TemplateRefByID } from './template-ref-by-id.js'; +import type { TemplateRefByScenarioNameVersion } from './template-ref-by-scenario-name-version.js'; +/** + * Representation of the 'TemplateRef' schema. + */ +export type TemplateRef = { + /** + * Reference to a template in the prompt registry by ID or by scenario, name and version + */ + template_ref: TemplateRefByID | TemplateRefByScenarioNameVersion; +} & Record; diff --git a/packages/orchestration/src/client/api/schema/template.ts b/packages/orchestration/src/client/api/schema/template.ts index 48d6510dc..3b3b487ef 100644 --- a/packages/orchestration/src/client/api/schema/template.ts +++ b/packages/orchestration/src/client/api/schema/template.ts @@ -3,14 +3,14 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ -import type { ChatMessages } from './chat-messages.js'; +import type { TemplatingChatMessage } from './templating-chat-message.js'; /** * 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}}" + * "content": "How can the features of AI in SAP BTP specifically {{?groundingOutput}}, be applied to {{?inputContext}}" * } * ], * "defaults": { @@ -22,7 +22,7 @@ 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; + template: TemplatingChatMessage; /** * Optional default values for the template. If a parameter has no default it is required. */ diff --git a/packages/orchestration/src/client/api/schema/templating-chat-message.ts b/packages/orchestration/src/client/api/schema/templating-chat-message.ts new file mode 100644 index 000000000..32c396b89 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/templating-chat-message.ts @@ -0,0 +1,11 @@ +/* + * 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 { ChatMessage } from './chat-message.js'; +/** + * Representation of the 'TemplatingChatMessage' schema. + * Min Items: 1. + */ +export type TemplatingChatMessage = ChatMessage[]; 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 2dbe2febb..4a6487fc9 100644 --- a/packages/orchestration/src/client/api/schema/templating-module-config.ts +++ b/packages/orchestration/src/client/api/schema/templating-module-config.ts @@ -4,7 +4,8 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { Template } from './template.js'; +import type { TemplateRef } from './template-ref.js'; /** * Representation of the 'TemplatingModuleConfig' schema. */ -export type TemplatingModuleConfig = Template; +export type TemplatingModuleConfig = Template | TemplateRef; diff --git a/packages/orchestration/src/orchestration-response.ts b/packages/orchestration/src/orchestration-response.ts index 13f5d281e..d904925fb 100644 --- a/packages/orchestration/src/orchestration-response.ts +++ b/packages/orchestration/src/orchestration-response.ts @@ -21,7 +21,7 @@ export class OrchestrationResponse { * @returns Token usage. */ getTokenUsage(): TokenUsage { - return this.data.orchestration_result.usage; + return this.data.orchestration_result.usage!; } /** * Reason for stopping the completion. diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index 3ef72aa65..c15a69ef3 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: 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 + version: 0.36.1 x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. servers: - url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id} @@ -31,14 +31,15 @@ security: tags: - name: Orchestrated Completion description: Run an orchestrated completion inference request + paths: /completion: post: tags: - Orchestration Completion operationId: orchestration.v1.endpoints.create - summary: Orchestrated Completion - description: Run an orchestrated completion inference request + summary: 'Orchestrated Completion' + description: 'Run an orchestrated completion inference request' requestBody: required: true content: @@ -47,7 +48,7 @@ paths: $ref: '#/components/schemas/CompletionPostRequest' responses: '200': - description: Successful response + description: 'Successful response' content: application/json: schema: @@ -56,11 +57,14 @@ paths: $ref: '#/components/responses/BadRequest' default: $ref: '#/components/responses/CommonError' + components: securitySchemes: Oauth2: type: oauth2 - description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit. + 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 @@ -76,17 +80,26 @@ components: input_params: type: object example: - inputContext: optimizing supply chain management + groundingInput: 'What is SAP Joule?' + 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' + + TemplatingChatMessage: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/ChatMessage' + ChatMessage: type: object required: @@ -98,6 +111,7 @@ components: example: user content: type: string + ChatDelta: type: object required: @@ -108,6 +122,7 @@ components: content: type: string default: '' + CompletionPostResponse: type: object required: @@ -118,11 +133,12 @@ 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: @@ -135,6 +151,7 @@ components: $ref: '#/components/schemas/ModuleResults' orchestration_result: $ref: '#/components/schemas/LLMModuleResultStreaming' + OrchestrationConfig: type: object required: @@ -148,6 +165,7 @@ components: default: false stream_options: $ref: '#/components/schemas/GlobalStreamOptions' + ModuleConfigs: type: object required: @@ -162,13 +180,18 @@ 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' + $ref: '#/components/schemas/TemplatingChatMessage' input_masking: $ref: '#/components/schemas/GenericModuleResult' input_filtering: @@ -183,6 +206,7 @@ components: oneOf: - $ref: '#/components/schemas/LLMChoice' - $ref: '#/components/schemas/LLMChoiceStreaming' + GlobalStreamOptions: description: Options for streaming. Will be ignored if stream is false. type: object @@ -194,6 +218,8 @@ components: default: 100 minimum: 1 maximum: 10000 + + # --- LLM MODULE --- LLMModuleConfig: type: object required: @@ -202,7 +228,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 @@ -216,7 +242,8 @@ components: model_version: description: Version of the model to use type: string - default: latest + default: 'latest' + GenericModuleResult: type: object description: Generic module result @@ -230,11 +257,13 @@ 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. @@ -249,7 +278,7 @@ components: id: type: string description: ID of the response - example: chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr + example: 'chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr' object: type: string description: Object type @@ -261,11 +290,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 @@ -273,6 +302,7 @@ components: $ref: '#/components/schemas/LLMChoice' usage: $ref: '#/components/schemas/TokenUsage' + LLMModuleResultStreaming: type: object description: Output of LLM module. Follows the OpenAI spec. @@ -305,6 +335,7 @@ components: $ref: '#/components/schemas/LLMChoiceStreaming' usage: $ref: '#/components/schemas/TokenUsage' + LLMChoice: type: object required: @@ -327,8 +358,9 @@ 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: @@ -350,6 +382,7 @@ components: finish_reason: type: string description: Reason for stopping the model + TokenUsage: type: object description: Usage of tokens in the response @@ -370,9 +403,15 @@ components: type: integer description: Total number of tokens used example: 50 + + # --- Templating Module --- + TemplatingModuleConfig: oneOf: - $ref: '#/components/schemas/Template' + - $ref: '#/components/schemas/TemplateRef' + + # --- Templating Module with User Defined Template --- Template: type: object required: @@ -380,7 +419,7 @@ components: properties: template: allOf: - - $ref: '#/components/schemas/ChatMessages' + - $ref: '#/components/schemas/TemplatingChatMessage' description: 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. defaults: description: Optional default values for the template. If a parameter has no default it is required. @@ -388,9 +427,54 @@ components: example: template: - role: user - content: How can the features of AI in SAP BTP specifially {​{?product}}, be applied to {​{?inputContext}} + content: 'How can the features of AI in SAP BTP specifically {{?groundingOutput}}, be applied to {{?inputContext}}' defaults: inputContext: The default text that will be used in the template if inputContext is not set + + # --- Templating Module with reference to Prompt Registry --- + TemplateRef: + type: object + required: + - template_ref + properties: + template_ref: + type: object + description: Reference to a template in the prompt registry by ID or by scenario, name and version + oneOf: + - $ref: '#/components/schemas/TemplateRefByID' + - $ref: '#/components/schemas/TemplateRefByScenarioNameVersion' + + TemplateRefByID: + type: object + required: + - id + properties: + id: + type: string + description: ID of the template in prompt registry + example: 'template_id' + + TemplateRefByScenarioNameVersion: + type: object + required: + - scenario + - name + - version + properties: + scenario: + type: string + description: Scenario name + example: 'some-scenario' + name: + type: string + description: Name of the template + example: 'some-template-name' + version: + type: string + description: Version of the template + example: 'some version, can be `latest`' + + # --- Filtering Module --- FilteringModuleConfig: type: object properties: @@ -403,6 +487,7 @@ components: - $ref: '#/components/schemas/OutputFilteringConfig' description: List of provider type and filters additionalProperties: false + InputFilteringConfig: type: object required: @@ -415,6 +500,7 @@ components: minItems: 1 items: $ref: '#/components/schemas/FilterConfig' + OutputFilteringConfig: type: object required: @@ -429,6 +515,7 @@ components: $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 @@ -440,9 +527,11 @@ components: default: 0 minimum: 0 maximum: 10000 + FilterConfig: oneOf: - $ref: '#/components/schemas/AzureContentSafetyFilterConfig' + AzureContentSafetyFilterConfig: type: object required: @@ -456,19 +545,21 @@ 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 @@ -478,6 +569,9 @@ components: - 4 - 6 example: 0 + + # --- Masking module --- + MaskingModuleConfig: type: object required: @@ -490,9 +584,11 @@ components: $ref: '#/components/schemas/MaskingProviderConfig' description: List of masking service providers additionalProperties: false + MaskingProviderConfig: oneOf: - $ref: '#/components/schemas/DPIConfig' + DPIConfig: type: object required: @@ -517,6 +613,13 @@ components: minItems: 1 items: $ref: '#/components/schemas/DPIEntityConfig' + allowlist: + description: List of strings that should not be masked + type: array + items: + type: string + example: 'David Smith' + DPIEntityConfig: type: object required: @@ -526,6 +629,7 @@ 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 @@ -555,6 +659,162 @@ components: - profile-sexual-orientation - profile-trade-union - profile-sensitive-data + + # --- Grounding Module --- + GroundingModuleConfig: + type: object + required: + - type + - config + properties: + type: + type: string + anyOf: + - enum: + - document_grounding_service + - {} + example: document_grounding_service + config: + type: object + required: + - input_params + - output_param + properties: + filters: + type: array + items: + oneOf: + - $ref: '#/components/schemas/DocumentGroundingFilter' + description: Document grounding service filters to be used + input_params: + type: array + items: + type: string + example: groundingInput + description: Contains the input parameters used for grounding input questions + output_param: + type: string + description: Parameter name used for grounding output + example: groundingOutput + DocumentGroundingFilter: + type: object + required: + - id + - data_repository_type + properties: + id: + $ref: '#/components/schemas/GroundingFilterId' + search_config: + $ref: '#/components/schemas/GroundingFilterSearchConfiguration' + data_repositories: + type: array + items: + type: string + title: DataRepositories + description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + default: + - '*' + data_repository_type: + type: string + $ref: '#/components/schemas/DataRepositoryType' + description: Only include DataRepositories with the given type. + data_repository_metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Datarepositorymetadata + description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] + document_metadata: + type: array + items: + $ref: '#/components/schemas/SearchDocumentKeyValueListPair' + title: Documentmetadata + description: Restrict documents considered during search to those annotated with the given metadata. + chunk_metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Chunkmetadata + description: Restrict chunks considered during search to those with the given metadata. + minProperties: 1 + GroundingFilterId: + title: Id + description: Identifier of this SearchFilter - unique per request. + GroundingFilterSearchConfiguration: + nullable: true + properties: + max_chunk_count: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxchunkcount + description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + max_document_count: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxdocumentcount + description: "[Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned." + title: SearchConfiguration + minProperties: 0 + maxProperties: 1 + DataRepositoryType: + type: string + anyOf: + - enum: + - vector + - {} + title: DataRepositoryType + KeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: KeyValueListPair + SearchDocumentKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + select_mode: + type: array + items: + $ref: '#/components/schemas/SearchSelectOptionEnum' + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: SearchDocumentKeyValueListPair + SearchSelectOptionEnum: + type: string + anyOf: + - enum: + - ignoreIfKeyAbsent + - {} + title: SearchSelectOptionEnum + ErrorResponse: type: object required: @@ -565,19 +825,20 @@ 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