openapi: 3.0.0
info:
  description: Aura configuration atria presets API definition.
  title: Aura configuration atria presets API Swagger
  contact:
    email: auradev@tid.es
servers:
  - url: https://localhost:8999
paths:
  /aura-services/v2/configuration/presets/{presetId}:
    get:
      tags:
        - Presets
      summary: Gets all the info associated to one preset
      description: Returns channel info by presetId
      operationId: getPresetById
      security:
        - apiKeyHeader: []
      parameters:
        - name: presetId
          in: path
          description: Unique Aura preset identifier
          required: true
          schema:
            type: string
        - name: excludeFields
          description: Filters to exclude some keys from the returned object. Only root values of presetConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: includeFields
          description: Set all the keys returned in the result object. Only root values of presetConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: Successfully retrieved
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PresetConfigurationPartial"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    put:
      tags:
        - Presets
      summary: Updates all the info associated to one preset
      description: Updates all preset info
      operationId: updatePreset
      security:
        - apiKeyHeader: []
      parameters:
        - name: presetId
          in: path
          description: Unique Aura preset identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input presetData to update
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PresetConfiguration"
      responses:
        "204":
          description: Successfully updated
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    patch:
      tags:
        - Presets
      summary: Updates some info associated to one preset
      description: Updates some fields of preset info
      operationId: modifyPreset
      security:
        - apiKeyHeader: []
      parameters:
        - name: presetId
          in: path
          description: Unique Aura preset identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input channelData to add
        required: true
        content:
          application/json:
            schema:              
              $ref: "#/components/schemas/PresetConfigurationPartial"
      responses:
        "204":
          description: Successfully updated
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    delete:
      tags:
        - Presets
      summary: Delete one preset
      description: Delete preset info by id
      operationId: deletePresetById
      security:
        - apiKeyHeader: []
      parameters:
        - name: presetId
          in: path
          description: Unique Aura preset identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: Successfully updated
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
  /aura-services/v2/configuration/presets:
    get:
      tags:
        - Presets
      summary: Gets all presets info
      description: Returns presets info
      operationId: getAllPresets
      security:
        - apiKeyHeader: []
      parameters:
        - name: excludeFields
          description: Filters to exclude some keys from the returned object. Only root values of presetConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: includeFields
          description: Set all the keys returned in the result object. Properties of private properties can't be filtered
          in: query
          required: false
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: Successfully retrieved
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PresetConfigurationPartial"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    post:
      tags:
        - Presets
      summary: Adds a new preset
      description: Adds a new complete presetId
      operationId: addPreset
      security:
        - apiKeyHeader: []
      parameters:
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input presetData to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PresetConfiguration"
      responses:
        "201":
          description: Successfully gathered
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
            location:
              description: URI to access this channel configuration
              schema:
                type: string
                format: url
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "409":
          $ref: "#/components/responses/Conflict"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
  /aura-services/v2/configuration/changes/presets:
    get:
      tags:
        - Presets
      summary: Gets if presets have been modified
      description: Returns if presets are modified
      operationId: getChangedPresets
      security:
        - apiKeyHeader: []
      parameters:
        - name: since
          description: Date to check modifications in extended iso format ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
          in: query
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description: Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successfully retrieved
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModificationResponse'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      x-swagger-router-controller: modules
components:
  responses:
    InvalidRequest:
      description: Incoming HTTP request format is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    Unauthorized:
      description: Incoming HTTP request authorization is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    Conflict:
      description:
        The request could not be completed due to a conflict with the current
        state of the target resource.
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    TooManyRequests:
      description: The user has sent too many requests in a given amount of time
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    InternalError:
      description: Unexpected internal error
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    NotFound:
      description: Request resource not found
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    PresetConfigurationPartial:
      type: object
      anyOf:
        - $ref: '#/components/schemas/PresetConfigurationRagPartial'
        - $ref: '#/components/schemas/PresetConfigurationGenerativePartial'
    PresetConfigurationRagPartial:            
      type: object
      required:
        - id
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: Contains the UUID that identifies the preset univocally in Aura.
        name:
          type: string
          description: Contains the name that identifies the preset univocally in Aura.
        description:
          type: string
          description: Contains the description of the preset.
        group:
          type: string
          description: Contains the group identifier that the preset is associated with.
          enum:
            - simple_ai
            - enriched_ai
        session:
          $ref: '#/components/schemas/SessionConfiguration'        
        metadata:
          $ref: '#/components/schemas/DocumentMetadata'
        rag:
          $ref: '#/components/schemas/RagConfiguration'
    PresetConfigurationGenerativePartial:      
      type: object
      required:
        - id
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: Contains the UUID that identifies the preset univocally in Aura.
        name:
          type: string
          description: Contains the name that identifies the preset univocally in Aura.
        description:
          type: string
          description: Contains the description of the preset.
        group:
          type: string
          description: Contains the group identifier that the preset is associated with.
          enum:
            - simple_ai
            - enriched_ai
        session:
          $ref: '#/components/schemas/SessionConfiguration'        
        metadata:
          $ref: '#/components/schemas/DocumentMetadata'
        generative:
          $ref: '#/components/schemas/GenerativeConfiguration'
    PresetConfiguration:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PresetConfigurationRag'
        - $ref: '#/components/schemas/PresetConfigurationGenerative'
    PresetConfigurationRag:
      allOf:
        - $ref: '#/components/schemas/PresetConfigurationRagPartial'
        - type: object
        - required:
          - name
          - group
          - rag
    PresetConfigurationGenerative:
      allOf:
        - $ref: '#/components/schemas/PresetConfigurationGenerativePartial'
        - type: object
        - required:
          - name
          - group
          - generative
    SessionConfiguration:
      type: object
      description: Session configuration.
      additionalProperties: false
      properties:
        window:
          type: number
          description: Session window.
        timeout:
          type: number
          description: Session expiration time.
    GenerativeConfiguration:
      type: object
      required:
        - model
      additionalProperties: false
      properties:
        model:
          $ref: '#/components/schemas/ModelConfiguration'
        injectionMaxLength:
          type: number
          description: Maximum length of the user input. If the length is greater, an error is sent.
        prompts:
          $ref: '#/components/schemas/PromptsGenerative'
    PromptsGenerative:
      type: object
      description: This object contains details related to generative prompts used to automatically generate content. Prompts are phrases or instructions used as input to generate responses or content automatically through an artificial intelligence model. The object may include properties such as text, additional parameters, and specific configurations to control the behavior of the generative model.      
      additionalProperties: false
      properties:
        template:
          type: string
          description: >-
            This will override (or add, if not defined) the template for the user message, as defined in the preset (note: templates allow
            framing the user message to mitigate prompt injection attacks)
        preamble:
          $ref: '#/components/schemas/PromptContent'
        examples:
          type: array
          description: Examples to enrich the prompt.
          items:
            type: string
        promptRegexClean:
          type: string
          description: >-
            A regex pattern to clean the query before sending it to the model. This is useful to remove unwanted characters or patterns from
            the query
          example: '[#\n"]+'
        promptMaxLength:
          type: number
          description: Maximum length in characters of the completed prompt. Use to avoid calling LLMS with wrong prompts. If the length is greater, it is cut at this value.
    ModelConfiguration:
      type: object
      description: Contains the model configuration.
      required:
        - id
      additionalProperties: false
      properties:
        id:
          type: string
          description: Contains the UUID that identifies the model univocally in Aura.
        parameters:
          type: object
          description: >-
            Parameters for the model. For generative, you can check in https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
            the extra parameters that can be used.
    OutputRefine:
      type: object
      description: It is used to setup how to provide responses. The retrieving operation produces a list of candidates, each of which may provide a dictionary of metadata.
      properties:
        candidates:
          type: boolean
          description: It indicates whether to return the candidates in raw (useful for evaluation purposes) or not.
        filterOutputMetadata:
          $ref: '#/components/schemas/FilterOutputMetadata'
    RagConfiguration:
      type: object
      description: Contains the RAG configuration.
      required:
        - model
        - stages
      additionalProperties: False
      properties:
        ragType:
          type: string
          description: Type of rag.
          enum:
            - sql
            - questions-answers
          default: questions-answers
        references:
          $ref: '#/components/schemas/ReferencesConfiguration'
        model:
          $ref: '#/components/schemas/ModelConfiguration'
        stages:
          $ref: '#/components/schemas/StagesConfiguration'
        outputRefine:
          $ref: '#/components/schemas/OutputRefine'
    ReferencesConfiguration:
      type: object
      description: This object contains the configuration for managing references in the system. This configuration is important for controlling the number of references the system relies on to generate a response.
      additionalProperties: false
      required:
        - baseUrl
      properties:
        maximum:
          type: number
          description: Maximum number of references.
        baseUrl:
          type: string
          description: Base URL of the references.
    FilterOutputMetadata:
      type: object
      description: It is used to setup how metadata is used when providing responses. The retrieving operation produces a list of candidates, each of which may provide a dictionary of metadata.
      properties:
        map:
          $ref: '#/components/schemas/FilterOutputMetadataMap'
        groupBy:
          description: groupBy and aggregate are expressed in post-map field names
          type: string
          default: url
          example: url
          enum:
            - url
        aggregate:
          type: string
          description: Determines how the values of duplicated fields are consolidated during grouping, specifying the handling of aggregated field information.
          default: page-number
          example: page-number
          enum:
            - page-number
        outputFilter:
          type: array
          description: List of fields to be displayed in the metadata
          items:
            type: string
          example:
            - title
            - url
            - content-type
            - page-number
            - _zxcv
        root:
          type: array
          description: Defines the primary fields that will structure the final output of the metadata processing. Fields listed under root will remain at the top level of the response entries, while all other metadata fields will be nested under a metadata dictionary.
          items:
            type: string
          example:
            - title
            - url
            - content-type
    FilterOutputMetadataMap:
      type: object
      description: Maps attribute names in the original data to standard or more user-friendly names for later use.
      properties:
        fileType:
          type: string
          description: A string representing the type of file, typically used to specify the format or content type of the file being referenced.
          default: content-type
          example: content-type
          enum:
            - content-type
        pageNumber:
          type: string
          description: A string representing a page number. It could be used to identify particular pages within a document or resource.
          default: page-number
          example: page-number
          enum:
            - page-number
    StagesConfiguration:
      type: object
      description: Contains the stages of rag model.
      additionalProperties: False
      required:
        - retrievalStg
      properties:
        promptSystemLanguage:
          type: string
          default: en
          example: en
          enum:
            - en
            - es
            - pt
            - de
          description: Two-letter [ISO 639-1](https://www.iso.org/iso-639-language-code) code to select the language used by prompts.
        defaultUserLanguage:          
          type: string
          example: en          
          description: Two-letter [ISO 639-1](https://www.iso.org/iso-639-language-code) default language code in which llm output is requested when the language detector does not detect the user's language
        securityStg:
          $ref: '#/components/schemas/SecurityStage'
        translationStg:
          $ref: '#/components/schemas/TranslationStage'
        cleanStg:
          $ref: '#/components/schemas/CleanStage'
        contextStg:
          $ref: '#/components/schemas/ContextStage'
        retrievalStg:
          $ref: '#/components/schemas/RetrievalStage'
        postFilteringStg:
          $ref: '#/components/schemas/PostFilteringStage'
        generativeStg:
          $ref: '#/components/schemas/GenerativeStage'
    Heuristics:
      type: object
      description: Contains the heuristics configuration.
      additionalProperties: false
      properties:
        es:
          type: array
          items:
            type: string
          description: Heuristics sentences
        en:
          type: array
          items:
            type: string
          description: Heuristics sentences
    SecurityStage:
      type: object
      description: This stage is used to avoid prompt injection. If this parameter is changed it may affect security of prompt injection.
      required:        
        - injectionMaxLength
      additionalProperties: False
      properties:
        injectionMaxLength:
          type: number
          description: Maximum length of the user input. If the length is greater, an error is sent.
        heuristics:
         $ref: '#/components/schemas/Heuristics'
    TranslationStage:
      type: object
      description: This stage is used to translate the prompt.
      oneOf:
        - $ref: '#/components/schemas/PromptTranslationStage'
        - $ref: '#/components/schemas/LanguagueTranslationStage'
    PromptTranslationStage:
      type: object
      required:
        - enabled
        - prompt
      additionalProperties: False
      properties:
        enabled:
          type: boolean
          description: Enable translation stage.
        prompt:
          $ref: '#/components/schemas/PromptLanguage'
    LanguagueTranslationStage:
      type: object
      required:
        - enabled
        - language
      additionalProperties: False
      properties:
        enabled:
          type: boolean
          description: Enable translation stage.
        language:
          type: string
          description: Two-letter [ISO 639-1](https://www.iso.org/iso-639-language-code) language code into which user input is translated to match the language of the data          
          example: en
    CleanStage:
      type: object
      description: |
        Try to remove prompt injection attempts using a LLM call
        For example:
          Please clean up the query and reply only with the user's question.
          -------
          {query}
      additionalProperties: False
      required:
        - enabled
      properties:
        enabled:
          type: boolean
          description: Enable clean stage.
        prompt:
          $ref: '#/components/schemas/PromptLanguage'
    ContextStagePrompts:
      type: object
      description: Object which contains the prompts. required
      properties:
        recreatedQuestion:
          $ref: '#/components/schemas/PromptTemplate'
        sameContext:
          $ref: '#/components/schemas/PromptLanguage'
    ContextStage:
      type: object
      description: This stage is used to know if the user's phrase has the same context of the conversation.
      required:
        - stickyContext
        - enabled
      additionalProperties: False
      properties:
        enabled:
          type: boolean
          description: Enable context stage.
        prompts:
          $ref: '#/components/schemas/ContextStagePrompts'
        stickyContext:
          type: string
          example: ask_llm
          enum:
            - ask_llm
            - include_context
            - recreate_question
          description: |
            Strategy to include the context into the new query. If not specified, the optional context in the request is ignored:
            * `ask_llm`: an LLM-call is made to discern whether the context applies to the current query. If so, a recreate_question is performed, if not the context is ignored and a clear_context field is added into the response
            * `include_context`: the context will be inserted as is into the query. 'prompts' should not by empty for this option
            * `recreate_question`: an LLM-call will try to recreate the question by using the context
    RetrievalStage:
      type: object
      description: Represents the process of obtaining relevant documents by comparing the query against indexed data or vectors. The stage is crucial for identifying and retrieving the documents or data that best match the input query, ensuring that only the most relevant results are returned.
      additionalProperties: false
      required:
        - sources
      properties:
        sources:
          $ref: '#/components/schemas/SourcesDataConfiguration'
    PostFilteringStage:
      type: object
      description: This step is required to process candidates before they enter the chain. It prompts the project LLM for each candidate, using the query and the candidate text. The LLM determines whether the candidate text is related to the query, and if not, the candidate will be filtered out. If this option is not enabled, no post-processing or filtering will take place.
      additionalProperties: false
      required:        
        - enabled
      properties:
        enabled:
          type: boolean
          description: Enable post-filtering stage.
        candidatesPostFiltering:
          type: string
          example: llm_filter
          enum:
            - llm_filter
          description: >
            If specified, a post-retrieval filtering is applied to the candidates. Valid options are :

            * `llm_filter`: for each candidate a very short request is made to the LLM requesting to identify whether the candidate is
            relevant to answer the query. If 'no' is decided, the candidate is filtered out
        prompt:
          $ref: '#/components/schemas/PromptLanguage'
    GenerativeStage:
      type: object      
      anyOf:
        - $ref: '#/components/schemas/QuestionsAnswersConfiguration'
        - $ref: '#/components/schemas/SqlConfiguration'
    SqlConfigurationPrompts:
      type: object
      description: Object which contains the prompts.
      additionalProperties: false
      properties:
        sqlPrompt:
          $ref: '#/components/schemas/PromptLanguage'
        notAnswerResponse:
          $ref: '#/components/schemas/PromptLanguage'
    SqlConfiguration:
      type: object
      description: This object represents the prompt used to generate SQL queries dynamically.
      additionalProperties: false
      properties:
        prompts:
          $ref: '#/components/schemas/SqlConfigurationPrompts'
    QuestionsAnswersConfigurationPrompts:
      type: object
      description: Object which contains the prompts.
      additionalProperties: false      
      properties:
        stuff:
          $ref: '#/components/schemas/PromptTemplate'
        informationExtraction:
          $ref: '#/components/schemas/PromptTemplate'
        responseConsolidation:
          $ref: '#/components/schemas/PromptTemplate'
        notAnswerResponse:
          $ref: '#/components/schemas/PromptLanguage'
    QuestionsAnswersConfiguration:
      type: object
      description: Configuration object for handling the question and answer process. It defines the strategy to solve the question, the prompts used in different stages of the process, and the templates for generating responses.
      additionalProperties: false
      properties:
        ragStrategy:
          type: string
          description: |
            Strategy to combine documents to generate a response.
            * `stuff`: If ragStrategy is set to stuff, property stuff from prompts will be required
            * `refine`: If ragStrategy is set to refine, properties informationExtraction and responseConsolidation from prompts will be required
          enum:
            - stuff
            - refine
        prompts:
          $ref: '#/components/schemas/QuestionsAnswersConfigurationPrompts'
    PromptTemplate:
      type: object
      description: |
        This object represents a template used to generate dynamic prompts for interacting with language models or other natural language processing systems.
        The `PromptTemplate` allows for the creation of reusable prompt structures where placeholders can be replaced with dynamic values during runtime.
          - `default`: A basic template for standard prompt formatting.
          - `system`: A template designed for system-level instructions or configurations.
          - `human`: A template specifically for human-readable prompts, often used for user interactions or Q&A scenarios.
      additionalProperties: false
      properties:
        default:
          $ref: '#/components/schemas/PromptLanguage'
        system:
          $ref: '#/components/schemas/PromptLanguage'
        human:
          $ref: '#/components/schemas/PromptLanguage'
    PromptLanguage:
      type: object
      description: Contains the prompt language configuration.
      required:
        - default
      properties:
        default:
          $ref: '#/components/schemas/PromptContent'
        es:
          $ref: '#/components/schemas/PromptContent'
        de:
          $ref: '#/components/schemas/PromptContent'
        en:
          $ref: '#/components/schemas/PromptContent'
        pt:
          $ref: '#/components/schemas/PromptContent'
    PromptContent:
      type: object
      description: Contains the prompt information.
      required:
        - text
      additionalProperties: false
      properties:
        text:
          type: string
          description: This will override the system part of the prompt that was defined in the preset
          example: I am Aura, how can I help {name} ?
        args:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          description: >-
            A dictionary of parameters to be inserted into the user and/or system templates when building the prompt With this example, the
            preamble will be "I am Aura, how can I help John ?"
          example:
            name: John
    SourcesDataConfiguration:
      type: object
      description: Contains the configuration data of source definitions.
      required:
        - name
        - embeddings
        - docs
        - retrievers
      additionalProperties: false
      properties:
        name:
          type: string
          description: Contains the name of the atria source data.
        embeddings:
          type: string
          description: Contains the embeddings model identifier that the atria source data is associated with.
        docs:
          type: array
          description: Contains the information data configuration.
          items:
            $ref: '#/components/schemas/Docs'
        splitter:
          $ref: '#/components/schemas/Splitter'
        retrievers:
          type: array
          items:
            $ref: '#/components/schemas/Retrievers'
    Docs:
      type: object
      description: Contains the information data configuration.
      required:
        - extension
        - loader
      additionalProperties: false
      properties:
        extension:
          type: string
          description: Project extensions. Which extension split with coma.
        loader:
          $ref: '#/components/schemas/Loader'
    LoaderOptions:
      type: object
      description: |
        The **LoaderOptions** object defines the configuration for how a document loader operates. It allows you to specify the mode of loading and any post-processing actions to be applied to the loaded data.
        You can run the loader in one of two modes:
        - **single**: In this mode, the document will be returned as a single Document, representing the entire document as a whole.
        - **elements**: In this mode, the loader will split the document into distinct elements, such as Title, NarrativeText, or other parts of the document, allowing more granular processing and analysis.
        Additionally, post-processors can be applied to the loaded document to perform operations like cleaning, transforming, or enriching the data before it is passed to the next stage of processing.
      additionalProperties: false
      properties:
        loaderMode:
          type: string
          description: Mode loader.
          enum:
            - single
            - elements
        postProcessors:
          type: string
          description: Post processor loader.
    Loader:
      type: object
      description: Contains the loader configuration.
      additionalProperties: false
      required:
        - loaderType
      properties:
        loaderType:
          type: string
          description: Type of loader.
          enum:
            - unstructured
            - csv
            - text
            - jsond
            - jsonl
            - url_list
        options:
          $ref: '#/components/schemas/LoaderOptions'
    Splitter:
      type: object
      description: |
        This object represents the configuration for splitting large text inputs into smaller, manageable chunks, which can be processed by language models. The `Splitter` is useful for dividing long documents or texts into sections that fit within the input size limits of language models, ensuring efficient and accurate processing.
        The `splitterType` defines the method used to split the text:
        - `recursivechar`: This splitter recursively divides the text based on a character, typically looking for specific breakpoints such as punctuation or whitespace.
      required:
        - splitterType
      additionalProperties: false
      properties:
        splitterType:
          type: string
          description: Type of splitter.
          enum:
            - recursivechar
        options:
          type: object
          properties:
            chunkSize:
              type: number
              description: Maximum size of chunks to return
            chunkOverlap:
              type: number
              description: Overlap in characters between chunks
    RetrieversConfig:
      type: object
      additionalProperties: false
      properties:
        numDocs:
          type: integer
          description: Number of documents to retrieve.
        loadChunkSize:
          type: number
          description: Chuck size used to load the documents.
    Retrievers:
      type: object
      description: An object that represents an information retrieval system. It is used to query and retrieve relevant data or documents from a collection based on a given query.
      additionalProperties: false
      required:
        - retrieverType
      properties:
        retrieverType:
          type: string
          description: Type of retriever.
          enum:
            - qdrant
            - tfidf
            - elasticsearch
        config:
          $ref: '#/components/schemas/RetrieversConfig'
    DocumentMetadata:
      type: object
      description: Metadata for configuratin-api docs
      properties:
        version:
          type: string
          description: configuration-api version when document was created
        createdAt:
          type: string
          description: creation date
          format: date-time
        updatedAt:
          type: string
          description: Date when the content was updated
          format: date-time
      additionalProperties: true
    AuraError:
      type: object
      description: Error response
      additionalProperties: False
      properties:
        code:
          type: string
          description: Unique id of the error
        message:
          type: string
          description: Specific and descriptive text of the error
        errors:
          description: With validation error. Swagger error information
          type: array
          items:
            type: object
    ModificationResponse:
      type: object
      required:
        - modified
      additionalProperties: False
      properties:
        modified:
          type: boolean
        lastModified:
          type: string

