info:
  title: NucliaDB REST API
  description: API reference for the NucliaDB, covering all the endpoints related
    to pushing or searching contents.
  version: v1
openapi: 3.0.2
servers:
- url: https://{region-x}.stashify.cloud/api/v1
  description: Development server
tags:
- name: Resources
  description: Knowledge Box resource endpoints
- name: Resource fields
  description: Knowledge Box resource's fields endpoints
- name: Resource field TUS uploads
  description: 'Endpoints for TUS Resumable File Uploads protocol. This endpoints
    are compliant with the TUS protocol. You''re

    not suposed to uses this endpoints directly, but use a TUS client in your language.


    We also support the Creation extension on top of the Core TUS protocol


    See https://tus.io/ for more info.'
- name: Knowledge Boxes
  description: 'NucliaDB Knowledge Box endpoints


    **NOTE**:


    Except for getting a Knowledge box or listing Knowledge boxes, the rest of operations
    may be not available in your NucliaDB instance.

    Creating and managing Knowledge Boxes directly from NucliaDB is available only
    on standalone usage. If you have a NucliaDB Cloud or a NucliaDB On-prem,

    you need to manage them from the global API.'
- name: Knowledge Box TUS uploads
  description: 'Endpoints for TUS Resumable File Uploads protocol. This endpoints
    are compliant with the TUS protocol. It is usually preferable to use them through
    a TUS client library in your language.


    We also support the Creation extension on top of the Core TUS protocol


    See https://tus.io/ for more info.'
- name: Knowledge Box Services
  description: NucliaDB labels & entities endpoints
- name: Models
  description: Models API
- name: Search
  description: Search API
paths:
  /kb/s/{slug}:
    get:
      tags:
      - Knowledge Boxes
      summary: Get Knowledge Box (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `READER`

        '
      operationId: get_kb_by_slug_kb_s__slug__get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBoxObj'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}:
    get:
      tags:
      - Knowledge Boxes
      summary: Get Knowledge Box
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `READER`

        '
      operationId: get_kb_kb__kbid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBoxObj'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/ask:
    post:
      tags:
      - Search
      summary: Ask Knowledge Box
      description: 'Ask questions on a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: ask_knowledgebox_endpoint_kb__kbid__ask_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      - name: x-synchronous
        in: header
        required: false
        schema:
          type: boolean
          description: When set to true, outputs response as JSON in a non-streaming
            way. This is slower and requires waiting for entire answer to be ready.
          default: false
          title: X-Synchronous
        description: When set to true, outputs response as JSON in a non-streaming
          way. This is slower and requires waiting for entire answer to be ready.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncAskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/catalog:
    get:
      tags:
      - Search
      summary: List resources of a Knowledge Box
      description: 'List resources of a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: catalog_get_kb__kbid__catalog_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: query
        in: query
        required: false
        schema:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        description: The query to search for
      - name: filter_expression
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`filters`, `range_*`, `with_status`.'
        description: 'Returns only documents that match this filter expression.Filtering
          examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
          This allows building complex filtering expressions and replaces the following
          parameters:`filters`, `range_*`, `with_status`.'
      - name: filters
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of filters to apply. Filtering examples can be found
          here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: faceted
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of facets to calculate. The facets follow the same
          syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: sort_field
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortField'
          title: Sort field
          description: Field to sort results with (Score not supported in catalog)
        description: Field to sort results with (Score not supported in catalog)
      - name: sort_limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            exclusiveMinimum: 0
          - type: 'null'
          title: Sort limit
          description: ''
      - name: sort_order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortOrder'
          title: Sort order
          description: Order to sort results with
          default: desc
        description: Order to sort results with
      - name: page_number
        in: query
        required: false
        schema:
          type: integer
          title: Page number
          description: The page number of the results to return
          default: 0
        description: The page number of the results to return
      - name: page_size
        in: query
        required: false
        schema:
          type: integer
          maximum: 200
          title: Page size
          description: The number of results to return per page. The maximum number
            of results per page allowed is 200.
          default: 20
        description: The number of results to return per page. The maximum number
          of results per page allowed is 200.
      - name: with_status
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/ResourceProcessingStatus'
          - type: 'null'
          title: With processing status
          description: Filter results by resource processing status
          deprecated: true
        description: Filter results by resource processing status
        deprecated: true
      - name: range_creation_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created before this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_creation_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_modification_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified before this date will be filtered out of
          search results. Datetime are represented as a str in ISO 8601 format, like:
          2008-09-15T15:53:00+05:00.'
      - name: range_modification_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: hidden
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Filter resources by hidden
          description: Set to filter only hidden or only non-hidden resources. Default
            is to return everything
        description: Set to filter only hidden or only non-hidden resources. Default
          is to return everything
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
          - errors
        description: Controls which types of metadata are serialized on resources
          of search results
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxSearchResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Search
      summary: List resources of a Knowledge Box
      description: 'List resources of a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: catalog_post_kb__kbid__catalog_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxSearchResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/configuration:
    post:
      tags:
      - Knowledge Boxes
      summary: Create Knowledge Box models configuration
      description: 'Create configuration of models assigned to a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: set_configuration_kb__kbid__configuration_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Models Configuration
      description: Current configuration of models assigned to a knowledgebox
      operationId: Knowledgebox_models_configuration_kb__kbid__configuration_patch
      parameters:
      - required: true
        schema:
          title: Kbid
          type: string
        name: kbid
        in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LearningConfigurationUpdate'
        required: true
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Models
      summary: Get Knowledge Box models configuration
      description: 'Current configuration of models assigned to a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_configuration_kb__kbid__configuration_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/counters:
    get:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Counters
      description: 'Summary of amount of different things inside a knowledgebox

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        - `MANAGER`

        '
      operationId: knowledgebox_counters_kb__kbid__counters_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: debug
        in: query
        required: false
        schema:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        description: If set, the response will include some extra metadata for debugging
          purposes, like the list of queried nodes.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxCounters'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/custom-synonyms:
    put:
      tags:
      - Knowledge Box Services
      summary: Set Knowledge Box Custom Synonyms
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: set_custom_synonyms_kb__kbid__custom_synonyms_put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBoxSynonyms'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 1
    delete:
      tags:
      - Knowledge Box Services
      summary: Delete Knowledge Box Custom Synonyms
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_custom_synonyms_kb__kbid__custom_synonyms_delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 3
    get:
      tags:
      - Knowledge Box Services
      summary: Get Knowledge Box Custom Synonyms
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_custom_synonyms_kb__kbid__custom_synonyms_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBoxSynonyms'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 2
  /kb/{kbid}/entitiesgroup/{group}:
    patch:
      tags:
      - Knowledge Box Services
      summary: Update Knowledge Box Entities Group
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: update_entities_group_kb__kbid__entitiesgroup__group__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: group
        in: path
        required: true
        schema:
          type: string
          title: Group
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEntitiesGroupPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 2
    delete:
      tags:
      - Knowledge Box Services
      summary: Delete Knowledge Box Entities
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_entities_kb__kbid__entitiesgroup__group__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: group
        in: path
        required: true
        schema:
          type: string
          title: Group
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 3
    get:
      tags:
      - Knowledge Box Services
      summary: Get a Knowledge Box Entities Group
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_entity_kb__kbid__entitiesgroup__group__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: group
        in: path
        required: true
        schema:
          type: string
          title: Group
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGroup'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/entitiesgroups:
    post:
      tags:
      - Knowledge Box Services
      summary: Create Knowledge Box Entities Group
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: create_entities_group_kb__kbid__entitiesgroups_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEntitiesGroupPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 1
    get:
      tags:
      - Knowledge Box Services
      summary: Get Knowledge Box Entities
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_entities_kb__kbid__entitiesgroups_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: show_entities
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Show Entities
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBoxEntities'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/export:
    post:
      tags:
      - Knowledge Boxes
      summary: Start an export of a Knowledge Box
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `WRITER`

        '
      operationId: start_kb_export_endpoint_kb__kbid__export_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateExportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/export/{export_id}:
    get:
      tags:
      - Knowledge Boxes
      summary: Download a Knowledge Box export
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `READER`

        '
      operationId: download_export_kb_endpoint_kb__kbid__export__export_id__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: export_id
        in: path
        required: true
        schema:
          type: string
          title: Export Id
      responses:
        '200':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/export/{export_id}/status:
    get:
      tags:
      - Knowledge Boxes
      summary: Get the status of a Knowledge Box Export
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `READER`

        '
      operationId: get_export_status_endpoint_kb__kbid__export__export_id__status_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: export_id
        in: path
        required: true
        schema:
          type: string
          title: Export Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/extract_strategies:
    post:
      tags:
      - Extract Strategies
      summary: Add a extract strategy to a KB
      description: 'Add a extract strategy to a KB

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_strategy_kb__kbid__extract_strategies_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractConfig'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Add Strategy Kb  Kbid  Extract Strategies Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Extract Strategies
      summary: Learning extract strategies
      description: 'Get available extract strategies

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_extract_strategies_kb__kbid__extract_strategies_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/ExtractConfig'
                title: Response Get Extract Strategies Kb  Kbid  Extract Strategies
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/extract_strategies/strategy/{strategy_id}:
    delete:
      tags:
      - Extract Strategies
      summary: Remove a extract strategy from a KB
      description: 'Removes a extract strategy from a KB

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_strategy_kb__kbid__extract_strategies_strategy__strategy_id__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: strategy_id
        in: path
        required: true
        schema:
          type: string
          title: Strategy Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Extract Strategies
      summary: Extract strategy configuration
      description: 'Get extract strategy for a given id

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_extract_strategy_from_id_kb__kbid__extract_strategies_strategy__strategy_id__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: strategy_id
        in: path
        required: true
        schema:
          type: string
          title: Strategy Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/feedback:
    post:
      tags:
      - Search
      summary: Send Feedback
      description: 'Send feedback for a search operation in a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: send_feedback_endpoint_kb__kbid__feedback_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/find:
    get:
      tags:
      - Search
      summary: Find Knowledge Box
      description: 'Find on a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: find_knowledgebox_kb__kbid__find_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: query
        in: query
        required: false
        schema:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        description: The query to search for
      - name: filter_expression
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        description: 'Returns only documents that match this filter expression.Filtering
          examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
          This allows building complex filtering expressions and replaces the following
          parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
      - name: fields
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        description: 'The list of fields to search in. For instance: `a/title` to
          search only on title field. For more details on filtering by field, see:
          https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
      - name: filters
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of filters to apply. Filtering examples can be found
          here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: top_k
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 200
          - type: 'null'
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        description: The number of results search should return. The maximum number
          of results allowed is 200.
      - name: min_score
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: 'Minimum similarity score to filter vector index results. If
            not specified, the default minimum score of the semantic model associated
            to the Knowledge Box will be used. Check out the documentation for more
            information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
          deprecated: true
          title: Min Score
        description: 'Minimum similarity score to filter vector index results. If
          not specified, the default minimum score of the semantic model associated
          to the Knowledge Box will be used. Check out the documentation for more
          information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
        deprecated: true
      - name: min_score_semantic
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: 'Minimum semantic similarity score to filter vector index results.
            If not specified, the default minimum score of the semantic model associated
            to the Knowledge Box will be used. Check out the documentation for more
            information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
          title: Min Score Semantic
        description: 'Minimum semantic similarity score to filter vector index results.
          If not specified, the default minimum score of the semantic model associated
          to the Knowledge Box will be used. Check out the documentation for more
          information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
      - name: min_score_bm25
        in: query
        required: false
        schema:
          type: number
          minimum: 0.0
          description: Minimum bm25 score to filter paragraph and document index results
          default: 0
          title: Min Score Bm25
        description: Minimum bm25 score to filter paragraph and document index results
      - name: vectorset
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        description: Vectors index to perform the search in. If not provided, NucliaDB
          will use the default one
      - name: range_creation_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created before this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_creation_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_modification_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified before this date will be filtered out of
          search results. Datetime are represented as a str in ISO 8601 format, like:
          2008-09-15T15:53:00+05:00.'
      - name: range_modification_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: features
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SearchOptions'
          title: Search features
          description: List of search features to use. Each value corresponds to a
            lookup into on of the different indexes
          default:
          - keyword
          - semantic
        description: List of search features to use. Each value corresponds to a lookup
          into on of the different indexes
      - name: debug
        in: query
        required: false
        schema:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        description: If set, the response will include some extra metadata for debugging
          purposes, like the list of queried nodes.
      - name: highlight
        in: query
        required: false
        schema:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        description: If set to true, the query terms will be highlighted in the results
          between <mark>...</mark> tags
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        description: Controls which types of metadata are serialized on resources
          of search results
      - name: field_type
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FieldTypeName'
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        description: Define which field types are serialized on resources of search
          results
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
        description: '[Deprecated] Please use GET resource endpoint instead to get
          extracted metadata'
      - name: with_duplicates
        in: query
        required: false
        schema:
          type: boolean
          title: With duplicate paragraphs
          description: Whether to return duplicate paragraphs on the same document
          default: false
        description: Whether to return duplicate paragraphs on the same document
      - name: with_synonyms
        in: query
        required: false
        schema:
          type: boolean
          title: With custom synonyms
          description: 'Whether to return matches for custom knowledge box synonyms
            of the query terms. Note: only supported for `keyword` and `fulltext`
            search options.'
          default: false
        description: 'Whether to return matches for custom knowledge box synonyms
          of the query terms. Note: only supported for `keyword` and `fulltext` search
          options.'
      - name: autofilter
        in: query
        required: false
        schema:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        description: If set to true, the search will automatically add filters to
          the query. For example, it will filter results containing the entities detected
          in the query
      - name: security_groups
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Security groups
          description: List of security groups to filter search results for. Only
            resources matching the query and containing the specified security groups
            will be returned. If empty, all resources will be considered for the search.
          default: []
        description: List of security groups to filter search results for. Only resources
          matching the query and containing the specified security groups will be
          returned. If empty, all resources will be considered for the search.
      - name: show_hidden
        in: query
        required: false
        schema:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        description: If set to false (default), excludes hidden resources from search
      - name: rank_fusion
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/RankFusionName'
          title: Rank fusion
          description: Rank fusion algorithm to use to merge results from multiple
            retrievers (keyword, semantic)
          default: rrf
        description: Rank fusion algorithm to use to merge results from multiple retrievers
          (keyword, semantic)
      - name: reranker
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/RerankerName'
          - oneOf:
            - $ref: '#/components/schemas/PredictReranker'
            discriminator:
              propertyName: name
              mapping:
                predict: '#/components/schemas/PredictReranker'
          title: Reranker
          description: Reranker let you specify which method you want to use to rerank
            your results at the end of retrieval
          default: predict
        description: Reranker let you specify which method you want to use to rerank
          your results at the end of retrieval
      - name: search_configuration
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Load find parameters from this configuration
          title: Search Configuration
        description: Load find parameters from this configuration
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxFindResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Search
      summary: Find Knowledge Box
      description: 'Find on a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: find_post_knowledgebox_kb__kbid__find_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FindRequest'
            examples:
              find_hybrid_search:
                summary: Do a hybrid search on a Knowledge Box
                description: Perform a hybrid search that will return text and semantic
                  results matching the query
                value:
                  query: How can I be an effective product manager?
                  features:
                  - keyword
                  - semantic
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxFindResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/import:
    post:
      tags:
      - Knowledge Boxes
      summary: Start an import to a Knowledge Box
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `WRITER`

        '
      operationId: start_kb_import_endpoint_kb__kbid__import_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateImportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/import/{import_id}/status:
    get:
      tags:
      - Knowledge Boxes
      summary: Get the status of a Knowledge Box Import
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `MANAGER`

        - `READER`

        '
      operationId: get_import_status_endpoint_kb__kbid__import__import_id__status_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: import_id
        in: path
        required: true
        schema:
          type: string
          title: Import Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/labelset/{labelset}:
    post:
      tags:
      - Knowledge Box Services
      summary: Set Knowledge Box Labels
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: set_labelset_endpoint_kb__kbid__labelset__labelset__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: labelset
        in: path
        required: true
        schema:
          type: string
          title: Labelset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelSet'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 1
    delete:
      tags:
      - Knowledge Box Services
      summary: Delete Knowledge Box Label
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_labelset_endpoint_kb__kbid__labelset__labelset__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: labelset
        in: path
        required: true
        schema:
          type: string
          title: Labelset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation_order: 3
    get:
      tags:
      - Knowledge Box Services
      summary: Get a Knowledge Box Label Set
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_labelset_endpoint_kb__kbid__labelset__labelset__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: labelset
        in: path
        required: true
        schema:
          type: string
          title: Labelset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelSet'
        '404':
          description: Knowledge Box or Label Set not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/labelsets:
    get:
      tags:
      - Knowledge Box Services
      summary: Get Knowledge Box Label Sets
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_labelsets_endoint_kb__kbid__labelsets_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBoxLabels'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/model/{model_id}:
    get:
      tags:
      - Models
      summary: Get model metadata
      description: 'Get metadata for a particular model

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_model_kb__kbid__model__model_id__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: model_id
        in: path
        required: true
        schema:
          type: string
          title: Model Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/models:
    get:
      tags:
      - Models
      summary: Get available models
      description: 'Get available models

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_models_kb__kbid__models_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/models/{model_id}/{filename}:
    get:
      tags:
      - Models
      summary: Download the Knowledege Box model
      description: 'Download the trained model or any other generated file as a result
        of a training task on a Knowledge Box.

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_model_kb__kbid__models__model_id___filename__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: model_id
        in: path
        required: true
        schema:
          type: string
          title: Model Id
      - name: filename
        in: path
        required: true
        schema:
          type: string
          title: Filename
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/notifications:
    get:
      tags:
      - Knowledge Box Services
      summary: Knowledge Box Notifications Stream
      description: 'Provides a stream of activity notifications for the given Knowledge
        Box. The stream will be automatically closed after 2 minutes.

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: notifications_endpoint_kb__kbid__notifications_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Each line of the response is a Base64-encoded JSON object representing
            a notification. Refer to [the internal documentation](https://github.com/nuclia/nucliadb/blob/main/docs/tutorials/KB_NOTIFICATIONS.md)
            for a more detailed explanation of each notification type.
          content:
            application/json:
              schema: {}
        '404':
          description: Knowledge Box not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/predict/{endpoint}:
    post:
      tags:
      - Search
      summary: Predict API Proxy
      description: 'Convenience endpoint that proxies requests to the Predict API.
        It adds the Knowledge Box configuration settings as headers to the predict
        API request. Refer to the Predict API documentation for more details about
        the request and response models: https://docs.nuclia.dev/docs/nua-api#tag/Predict

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: predict_proxy_endpoint_kb__kbid__predict__endpoint__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: endpoint
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/PredictProxiedEndpoints'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Search
      summary: Predict API Proxy
      description: 'Convenience endpoint that proxies requests to the Predict API.
        It adds the Knowledge Box configuration settings as headers to the predict
        API request. Refer to the Predict API documentation for more details about
        the request and response models: https://docs.nuclia.dev/docs/nua-api#tag/Predict

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: predict_proxy_endpoint_kb__kbid__predict__endpoint__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: endpoint
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/PredictProxiedEndpoints'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/processing-status:
    get:
      tags:
      - Knowledge Box Services
      summary: Knowledge Box Processing Status
      description: 'Provides the status of the processing of the given Knowledge Box.

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: processing_status_kb__kbid__processing_status_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
      - name: scheduled
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Scheduled
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 20
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestsResults'
        '404':
          description: Knowledge Box not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{path_rid}/file/{field}/tusupload:
    post:
      tags:
      - Resource field TUS uploads
      summary: Create new upload on a Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: tus_post_rid_prefix_kb__kbid__resource__path_rid__file__field__tusupload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: path_rid
        in: path
        required: true
        schema:
          type: string
          title: Path Rid
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/CreateResourcePayload'
              - type: 'null'
              title: Item
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 1
  /kb/{kbid}/resource/{path_rid}/file/{field}/tusupload/{upload_id}:
    head:
      tags:
      - Resource field TUS uploads
      summary: Upload information
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: Upload_information_kb__kbid__resource__path_rid__file__field__tusupload__upload_id__head
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: path_rid
        in: path
        required: true
        schema:
          type: string
          title: Path Rid
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 3
  /kb/{kbid}/resource/{path_rid}/file/{field}/upload:
    post:
      tags:
      - Resource fields
      summary: Upload binary file on a Resource (by id)
      description: 'Upload a file as a field on an existing resource, if the field
        exists will return a conflict (419)

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: upload_rid_prefix_kb__kbid__resource__path_rid__file__field__upload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: path_rid
        in: path
        required: true
        schema:
          type: string
          title: Path Rid
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: x-filename
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: Name of the file being uploaded.
          title: X-Filename
        description: Name of the file being uploaded.
      - name: x-password
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: If the file is password protected, the password must be provided
            here.
          title: X-Password
        description: If the file is password protected, the password must be provided
          here.
      - name: x-language
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Language
      - name: x-md5
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 32
            maxLength: 32
          - type: 'null'
          description: MD5 hash of the file being uploaded. This is used to check
            if the file has been uploaded before.
          title: X-Md5
        description: MD5 hash of the file being uploaded. This is used to check if
          the file has been uploaded before.
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFileUploaded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}:
    patch:
      tags:
      - Resources
      summary: Modify Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: modify_resource_rid_prefix_kb__kbid__resource__rid__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-skip-store
        in: header
        required: false
        schema:
          type: boolean
          description: If set to true, file fields will not be saved in the blob storage.
            They will only be sent to process.
          default: false
          title: X-Skip-Store
        description: If set to true, file fields will not be saved in the blob storage.
          They will only be sent to process.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateResourcePayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUpdated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Resources
      summary: Delete Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_resource_rid_prefix_kb__kbid__resource__rid__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Resources
      summary: Get Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_resource_by_uuid_kb__kbid__resource__rid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          default:
          - basic
          title: Show
      - name: field_type
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FieldTypeName'
          default:
          - text
          - file
          - link
          - conversation
          - generic
          title: Field Type
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          default:
          - text
          - metadata
          - link
          - file
          title: Extracted
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/nucliadb_models__resource__Resource'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/ask:
    post:
      tags:
      - Search
      summary: Ask a resource (by id)
      description: 'Ask questions to a resource

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: resource_ask_endpoint_by_uuid_kb__kbid__resource__rid__ask_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      - name: x-synchronous
        in: header
        required: false
        schema:
          type: boolean
          description: When set to true, outputs response as JSON in a non-streaming
            way. This is slower and requires waiting for entire answer to be ready.
          default: false
          title: X-Synchronous
        description: When set to true, outputs response as JSON in a non-streaming
          way. This is slower and requires waiting for entire answer to be ready.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncAskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/conversation/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource conversation field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_conversation_rid_prefix_kb__kbid__resource__rid__conversation__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InputConversationField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/conversation/{field_id}/download/field/{message_id}/{file_num}:
    get:
      tags:
      - Resource fields
      summary: Download conversation binary field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_field_conversation_rid_prefix_kb__kbid__resource__rid__conversation__field_id__download_field__message_id___file_num__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      - name: file_num
        in: path
        required: true
        schema:
          type: integer
          title: File Num
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/conversation/{field_id}/messages:
    put:
      tags:
      - Resource fields
      summary: Append messages to conversation field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: append_messages_to_conversation_field_rid_prefix_kb__kbid__resource__rid__conversation__field_id__messages_put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/InputMessage'
              title: Messages
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/file/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource file field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_file_rid_prefix_kb__kbid__resource__rid__file__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      - name: x-skip-store
        in: header
        required: false
        schema:
          type: boolean
          description: If set to true, file fields will not be saved in the blob storage.
            They will only be sent to process.
          default: false
          title: X-Skip-Store
        description: If set to true, file fields will not be saved in the blob storage.
          They will only be sent to process.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/file/{field_id}/download/field:
    get:
      tags:
      - Resource fields
      summary: Download field binary field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_field_file_rid_prefix_kb__kbid__resource__rid__file__field_id__download_field_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: inline
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Inline
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/file/{field_id}/reprocess:
    post:
      tags:
      - Resource fields
      summary: Reprocess file field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: reprocess_file_field_kb__kbid__resource__rid__file__field_id__reprocess_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-file-password
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: If a file is password protected, the password must be provided
            here for the file to be processed
          title: X-File-Password
        description: If a file is password protected, the password must be provided
          here for the file to be processed
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUpdated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/file/{field}/tusupload/{upload_id}:
    patch:
      tags:
      - Resource field TUS uploads
      summary: Upload data on a Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: tus_patch_rid_prefix_kb__kbid__resource__rid__file__field__tusupload__upload_id__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 2
  /kb/{kbid}/resource/{rid}/link/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource link field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_link_rid_prefix_kb__kbid__resource__rid__link__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/reindex:
    post:
      tags:
      - Resources
      summary: Reindex Resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: reindex_resource_rid_prefix_kb__kbid__resource__rid__reindex_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: reindex_vectors
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Reindex Vectors
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/reprocess:
    post:
      tags:
      - Resources
      summary: Reprocess resource (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: reprocess_resource_rid_prefix_kb__kbid__resource__rid__reprocess_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUpdated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/run-agents:
    post:
      tags:
      - Ingestion Agents
      summary: Run Agents on Resource
      description: 'Run Agents on Resource

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: run_agents_by_uuid_kb__kbid__resource__rid__run_agents_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceAgentsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAgentsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/search:
    get:
      tags:
      - Search
      summary: Search on Resource
      description: 'Search on a single resource

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: resource_search_kb__kbid__resource__rid__search_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: query
        in: query
        required: true
        schema:
          type: string
          title: Query
      - name: filter_expression
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        description: 'Returns only documents that match this filter expression.Filtering
          examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
          This allows building complex filtering expressions and replaces the following
          parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
      - name: fields
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        description: 'The list of fields to search in. For instance: `a/title` to
          search only on title field. For more details on filtering by field, see:
          https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
      - name: filters
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of filters to apply. Filtering examples can be found
          here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: faceted
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of facets to calculate. The facets follow the same
          syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: sort_field
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/SortField'
          - type: 'null'
          title: Sort field
          description: Field to sort results with (Score not supported in catalog)
        description: Field to sort results with (Score not supported in catalog)
      - name: sort_order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortOrder'
          title: Sort order
          description: Order to sort results with
          default: desc
        description: Order to sort results with
      - name: top_k
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 200
          - type: 'null'
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        description: The number of results search should return. The maximum number
          of results allowed is 200.
      - name: range_creation_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created before this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_creation_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_modification_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified before this date will be filtered out of
          search results. Datetime are represented as a str in ISO 8601 format, like:
          2008-09-15T15:53:00+05:00.'
      - name: range_modification_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: highlight
        in: query
        required: false
        schema:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        description: If set to true, the query terms will be highlighted in the results
          between <mark>...</mark> tags
      - name: debug
        in: query
        required: false
        schema:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        description: If set, the response will include some extra metadata for debugging
          purposes, like the list of queried nodes.
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceSearchResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/text/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource text field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_text_rid_prefix_kb__kbid__resource__rid__text__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/{field_type}/{field_id}:
    delete:
      tags:
      - Resource fields
      summary: Delete Resource field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_resource_field_rid_prefix_kb__kbid__resource__rid___field_type___field_id__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Resource fields
      summary: Get Resource field (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_resource_field_rid_prefix_kb__kbid__resource__rid___field_type___field_id__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceFieldProperties'
          default:
          - value
          title: Show
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          default:
          - text
          - metadata
          - link
          - file
          title: Extracted
      - name: page
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: integer
          default: last
          title: Page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceField'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resource/{rid}/{field_type}/{field_id}/download/extracted/{download_field}:
    get:
      tags:
      - Resource fields
      summary: Download extracted binary file (by id)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_extract_file_rid_prefix_kb__kbid__resource__rid___field_type___field_id__download_extracted__download_field__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: path
        required: true
        schema:
          type: string
          title: Rid
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: download_field
        in: path
        required: true
        schema:
          type: string
          title: Download Field
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/resources:
    post:
      tags:
      - Resources
      summary: Create Resource
      description: 'Create a new Resource in a Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: Create_Resource_kb__kbid__resources_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-skip-store
        in: header
        required: false
        schema:
          type: boolean
          description: If set to true, file fields will not be saved in the blob storage.
            They will only be sent to process.
          default: false
          title: X-Skip-Store
        description: If set to true, file fields will not be saved in the blob storage.
          They will only be sent to process.
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResourcePayload'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCreated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Resources
      summary: List Resources
      description: 'List of resources of a knowledgebox

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: list_resources_kb__kbid__resources_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: page
        in: query
        required: false
        schema:
          type: integer
          description: Requested page number (0-based)
          default: 0
          title: Page
        description: Requested page number (0-based)
      - name: size
        in: query
        required: false
        schema:
          type: integer
          description: Page size
          default: 20
          title: Size
        description: Page size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/schema:
    get:
      tags:
      - Models
      summary: Learning configuration schema
      description: 'Get jsonschema definition to update the `learning_configuration`
        of your Knowledge Box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_schema_for_configuration_updates_kb__kbid__schema_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/search:
    get:
      tags:
      - Search
      summary: Search Knowledge Box
      description: 'Search on a Knowledge Box and retrieve separate results for documents,
        paragraphs, and sentences. Usually, it is better to use `find`

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: search_knowledgebox_kb__kbid__search_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: query
        in: query
        required: false
        schema:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        description: The query to search for
      - name: filter_expression
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        description: 'Returns only documents that match this filter expression.Filtering
          examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
          This allows building complex filtering expressions and replaces the following
          parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
      - name: fields
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        description: 'The list of fields to search in. For instance: `a/title` to
          search only on title field. For more details on filtering by field, see:
          https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
      - name: filters
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of filters to apply. Filtering examples can be found
          here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: faceted
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of facets to calculate. The facets follow the same
          syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: sort_field
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortField'
          title: Sort field
          description: Field to sort results with (Score not supported in catalog)
        description: Field to sort results with (Score not supported in catalog)
      - name: sort_limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            exclusiveMinimum: 0
          - type: 'null'
          title: Sort limit
          description: ''
      - name: sort_order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortOrder'
          title: Sort order
          description: Order to sort results with
          default: desc
        description: Order to sort results with
      - name: top_k
        in: query
        required: false
        schema:
          type: integer
          maximum: 200
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        description: The number of results search should return. The maximum number
          of results allowed is 200.
      - name: min_score
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: 'Minimum similarity score to filter vector index results. If
            not specified, the default minimum score of the semantic model associated
            to the Knowledge Box will be used. Check out the documentation for more
            information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
          deprecated: true
          title: Min Score
        description: 'Minimum similarity score to filter vector index results. If
          not specified, the default minimum score of the semantic model associated
          to the Knowledge Box will be used. Check out the documentation for more
          information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
        deprecated: true
      - name: min_score_semantic
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: 'Minimum semantic similarity score to filter vector index results.
            If not specified, the default minimum score of the semantic model associated
            to the Knowledge Box will be used. Check out the documentation for more
            information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
          title: Min Score Semantic
        description: 'Minimum semantic similarity score to filter vector index results.
          If not specified, the default minimum score of the semantic model associated
          to the Knowledge Box will be used. Check out the documentation for more
          information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
      - name: min_score_bm25
        in: query
        required: false
        schema:
          type: number
          minimum: 0.0
          description: Minimum bm25 score to filter paragraph and document index results
          default: 0
          title: Min Score Bm25
        description: Minimum bm25 score to filter paragraph and document index results
      - name: vectorset
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        description: Vectors index to perform the search in. If not provided, NucliaDB
          will use the default one
      - name: range_creation_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created before this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_creation_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_modification_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified before this date will be filtered out of
          search results. Datetime are represented as a str in ISO 8601 format, like:
          2008-09-15T15:53:00+05:00.'
      - name: range_modification_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: features
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SearchOptions'
          title: Search features
          description: List of search features to use. Each value corresponds to a
            lookup into on of the different indexes
          default:
          - keyword
          - fulltext
          - semantic
        description: List of search features to use. Each value corresponds to a lookup
          into on of the different indexes
      - name: debug
        in: query
        required: false
        schema:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        description: If set, the response will include some extra metadata for debugging
          purposes, like the list of queried nodes.
      - name: highlight
        in: query
        required: false
        schema:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        description: If set to true, the query terms will be highlighted in the results
          between <mark>...</mark> tags
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        description: Controls which types of metadata are serialized on resources
          of search results
      - name: field_type
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FieldTypeName'
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        description: Define which field types are serialized on resources of search
          results
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
        description: '[Deprecated] Please use GET resource endpoint instead to get
          extracted metadata'
      - name: with_duplicates
        in: query
        required: false
        schema:
          type: boolean
          title: With duplicate paragraphs
          description: Whether to return duplicate paragraphs on the same document
          default: false
        description: Whether to return duplicate paragraphs on the same document
      - name: with_synonyms
        in: query
        required: false
        schema:
          type: boolean
          title: With custom synonyms
          description: 'Whether to return matches for custom knowledge box synonyms
            of the query terms. Note: only supported for `keyword` and `fulltext`
            search options.'
          default: false
        description: 'Whether to return matches for custom knowledge box synonyms
          of the query terms. Note: only supported for `keyword` and `fulltext` search
          options.'
      - name: autofilter
        in: query
        required: false
        schema:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        description: If set to true, the search will automatically add filters to
          the query. For example, it will filter results containing the entities detected
          in the query
      - name: security_groups
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Security groups
          description: List of security groups to filter search results for. Only
            resources matching the query and containing the specified security groups
            will be returned. If empty, all resources will be considered for the search.
          default: []
        description: List of security groups to filter search results for. Only resources
          matching the query and containing the specified security groups will be
          returned. If empty, all resources will be considered for the search.
      - name: show_hidden
        in: query
        required: false
        schema:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        description: If set to false (default), excludes hidden resources from search
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxSearchResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Search
      summary: Search Knowledge Box
      description: 'Search on a Knowledge Box and retrieve separate results for documents,
        paragraphs, and sentences. Usually, it is better to use `find`

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: search_post_knowledgebox_kb__kbid__search_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
            examples:
              filtering_by_icon:
                summary: Search for pdf documents where the text 'Noam Chomsky' appears
                description: 'For a complete list of filters, visit: https://github.com/nuclia/nucliadb/blob/main/docs/internal/SEARCH.md#filters-and-facets'
                value:
                  query: Noam Chomsky
                  filters:
                  - /icon/application/pdf
                  features:
                  - fulltext
              get_language_counts:
                summary: Get the number of documents for each language
                description: 'For a complete list of facets, visit: https://github.com/nuclia/nucliadb/blob/main/docs/internal/SEARCH.md#filters-and-facets'
                value:
                  page_size: 0
                  faceted:
                  - /s/p
                  features:
                  - fulltext
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxSearchResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/search_configurations:
    get:
      tags:
      - Knowledge Box Services
      summary: List search configurations
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: list_search_configurations_kb__kbid__search_configurations_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  oneOf:
                  - $ref: '#/components/schemas/FindSearchConfiguration'
                  - $ref: '#/components/schemas/AskSearchConfiguration'
                  discriminator:
                    propertyName: kind
                    mapping:
                      find: '#/components/schemas/FindSearchConfiguration'
                      ask: '#/components/schemas/AskSearchConfiguration'
                title: Response List Search Configurations Kb  Kbid  Search Configurations
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/search_configurations/{config_name}:
    post:
      tags:
      - Knowledge Box Services
      summary: Create search configuration
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: create_search_configuration_kb__kbid__search_configurations__config_name__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: config_name
        in: path
        required: true
        schema:
          type: string
          title: Config Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/FindSearchConfiguration'
              - $ref: '#/components/schemas/AskSearchConfiguration'
              discriminator:
                propertyName: kind
                mapping:
                  find: '#/components/schemas/FindSearchConfiguration'
                  ask: '#/components/schemas/AskSearchConfiguration'
              title: Search Configuration
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Knowledge Box Services
      summary: Update search configuration
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: update_search_configuration_kb__kbid__search_configurations__config_name__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: config_name
        in: path
        required: true
        schema:
          type: string
          title: Config Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/FindSearchConfiguration'
              - $ref: '#/components/schemas/AskSearchConfiguration'
              discriminator:
                propertyName: kind
                mapping:
                  find: '#/components/schemas/FindSearchConfiguration'
                  ask: '#/components/schemas/AskSearchConfiguration'
              title: Search Configuration
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Knowledge Box Services
      summary: Delete search configuration
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_search_configuration_kb__kbid__search_configurations__config_name__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: config_name
        in: path
        required: true
        schema:
          type: string
          title: Config Name
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Knowledge Box Services
      summary: Get search configuration
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_search_configuration_kb__kbid__search_configurations__config_name__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: config_name
        in: path
        required: true
        schema:
          type: string
          title: Config Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/FindSearchConfiguration'
                - $ref: '#/components/schemas/AskSearchConfiguration'
                discriminator:
                  propertyName: kind
                  mapping:
                    find: '#/components/schemas/FindSearchConfiguration'
                    ask: '#/components/schemas/AskSearchConfiguration'
                title: Response Get Search Configuration Kb  Kbid  Search Configurations  Config
                  Name  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}:
    patch:
      tags:
      - Resources
      summary: Modify Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: modify_resource_rslug_prefix_kb__kbid__slug__rslug__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: x-skip-store
        in: header
        required: false
        schema:
          type: boolean
          description: If set to true, file fields will not be saved in the blob storage.
            They will only be sent to process.
          default: false
          title: X-Skip-Store
        description: If set to true, file fields will not be saved in the blob storage.
          They will only be sent to process.
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateResourcePayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUpdated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Resources
      summary: Delete Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_resource_rslug_prefix_kb__kbid__slug__rslug__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Resources
      summary: Get Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_resource_by_slug_kb__kbid__slug__rslug__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          default:
          - basic
          title: Show
      - name: field_type
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FieldTypeName'
          default:
          - text
          - file
          - link
          - conversation
          - generic
          title: Field Type
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          default:
          - text
          - metadata
          - link
          - file
          title: Extracted
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/nucliadb_models__resource__Resource'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/conversation/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource conversation field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_conversation_rslug_prefix_kb__kbid__slug__rslug__conversation__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InputConversationField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/conversation/{field_id}/download/field/{message_id}/{file_num}:
    get:
      tags:
      - Resource fields
      summary: Download conversation binary field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_field_conversation_rslug_prefix_kb__kbid__slug__rslug__conversation__field_id__download_field__message_id___file_num__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      - name: file_num
        in: path
        required: true
        schema:
          type: integer
          title: File Num
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/conversation/{field_id}/messages:
    put:
      tags:
      - Resource fields
      summary: Append messages to conversation field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: append_messages_to_conversation_field_rslug_prefix_kb__kbid__slug__rslug__conversation__field_id__messages_put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/InputMessage'
              title: Messages
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/file/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource file field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_file_rslug_prefix_kb__kbid__slug__rslug__file__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      - name: x-skip-store
        in: header
        required: false
        schema:
          type: boolean
          description: If set to true, file fields will not be saved in the blob storage.
            They will only be sent to process.
          default: false
          title: X-Skip-Store
        description: If set to true, file fields will not be saved in the blob storage.
          They will only be sent to process.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/file/{field_id}/download/field:
    get:
      tags:
      - Resource fields
      summary: Download field binary field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_field_file_rslug_prefix_kb__kbid__slug__rslug__file__field_id__download_field_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: inline
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Inline
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/file/{field}/tusupload:
    post:
      tags:
      - Resource field TUS uploads
      summary: Create new upload on a Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: tus_post_rslug_prefix_kb__kbid__slug__rslug__file__field__tusupload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/CreateResourcePayload'
              - type: 'null'
              title: Item
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 1
  /kb/{kbid}/slug/{rslug}/file/{field}/tusupload/{upload_id}:
    patch:
      tags:
      - Resource field TUS uploads
      summary: Upload data on a Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: tus_patch_rslug_prefix_kb__kbid__slug__rslug__file__field__tusupload__upload_id__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 2
    head:
      tags:
      - Resource field TUS uploads
      summary: Upload information
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: Upload_information_kb__kbid__slug__rslug__file__field__tusupload__upload_id__head
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 3
  /kb/{kbid}/slug/{rslug}/file/{field}/upload:
    post:
      tags:
      - Resource fields
      summary: Upload binary file on a Resource (by slug)
      description: 'Upload a file as a field on an existing resource, if the field
        exists will return a conflict (419)

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: upload_rslug_prefix_kb__kbid__slug__rslug__file__field__upload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field
      - name: x-filename
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: Name of the file being uploaded.
          title: X-Filename
        description: Name of the file being uploaded.
      - name: x-password
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: If the file is password protected, the password must be provided
            here.
          title: X-Password
        description: If the file is password protected, the password must be provided
          here.
      - name: x-language
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Language
      - name: x-md5
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 32
            maxLength: 32
          - type: 'null'
          description: MD5 hash of the file being uploaded. This is used to check
            if the file has been uploaded before.
          title: X-Md5
        description: MD5 hash of the file being uploaded. This is used to check if
          the file has been uploaded before.
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFileUploaded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/link/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource link field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_link_rslug_prefix_kb__kbid__slug__rslug__link__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/reindex:
    post:
      tags:
      - Resources
      summary: Reindex Resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: reindex_resource_rslug_prefix_kb__kbid__slug__rslug__reindex_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: reindex_vectors
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Reindex Vectors
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/reprocess:
    post:
      tags:
      - Resources
      summary: Reprocess resource (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: reprocess_resource_rslug_prefix_kb__kbid__slug__rslug__reprocess_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUpdated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/text/{field_id}:
    put:
      tags:
      - Resource fields
      summary: Add resource text field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: add_resource_field_text_rslug_prefix_kb__kbid__slug__rslug__text__field_id__put
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextField'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFieldAdded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/{field_type}/{field_id}:
    delete:
      tags:
      - Resource fields
      summary: Delete Resource field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: delete_resource_field_rslug_prefix_kb__kbid__slug__rslug___field_type___field_id__delete
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9:_-]+$
          title: Field Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Resource fields
      summary: Get Resource field (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: get_resource_field_rslug_prefix_kb__kbid__slug__rslug___field_type___field_id__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceFieldProperties'
          default:
          - value
          title: Show
      - name: extracted
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          default:
          - text
          - metadata
          - link
          - file
          title: Extracted
      - name: page
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: integer
          default: last
          title: Page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceField'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{rslug}/{field_type}/{field_id}/download/extracted/{download_field}:
    get:
      tags:
      - Resource fields
      summary: Download extracted binary file (by slug)
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: download_extract_file_rslug_prefix_kb__kbid__slug__rslug___field_type___field_id__download_extracted__download_field__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rslug
        in: path
        required: true
        schema:
          type: string
          title: Rslug
      - name: field_type
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/FieldTypeName'
      - name: field_id
        in: path
        required: true
        schema:
          type: string
          title: Field Id
      - name: download_field
        in: path
        required: true
        schema:
          type: string
          title: Download Field
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{slug}/ask:
    post:
      tags:
      - Search
      summary: Ask a resource (by slug)
      description: 'Ask questions to a resource

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: resource_ask_endpoint_by_slug_kb__kbid__slug__slug__ask_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      - name: x-synchronous
        in: header
        required: false
        schema:
          type: boolean
          description: When set to true, outputs response as JSON in a non-streaming
            way. This is slower and requires waiting for entire answer to be ready.
          default: false
          title: X-Synchronous
        description: When set to true, outputs response as JSON in a non-streaming
          way. This is slower and requires waiting for entire answer to be ready.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncAskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/slug/{slug}/run-agents:
    post:
      tags:
      - Ingestion Agents
      summary: Run Agents on Resource (by slug)
      description: 'Run Agents on Resource (by slug)

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: run_agents_by_slug_kb__kbid__slug__slug__run_agents_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceAgentsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAgentsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/suggest:
    get:
      tags:
      - Search
      summary: Suggest on a knowledge box
      description: 'Suggestions on a knowledge box

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: suggest_knowledgebox_kb__kbid__suggest_get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: query
        in: query
        required: true
        schema:
          type: string
          title: Query
          description: The query to get suggestions for
        description: The query to get suggestions for
      - name: fields
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        description: 'The list of fields to search in. For instance: `a/title` to
          search only on title field. For more details on filtering by field, see:
          https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
      - name: filters
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of filters to apply. Filtering examples can be found
          here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: faceted
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        description: 'The list of facets to calculate. The facets follow the same
          syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
      - name: range_creation_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created before this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_creation_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources created after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: range_modification_start
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified before this date will be filtered out of
          search results. Datetime are represented as a str in ISO 8601 format, like:
          2008-09-15T15:53:00+05:00.'
      - name: range_modification_end
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        description: 'Resources modified after this date will be filtered out of search
          results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.'
      - name: features
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SuggestOptions'
          title: Suggest features
          description: Features enabled for the suggest endpoint.
          default:
          - paragraph
          - entities
        description: Features enabled for the suggest endpoint.
      - name: show
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourceProperties'
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        description: Controls which types of metadata are serialized on resources
          of search results
      - name: field_type
        in: query
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FieldTypeName'
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        description: Define which field types are serialized on resources of search
          results
      - name: debug
        in: query
        required: false
        schema:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        description: If set, the response will include some extra metadata for debugging
          purposes, like the list of queried nodes.
      - name: highlight
        in: query
        required: false
        schema:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        description: If set to true, the query terms will be highlighted in the results
          between <mark>...</mark> tags
      - name: show_hidden
        in: query
        required: false
        schema:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        description: If set to false (default), excludes hidden resources from search
      - name: x-ndb-client
        in: header
        required: false
        schema:
          $ref: '#/components/schemas/NucliaDBClientType'
          default: api
      - name: x-nucliadb-user
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Nucliadb-User
      - name: x-forwarded-for
        in: header
        required: false
        schema:
          type: string
          default: ''
          title: X-Forwarded-For
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeboxSuggestResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/summarize:
    post:
      tags:
      - Search
      summary: Summarize your documents
      description: 'Summarize Your Documents

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `READER`

        '
      operationId: summarize_endpoint_kb__kbid__summarize_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummarizeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SummarizedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kbid}/tusupload:
    post:
      tags:
      - Knowledge Box TUS uploads
      summary: Create new upload on a Knowledge Box
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: tus_post_kb__kbid__tusupload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/CreateResourcePayload'
              - type: 'null'
              title: Item
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 1
    options:
      tags:
      - Knowledge Box TUS uploads
      summary: TUS Server information
      operationId: tus_options_kb__kbid__tusupload_options
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: rid
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Rid
      - name: rslug
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Rslug
      - name: upload_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Upload Id
      - name: field
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Field
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 4
  /kb/{kbid}/tusupload/{upload_id}:
    patch:
      tags:
      - Knowledge Box TUS uploads
      summary: Upload data on a Knowledge Box
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: patch_kb__kbid__tusupload__upload_id__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 2
    head:
      tags:
      - Knowledge Box TUS uploads
      summary: Upload information
      description: '

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: Upload_information_kb__kbid__tusupload__upload_id__head
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: upload_id
        in: path
        required: true
        schema:
          type: string
          title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-operation-order: 3
  /kb/{kbid}/upload:
    post:
      tags:
      - Knowledge Boxes
      summary: Upload binary file on a Knowledge Box
      description: 'Upload a file onto a Knowledge Box, field id will be file and
        rid will be autogenerated.

        ---

        ## Authorization roles

        Authenticated user needs to fulfill one of this roles, otherwise the request
        will be rejected with a `403` response.

        - `WRITER`

        '
      operationId: upload_kb__kbid__upload_post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: x-filename
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: Name of the file being uploaded.
          title: X-Filename
        description: Name of the file being uploaded.
      - name: x-password
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          description: If the file is password protected, the password must be provided
            here.
          title: X-Password
        description: If the file is password protected, the password must be provided
          here.
      - name: x-language
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Language
      - name: x-md5
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 32
            maxLength: 32
          - type: 'null'
          description: MD5 hash of the file being uploaded. This is used to check
            if the file has been uploaded before.
          title: X-Md5
        description: MD5 hash of the file being uploaded. This is used to check if
          the file has been uploaded before.
      - name: x-extract-strategy
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Extract strategy to use when uploading a file. If not provided,
            the default strategy will be used.
          title: X-Extract-Strategy
        description: Extract strategy to use when uploading a file. If not provided,
          the default strategy will be used.
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceFileUploaded'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kbs: {}
  /kbs/import: {}
  /learning/configuration/schema:
    get:
      tags:
      - Knowledge Boxes
      summary: Learning Configuration Schema
      description: Get jsonschema definition for `learning_configuration` field of
        knowledgebox creation payload
      operationId: Learning_configuration_schema_learning_configuration_schema_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Learning Configuration Schema Learning Configuration
                  Schema Get
                type: object
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
x-metadata:
  nucliadb_writer:
    commit: 7c83e95cae4bb906e61b7d0f3a2324d510ad1cc7
    last_updated: '2025-03-13T16:40:23.201152'
  learning_config:
    commit: f1e847f1e5d084f49f7544537255cfe53e0582c4
    last_updated: '2023-06-02T18:31:54.996149'
  nucliadb_reader:
    commit: 7c83e95cae4bb906e61b7d0f3a2324d510ad1cc7
    last_updated: '2025-03-13T16:40:20.380321'
  nucliadb_search:
    commit: 7c83e95cae4bb906e61b7d0f3a2324d510ad1cc7
    last_updated: '2025-03-13T16:40:26.234690'
components:
  schemas:
    AITables:
      properties:
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig'
          - type: 'null'
      type: object
      title: AITables
    And_FieldFilterExpression_:
      properties:
        and:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_FieldFilterExpression_'
            - $ref: '#/components/schemas/Or_FieldFilterExpression_'
            - $ref: '#/components/schemas/Not_FieldFilterExpression_'
            - $ref: '#/components/schemas/Resource-Input'
            - $ref: '#/components/schemas/Field'
            - $ref: '#/components/schemas/Keyword'
            - $ref: '#/components/schemas/DateCreated'
            - $ref: '#/components/schemas/DateModified'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/ResourceMimetype'
            - $ref: '#/components/schemas/FieldMimetype'
            - $ref: '#/components/schemas/Entity-Input'
            - $ref: '#/components/schemas/Language'
            - $ref: '#/components/schemas/OriginTag'
            - $ref: '#/components/schemas/OriginMetadata'
            - $ref: '#/components/schemas/OriginPath'
            - $ref: '#/components/schemas/OriginSource'
            - $ref: '#/components/schemas/OriginCollaborator'
            - $ref: '#/components/schemas/Generated'
          type: array
          title: And
      additionalProperties: false
      type: object
      required:
      - and
      title: And[FieldFilterExpression]
    And_ParagraphFilterExpression_:
      properties:
        and:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Or_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Not_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/Kind'
          type: array
          title: And
      additionalProperties: false
      type: object
      required:
      - and
      title: And[ParagraphFilterExpression]
    Answer:
      properties:
        text:
          type: string
          title: Text
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        ids_paragraphs:
          items:
            type: string
          type: array
          title: Ids Paragraphs
      type: object
      required:
      - text
      - ids_paragraphs
      title: Answer
    AnthropicKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: AnthropicKey
    AskConfig:
      properties:
        audit_metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Audit metadata
          description: A dictionary containing optional audit-specific metadata, such
            as user_id, environment, or other contextual information. This metadata
            can be leveraged for filtering and analyzing activity logs in future operations.
            Each key-value pair represents a piece of metadata relevant to the user's
            request.
          examples:
          - environment: test
            user: my-user-123
        top_k:
          type: integer
          maximum: 200.0
          minimum: 1.0
          title: Top k
          description: The top most relevant results to fetch at the retrieval step.
            The maximum number of results allowed is 200.
          default: 20
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/FilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        keyword_filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Keyword filters
          description: 'List of keyword filter expressions to apply to the retrieval
            step. The text block search will only be performed on the documents that
            contain the specified keywords. The filters are case-insensitive, and
            only alphanumeric characters and spaces are allowed. Filtering examples
            can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
          examples:
          - - NLP
            - BERT
          - - all:
              - NLP
              - BERT
          - - Friedrich Nietzsche
            - Immanuel Kant
        vectorset:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum score
          description: Minimum score to filter search results. Results with a lower
            score will be ignored. Accepts either a float or a dictionary with the
            minimum scores for the bm25 and vector indexes. If a float is provided,
            it is interpreted as the minimum score for vector index search.
        features:
          items:
            $ref: '#/components/schemas/ChatOptions'
          type: array
          title: Chat features
          description: Features enabled for the chat endpoint. Semantic search is
            done if `semantic` is included. If `keyword` is included, the results
            will include matching paragraphs from the bm25 index. If `relations` is
            included, a graph of entities related to the answer is returned. `paragraphs`
            and `vectors` are deprecated, please use `keyword` and `semantic` instead
          default:
          - semantic
          - keyword
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        field_type_filter:
          items:
            $ref: '#/components/schemas/FieldTypeName'
          type: array
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        extracted:
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          type: array
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
          deprecated: true
        context:
          anyOf:
          - items:
              $ref: '#/components/schemas/ChatContextMessage'
            type: array
          - type: 'null'
          title: Chat history
          description: Use to rephrase the new LLM query by taking into account the
            chat conversation history
        extra_context:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Extra query context
          description: "Additional context that is added to the retrieval context\
            \ sent to the LLM.\n        It allows extending the chat feature with\
            \ content that may not be in the Knowledge Box."
        extra_context_images:
          anyOf:
          - items:
              $ref: '#/components/schemas/Image'
            type: array
          - type: 'null'
          title: Extra query context images
          description: "Additional images added to the retrieval context sent to the\
            \ LLM.\"\n        It allows extending the chat feature with content that\
            \ may not be in the Knowledge Box."
        autofilter:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        highlight:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        resource_filters:
          items:
            type: string
          type: array
          title: Resources filter
          description: List of resource ids to filter search results for. Only paragraphs
            from the specified resources will be returned.
          default: []
        prompt:
          anyOf:
          - type: string
          - $ref: '#/components/schemas/CustomPrompt'
          - type: 'null'
          title: Prompts
          description: Use to customize the prompts given to the generative model.
            Both system and user prompts can be customized. If a string is provided,
            it is interpreted as the user prompt.
        rank_fusion:
          anyOf:
          - $ref: '#/components/schemas/RankFusionName'
          - oneOf:
            - $ref: '#/components/schemas/ReciprocalRankFusion'
            discriminator:
              propertyName: name
              mapping:
                rrf: '#/components/schemas/ReciprocalRankFusion'
          title: Rank fusion
          description: Rank fusion algorithm to use to merge results from multiple
            retrievers (keyword, semantic)
          default: rrf
        reranker:
          anyOf:
          - $ref: '#/components/schemas/RerankerName'
          - oneOf:
            - $ref: '#/components/schemas/PredictReranker'
            discriminator:
              propertyName: name
              mapping:
                predict: '#/components/schemas/PredictReranker'
          title: Reranker
          description: Reranker let you specify which method you want to use to rerank
            your results at the end of retrieval
          default: predict
        citations:
          type: boolean
          title: Citations
          description: Whether to include the citations for the answer in the response
          default: false
        citation_threshold:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Citation Threshold
          description: If citations is True, this sets the similarity threshold (0
            to 1) for paragraphs to be included as citations. Lower values result
            in more citations. If not provided, Nuclia's default threshold is used.
        security:
          anyOf:
          - $ref: '#/components/schemas/RequestSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the request. If not provided, the search
            request is done without the security lookup phase.
        show_hidden:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        rag_strategies:
          items:
            oneOf:
            - $ref: '#/components/schemas/FieldExtensionStrategy'
            - $ref: '#/components/schemas/FullResourceStrategy'
            - $ref: '#/components/schemas/HierarchyResourceStrategy'
            - $ref: '#/components/schemas/NeighbouringParagraphsStrategy'
            - $ref: '#/components/schemas/MetadataExtensionStrategy'
            - $ref: '#/components/schemas/ConversationalStrategy'
            - $ref: '#/components/schemas/PreQueriesStrategy'
            - $ref: '#/components/schemas/GraphStrategy'
            discriminator:
              propertyName: name
              mapping:
                conversation: '#/components/schemas/ConversationalStrategy'
                field_extension: '#/components/schemas/FieldExtensionStrategy'
                full_resource: '#/components/schemas/FullResourceStrategy'
                graph_beta: '#/components/schemas/GraphStrategy'
                hierarchy: '#/components/schemas/HierarchyResourceStrategy'
                metadata_extension: '#/components/schemas/MetadataExtensionStrategy'
                neighbouring_paragraphs: '#/components/schemas/NeighbouringParagraphsStrategy'
                prequeries: '#/components/schemas/PreQueriesStrategy'
          type: array
          title: RAG context building strategies
          description: 'Options for tweaking how the context for the LLM model is
            crafted:

            - `full_resource` will add the full text of the matching resources to
            the context. This strategy cannot be combined with `hierarchy`, `neighbouring_paragraphs`,
            or `field_extension`.

            - `field_extension` will add the text of the matching resource''s specified
            fields to the context.

            - `hierarchy` will add the title and summary text of the parent resource
            to the context for each matching paragraph.

            - `neighbouring_paragraphs` will add the sorrounding paragraphs to the
            context for each matching paragraph.

            - `metadata_extension` will add the metadata of the matching paragraphs
            or its resources to the context.

            - `prequeries` allows to run multiple retrieval queries before the main
            query and add the results to the context. The results of specific queries
            can be boosted by the specifying weights.


            If empty, the default strategy is used, which simply adds the text of
            the matching paragraphs to the context.

            '
          default: []
          examples:
          - - count: 2
              name: full_resource
          - - fields:
              - t/amend
              - a/title
              name: field_extension
          - - count: 2
              name: hierarchy
          - - after: 2
              before: 2
              name: neighbouring_paragraphs
          - - name: metadata_extension
              types:
              - origin
              - classification_labels
          - - name: prequeries
              queries:
              - request:
                  features:
                  - keyword
                  query: What is the capital of France?
                weight: 0.5
              - request:
                  query: What is the capital of Germany?
                weight: 0.5
        rag_images_strategies:
          items:
            oneOf:
            - $ref: '#/components/schemas/PageImageStrategy'
            - $ref: '#/components/schemas/ParagraphImageStrategy'
            - $ref: '#/components/schemas/TableImageStrategy'
            discriminator:
              propertyName: name
              mapping:
                page_image: '#/components/schemas/PageImageStrategy'
                paragraph_image: '#/components/schemas/ParagraphImageStrategy'
                tables: '#/components/schemas/TableImageStrategy'
          type: array
          title: RAG image context building strategies
          description: 'Options for tweaking how the image based context for the LLM
            model is crafted:

            - `page_image` will add the full page image of the matching resources
            to the context.

            - `tables` will send the table images for the paragraphs that contain
            tables and matched the retrieval query.

            - `paragraph_image` will add the images of the paragraphs that contain
            images (images for tables are not included).

            No image strategy is used by default. Note that this is only available
            for LLM models that support visual inputs. If the model does not support
            visual inputs, the image strategies will be ignored.'
          default: []
        debug:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative model
          description: The generative model to use for the chat endpoint. If not provided,
            the model configured for the Knowledge Box is used.
        max_tokens:
          anyOf:
          - type: integer
          - $ref: '#/components/schemas/MaxTokens'
          - type: 'null'
          title: Maximum LLM tokens to use for the request
          description: Use to limit the amount of tokens used in the LLM context and/or
            for generating the answer. If not provided, the default maximum tokens
            of the generative model will be used. If an integer is provided, it is
            interpreted as the maximum tokens for the answer.
        rephrase:
          type: boolean
          title: Rephrase
          description: Rephrase the query for a more efficient retrieval. This will
            consume LLM tokens and make the request slower.
          default: false
        prefer_markdown:
          type: boolean
          title: Prefer markdown
          description: If set to true, the response will be in markdown format
          default: false
        answer_json_schema:
          anyOf:
          - type: object
          - type: 'null'
          title: Answer JSON schema
          description: 'Desired JSON schema for the LLM answer.

            This schema is passed to the LLM so that it answers in a scructured format
            following the schema. If not provided, textual response is returned.

            Note that when using this parameter, the answer in the generative response
            will not be returned in chunks, the whole response text will be returned
            instead.

            Using this feature also disables the `citations` parameter. For maximal
            accuracy, please include a `description` for each field of the schema.

            '
          examples:
          - description: Structured response with custom fields
            name: structred_response
            parameters:
              properties:
                answer:
                  description: Text responding to the user's query with the given
                    context.
                  type: string
                confidence:
                  description: The confidence level of the response, on a scale from
                    0 to 5.
                  maximum: 5
                  minimum: 0
                  type: integer
                machinery_mentioned:
                  description: Optional field listing any machinery mentioned in the
                    response.
                  items:
                    description: A list of machinery mentioned in the response, if
                      any. Use machine IDs if possible.
                    type: string
                  type: array
              required:
              - answer
              - confidence
              type: object
        generate_answer:
          type: boolean
          title: Generate Answer
          description: Whether to generate an answer using the generative model. If
            set to false, the response will only contain the retrieval results.
          default: true
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
      type: object
      title: AskConfig
    AskSearchConfiguration:
      properties:
        kind:
          type: string
          const: ask
          title: Kind
        config:
          $ref: '#/components/schemas/AskConfig'
      type: object
      required:
      - kind
      - config
      title: AskSearchConfiguration
    Author:
      type: string
      enum:
      - NUCLIA
      - USER
      title: Author
    AzureMistralKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        url:
          type: string
          title: Url
          default: ''
      type: object
      title: AzureMistralKey
    AzureOpenAIKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        url:
          type: string
          title: Url
          default: ''
        deployment:
          type: string
          title: Deployment
          default: ''
        model:
          type: string
          title: Model
          default: ''
      type: object
      title: AzureOpenAIKey
    ChatContextMessage:
      properties:
        author:
          $ref: '#/components/schemas/Author'
        text:
          type: string
          title: Text
      type: object
      required:
      - author
      - text
      title: ChatContextMessage
    ChatOptions:
      type: string
      enum:
      - keyword
      - relations
      - semantic
      title: ChatOptions
    ConversationalStrategy:
      properties:
        name:
          type: string
          const: conversation
          title: Name
          default: conversation
        attachments_text:
          type: boolean
          title: Add attachments on context
          description: Add attachments on context retrieved on conversation
          default: false
        attachments_images:
          type: boolean
          title: Add attachments images on context
          description: Add attachments images on context retrieved on conversation
            if they are mime type image and using a visual LLM
          default: false
        full:
          type: boolean
          title: Add all conversation
          description: Add all conversation fields on matched blocks
          default: false
        max_messages:
          type: integer
          minimum: 0.0
          title: Max messages
          description: Max messages to append in case its not full field
          default: 15
      type: object
      title: ConversationalStrategy
    CreateEntitiesGroupPayload:
      properties:
        group:
          type: string
          title: Group
        entities:
          additionalProperties:
            $ref: '#/components/schemas/nucliadb_models__entities__Entity'
          type: object
          title: Entities
          default: {}
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
      type: object
      required:
      - group
      title: CreateEntitiesGroupPayload
    CreateExportResponse:
      properties:
        export_id:
          type: string
          title: Export Id
      type: object
      required:
      - export_id
      title: CreateExportResponse
    CreateImportResponse:
      properties:
        import_id:
          type: string
          title: Import Id
      type: object
      required:
      - import_id
      title: CreateImportResponse
    CreateResourcePayload:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
          description: The slug is the user-defined id for the resource
        icon:
          anyOf:
          - type: string
          - type: 'null'
          title: Icon
          description: 'The icon should be a media type string: https://www.iana.org/assignments/media-types/media-types.xhtml'
        thumbnail:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail
        metadata:
          anyOf:
          - $ref: '#/components/schemas/InputMetadata'
          - type: 'null'
          title: Metadata
          description: Generic metadata for the resource. It can be used to store
            structured information about the resource that later is serialized on
            retrieval results, however this metadata can not be used for searching
            or filtering.
        usermetadata:
          anyOf:
          - $ref: '#/components/schemas/UserMetadata'
          - type: 'null'
        fieldmetadata:
          anyOf:
          - items:
              $ref: '#/components/schemas/UserFieldMetadata'
            type: array
          - type: 'null'
          title: Fieldmetadata
        origin:
          anyOf:
          - $ref: '#/components/schemas/InputOrigin'
          - type: 'null'
          title: Origin
          description: Origin metadata for the resource. Used to store information
            about the resource on the origin system. Most of its fields can later
            be used to filter at search time.
        extra:
          anyOf:
          - $ref: '#/components/schemas/Extra'
          - type: 'null'
          title: Extra
          description: Extra metadata for the resource. It can be used to store structured
            information about the resource that can't be used to query at retrieval
            time.
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hidden
          description: Set the hidden status of the resource. If not set, the default
            value for new resources in the KnowledgeBox will be used.
        files:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/FileField'
          type: object
          title: Files
          description: 'Dictionary of file fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        links:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/LinkField'
          type: object
          title: Links
          description: 'Dictionary of link fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        texts:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/TextField'
          type: object
          title: Texts
          description: 'Dictionary of text fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        conversations:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/InputConversationField'
          type: object
          title: Conversations
          description: 'Dictionary of conversation fields to be added to the resource.
            The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        processing_options:
          anyOf:
          - $ref: '#/components/schemas/PushProcessingOptions'
          - type: 'null'
          description: Options for processing the resource. If not set, the default
            options will be used.
          default:
            ml_text: true
        security:
          anyOf:
          - $ref: '#/components/schemas/ResourceSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the resource. It can be used to have
            fine-grained control over who can access the resource.
      type: object
      title: CreateResourcePayload
    CustomPrompt:
      properties:
        system:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: System prompt
          description: System prompt given to the generative model responsible of
            generating the answer. This can help customize the behavior of the model
            when generating the answer. If not specified, the default model provider's
            prompt is used.
          examples:
          - You are a medical assistant, use medical terminology
          - You are an IT expert, express yourself like one
          - You are a very friendly customer service assistant, be polite
          - You are a financial expert, use correct terms
        user:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: User prompt
          description: User prompt given to the generative model responsible of generating
            the answer. Use the words {context} and {question} in brackets where you
            want those fields to be placed, in case you want them in your prompt.
            Context will be the data returned by the retrieval step and question will
            be the user's query.
          examples:
          - 'Taking into account our previous conversation, and this context: {context}
            answer this {question}'
          - 'Give a detailed answer to this {question} in a list format. If you do
            not find an answer in this context: {context}, say that you don''t have
            enough data.'
          - 'Given this context: {context}. Answer this {question} in a concise way
            using the provided context'
          - 'Given this context: {context}. Answer this {question} using the provided
            context. Please, answer always in French'
        rephrase:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: Rephrase
          description: 'Rephrase prompt given to the generative model responsible
            for rephrasing the query for a more effective retrieval step. This is
            only used if the `rephrase` flag is set to true in the request.

            If not specified, Nuclia''s default prompt is used. It must include the
            {question} placeholder. The placeholder will be replaced with the original
            question'
          examples:
          - 'Rephrase this question so its better for retrieval, and keep the rephrased
            question in the same language as the original.

            QUESTION: {question}

            Please return ONLY the question without any explanation. Just the rephrased
            question.'
          - "Rephrase this question so its better for retrieval, identify any part\
            \ numbers and append them to the end of the question separated by a commas.\n\
            \            QUESTION: {question}\n            Please return ONLY the\
            \ question without any explanation."
      type: object
      title: CustomPrompt
    DateCreated:
      properties:
        prop:
          type: string
          const: created
          title: Prop
        since:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Since
          description: Start of the date range. Leave blank for unbounded
        until:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Until
          description: End of the date range. Leave blank for unbounded
      additionalProperties: false
      type: object
      required:
      - prop
      title: DateCreated
      description: Matches all fields created in a date range
    DateModified:
      properties:
        prop:
          type: string
          const: modified
          title: Prop
        since:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Since
          description: Start of the date range. Leave blank for unbounded
        until:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Until
          description: End of the date range. Leave blank for unbounded
      additionalProperties: false
      type: object
      required:
      - prop
      title: DateModified
      description: Matches all fields modified in a date range
    ExternalIndexProviderType:
      type: string
      enum:
      - pinecone
      title: ExternalIndexProviderType
      description: 'Enum for the different external index providers.

        For now only Pinecone is supported, but we may add more in the future.'
    Extra:
      properties:
        metadata:
          type: object
          title: Metadata
          description: Arbitrary JSON metadata provided by the user that is not meant
            to be searchable, but can be serialized on results.
      type: object
      required:
      - metadata
      title: Extra
    ExtractConfig:
      properties:
        name:
          type: string
          title: Name
          default: ''
        vllm_config:
          anyOf:
          - $ref: '#/components/schemas/VLLMExtractionConfig'
          - type: 'null'
        ai_tables:
          anyOf:
          - $ref: '#/components/schemas/AITables'
          - type: 'null'
        split:
          anyOf:
          - $ref: '#/components/schemas/SplitConfig'
          - type: 'null'
      type: object
      title: ExtractConfig
      description: Hey, developer! Keep this in sync with corresponding pydantic model
        in learning_config.models
    ExtractedDataTypeName:
      type: string
      enum:
      - text
      - metadata
      - shortened_metadata
      - large_metadata
      - vectors
      - link
      - file
      - question_answers
      title: ExtractedDataTypeName
    Field:
      properties:
        prop:
          type: string
          const: field
          title: Prop
        type:
          $ref: '#/components/schemas/FieldTypeName'
          description: 'Type of the field to match, '
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
          description: Name of the field to match. If blank, matches all fields of
            the given type
      additionalProperties: false
      type: object
      required:
      - prop
      - type
      title: Field
      description: Matches a field or set of fields
    FieldExtensionStrategy:
      properties:
        name:
          type: string
          const: field_extension
          title: Name
          default: field_extension
        fields:
          items:
            type: string
          type: array
          minItems: 1
          title: Fields
          description: List of field ids to extend the context with. It will try to
            extend the retrieval context with the specified fields in the matching
            resources. The field ids have to be in the format `{field_type}/{field_name}`,
            like 'a/title', 'a/summary' for title and summary fields or 't/amend'
            for a text field named 'amend'.
      type: object
      required:
      - fields
      title: FieldExtensionStrategy
    FieldID:
      properties:
        field_type:
          $ref: '#/components/schemas/FieldType'
        field:
          type: string
          title: Field
      type: object
      required:
      - field_type
      - field
      title: FieldID
    FieldMimetype:
      properties:
        prop:
          type: string
          const: field_mimetype
          title: Prop
        type:
          type: string
          title: Type
          description: 'Type of the mimetype to match. e.g: In image/jpeg, type is
            image'
        subtype:
          anyOf:
          - type: string
          - type: 'null'
          title: Subtype
          description: 'Type of the mimetype to match. e.g: In image/jpeg, subtype
            is jpeg.Leave blank to match all mimetype of the type'
      additionalProperties: false
      type: object
      required:
      - prop
      - type
      title: FieldMimetype
      description: Matches fields with a mimetype
    FieldRef:
      properties:
        field_type:
          $ref: '#/components/schemas/FieldTypeName'
        field_id:
          type: string
          title: Field Id
        split:
          anyOf:
          - type: string
          - type: 'null'
          title: Split
      type: object
      required:
      - field_type
      - field_id
      title: FieldRef
    FieldType:
      type: string
      enum:
      - file
      - link
      - text
      - generic
      - conversation
      title: FieldType
    FieldTypeName:
      type: string
      enum:
      - text
      - file
      - link
      - conversation
      - generic
      title: FieldTypeName
      description: 'This map assumes that both values and extracted data field containers

        use the same names for its fields. See models.ResourceFieldValues and

        models.ResourceFieldExtractedData'
    File:
      properties:
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        content_type:
          type: string
          title: Content Type
          default: application/octet-stream
        payload:
          anyOf:
          - type: string
          - type: 'null'
          title: Payload
          description: Base64 encoded file content
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
        uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Uri
        extra_headers:
          additionalProperties:
            type: string
          type: object
          title: Extra Headers
          default: {}
      type: object
      title: File
    FileB64:
      properties:
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
          default: application/octet-stream
        payload:
          type: string
          title: Payload
        md5:
          type: string
          title: Md5
      type: object
      required:
      - filename
      - payload
      - md5
      title: FileB64
    FileField:
      properties:
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        password:
          anyOf:
          - type: string
          - type: 'null'
          title: Password
        file:
          $ref: '#/components/schemas/File'
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy to use at processing time.
            If not set, the default strategy will be used. Extract strategies are
            defined at the learning configuration api.
      type: object
      required:
      - file
      title: FileField
    Filter:
      properties:
        all:
          anyOf:
          - items:
              type: string
            type: array
            minItems: 1
          - type: 'null'
          title: All
        any:
          anyOf:
          - items:
              type: string
            type: array
            minItems: 1
          - type: 'null'
          title: Any
        none:
          anyOf:
          - items:
              type: string
            type: array
            minItems: 1
          - type: 'null'
          title: None
        not_all:
          anyOf:
          - items:
              type: string
            type: array
            minItems: 1
          - type: 'null'
          title: Not All
      type: object
      title: Filter
    FilterExpression:
      properties:
        field:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/And_FieldFilterExpression_'
            - $ref: '#/components/schemas/Or_FieldFilterExpression_'
            - $ref: '#/components/schemas/Not_FieldFilterExpression_'
            - $ref: '#/components/schemas/Resource-Input'
            - $ref: '#/components/schemas/Field'
            - $ref: '#/components/schemas/Keyword'
            - $ref: '#/components/schemas/DateCreated'
            - $ref: '#/components/schemas/DateModified'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/ResourceMimetype'
            - $ref: '#/components/schemas/FieldMimetype'
            - $ref: '#/components/schemas/Entity-Input'
            - $ref: '#/components/schemas/Language'
            - $ref: '#/components/schemas/OriginTag'
            - $ref: '#/components/schemas/OriginMetadata'
            - $ref: '#/components/schemas/OriginPath'
            - $ref: '#/components/schemas/OriginSource'
            - $ref: '#/components/schemas/OriginCollaborator'
            - $ref: '#/components/schemas/Generated'
          - type: 'null'
          title: Field
          description: Filter to apply to fields
        paragraph:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/And_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Or_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Not_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/Kind'
          - type: 'null'
          title: Paragraph
          description: Filter to apply to each text block
        operator:
          $ref: '#/components/schemas/Operator'
          description: How to combine field and paragraph filters (default is AND).AND
            returns text blocks that match both filters.OR returns text_blocks that
            match one of the two filters
          default: and
      additionalProperties: false
      type: object
      title: FilterExpression
      description: 'Returns only documents that match this filter expression.

        Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters


        This allows building complex filtering expressions and replaces the following
        parameters:

        `fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
    FindConfig:
      properties:
        audit_metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Audit metadata
          description: A dictionary containing optional audit-specific metadata, such
            as user_id, environment, or other contextual information. This metadata
            can be leveraged for filtering and analyzing activity logs in future operations.
            Each key-value pair represents a piece of metadata relevant to the user's
            request.
          examples:
          - environment: test
            user: my-user-123
        query:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/FilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        top_k:
          type: integer
          maximum: 200.0
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum score
          description: Minimum score to filter search results. Results with a lower
            score will be ignored. Accepts either a float or a dictionary with the
            minimum scores for the bm25 and vector indexes. If a float is provided,
            it is interpreted as the minimum score for vector index search.
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        features:
          items:
            $ref: '#/components/schemas/SearchOptions'
          type: array
          title: Search features
          description: List of search features to use. Each value corresponds to a
            lookup into on of the different indexes
          default:
          - keyword
          - semantic
        debug:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        highlight:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        field_type_filter:
          items:
            $ref: '#/components/schemas/FieldTypeName'
          type: array
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        extracted:
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          type: array
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
          deprecated: true
        vector:
          anyOf:
          - items:
              type: number
            type: array
          - type: 'null'
          title: Search Vector
          description: The vector to perform the search with. If not provided, NucliaDB
            will use Nuclia Predict API to create the vector off from the query.
        vectorset:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        with_duplicates:
          type: boolean
          title: With duplicate paragraphs
          description: Whether to return duplicate paragraphs on the same document
          default: false
        with_synonyms:
          type: boolean
          title: With custom synonyms
          description: 'Whether to return matches for custom knowledge box synonyms
            of the query terms. Note: only supported for `keyword` and `fulltext`
            search options.'
          default: false
        autofilter:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        resource_filters:
          items:
            type: string
          type: array
          title: Resources filter
          description: List of resource ids to filter search results for. Only paragraphs
            from the specified resources will be returned.
          default: []
        security:
          anyOf:
          - $ref: '#/components/schemas/RequestSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the request. If not provided, the search
            request is done without the security lookup phase.
        show_hidden:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        rephrase:
          type: boolean
          title: Rephrase
          description: Rephrase the query for a more efficient retrieval. This will
            consume LLM tokens and make the request slower.
          default: false
        rephrase_prompt:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: Rephrase
          description: 'Rephrase prompt given to the generative model responsible
            for rephrasing the query for a more effective retrieval step. This is
            only used if the `rephrase` flag is set to true in the request.

            If not specified, Nuclia''s default prompt is used. It must include the
            {question} placeholder. The placeholder will be replaced with the original
            question'
          examples:
          - 'Rephrase this question so its better for retrieval, and keep the rephrased
            question in the same language as the original.

            QUESTION: {question}

            Please return ONLY the question without any explanation. Just the rephrased
            question.'
          - "Rephrase this question so its better for retrieval, identify any part\
            \ numbers and append them to the end of the question separated by a commas.\n\
            \            QUESTION: {question}\n            Please return ONLY the\
            \ question without any explanation."
        rank_fusion:
          anyOf:
          - $ref: '#/components/schemas/RankFusionName'
          - oneOf:
            - $ref: '#/components/schemas/ReciprocalRankFusion'
            discriminator:
              propertyName: name
              mapping:
                rrf: '#/components/schemas/ReciprocalRankFusion'
          title: Rank fusion
          description: Rank fusion algorithm to use to merge results from multiple
            retrievers (keyword, semantic)
          default: rrf
        reranker:
          anyOf:
          - $ref: '#/components/schemas/RerankerName'
          - oneOf:
            - $ref: '#/components/schemas/PredictReranker'
            discriminator:
              propertyName: name
              mapping:
                predict: '#/components/schemas/PredictReranker'
          title: Reranker
          description: Reranker let you specify which method you want to use to rerank
            your results at the end of retrieval
          default: predict
        keyword_filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Keyword filters
          description: 'List of keyword filter expressions to apply to the retrieval
            step. The text block search will only be performed on the documents that
            contain the specified keywords. The filters are case-insensitive, and
            only alphanumeric characters and spaces are allowed. Filtering examples
            can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
          examples:
          - - NLP
            - BERT
          - - all:
              - NLP
              - BERT
          - - Friedrich Nietzsche
            - Immanuel Kant
      type: object
      title: FindConfig
    FindRequest:
      properties:
        audit_metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Audit metadata
          description: A dictionary containing optional audit-specific metadata, such
            as user_id, environment, or other contextual information. This metadata
            can be leveraged for filtering and analyzing activity logs in future operations.
            Each key-value pair represents a piece of metadata relevant to the user's
            request.
          examples:
          - environment: test
            user: my-user-123
        query:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/FilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        top_k:
          type: integer
          maximum: 200.0
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum score
          description: Minimum score to filter search results. Results with a lower
            score will be ignored. Accepts either a float or a dictionary with the
            minimum scores for the bm25 and vector indexes. If a float is provided,
            it is interpreted as the minimum score for vector index search.
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        features:
          items:
            $ref: '#/components/schemas/SearchOptions'
          type: array
          title: Search features
          description: List of search features to use. Each value corresponds to a
            lookup into on of the different indexes
          default:
          - keyword
          - semantic
        debug:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        highlight:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        field_type_filter:
          items:
            $ref: '#/components/schemas/FieldTypeName'
          type: array
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        extracted:
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          type: array
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
          deprecated: true
        vector:
          anyOf:
          - items:
              type: number
            type: array
          - type: 'null'
          title: Search Vector
          description: The vector to perform the search with. If not provided, NucliaDB
            will use Nuclia Predict API to create the vector off from the query.
        vectorset:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        with_duplicates:
          type: boolean
          title: With duplicate paragraphs
          description: Whether to return duplicate paragraphs on the same document
          default: false
        with_synonyms:
          type: boolean
          title: With custom synonyms
          description: 'Whether to return matches for custom knowledge box synonyms
            of the query terms. Note: only supported for `keyword` and `fulltext`
            search options.'
          default: false
        autofilter:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        resource_filters:
          items:
            type: string
          type: array
          title: Resources filter
          description: List of resource ids to filter search results for. Only paragraphs
            from the specified resources will be returned.
          default: []
        security:
          anyOf:
          - $ref: '#/components/schemas/RequestSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the request. If not provided, the search
            request is done without the security lookup phase.
        show_hidden:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        rephrase:
          type: boolean
          title: Rephrase
          description: Rephrase the query for a more efficient retrieval. This will
            consume LLM tokens and make the request slower.
          default: false
        rephrase_prompt:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: Rephrase
          description: 'Rephrase prompt given to the generative model responsible
            for rephrasing the query for a more effective retrieval step. This is
            only used if the `rephrase` flag is set to true in the request.

            If not specified, Nuclia''s default prompt is used. It must include the
            {question} placeholder. The placeholder will be replaced with the original
            question'
          examples:
          - 'Rephrase this question so its better for retrieval, and keep the rephrased
            question in the same language as the original.

            QUESTION: {question}

            Please return ONLY the question without any explanation. Just the rephrased
            question.'
          - "Rephrase this question so its better for retrieval, identify any part\
            \ numbers and append them to the end of the question separated by a commas.\n\
            \            QUESTION: {question}\n            Please return ONLY the\
            \ question without any explanation."
        rank_fusion:
          anyOf:
          - $ref: '#/components/schemas/RankFusionName'
          - oneOf:
            - $ref: '#/components/schemas/ReciprocalRankFusion'
            discriminator:
              propertyName: name
              mapping:
                rrf: '#/components/schemas/ReciprocalRankFusion'
          title: Rank fusion
          description: Rank fusion algorithm to use to merge results from multiple
            retrievers (keyword, semantic)
          default: rrf
        reranker:
          anyOf:
          - $ref: '#/components/schemas/RerankerName'
          - oneOf:
            - $ref: '#/components/schemas/PredictReranker'
            discriminator:
              propertyName: name
              mapping:
                predict: '#/components/schemas/PredictReranker'
          title: Reranker
          description: Reranker let you specify which method you want to use to rerank
            your results at the end of retrieval
          default: predict
        keyword_filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Keyword filters
          description: 'List of keyword filter expressions to apply to the retrieval
            step. The text block search will only be performed on the documents that
            contain the specified keywords. The filters are case-insensitive, and
            only alphanumeric characters and spaces are allowed. Filtering examples
            can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
          examples:
          - - NLP
            - BERT
          - - all:
              - NLP
              - BERT
          - - Friedrich Nietzsche
            - Immanuel Kant
        search_configuration:
          anyOf:
          - type: string
          - type: 'null'
          title: Search Configuration
          description: Load find parameters from this configuration
      type: object
      title: FindRequest
    FindSearchConfiguration:
      properties:
        kind:
          type: string
          const: find
          title: Kind
        config:
          $ref: '#/components/schemas/FindConfig'
      type: object
      required:
      - kind
      - config
      title: FindSearchConfiguration
    FullResourceApplyTo:
      properties:
        exclude:
          items:
            type: string
          type: array
          title: Labels to exclude from full resource expansion
          description: Resources from matches containing any of these labels won't
            expand to the full resource. This may be useful to exclude long and not
            interesting resources and expend less tokens
      type: object
      title: FullResourceApplyTo
    FullResourceStrategy:
      properties:
        name:
          type: string
          const: full_resource
          title: Name
          default: full_resource
        count:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Count
          description: Maximum number of full documents to retrieve. If not specified,
            all matching documents are retrieved.
        include_remaining_text_blocks:
          type: boolean
          title: Include remaining text blocks
          description: Whether to include the remaining text blocks after the maximum
            number of resources has been reached.
          default: false
        apply_to:
          anyOf:
          - $ref: '#/components/schemas/FullResourceApplyTo'
          - type: 'null'
          title: Apply to certain resources only
          description: Define which resources to exclude from serialization
      type: object
      title: FullResourceStrategy
    Generated:
      properties:
        prop:
          type: string
          const: generated
          title: Prop
        by:
          type: string
          const: data-augmentation
          title: By
          description: Generator for this field. Currently, only data-augmentation
            is supported
        da_task:
          anyOf:
          - type: string
          - type: 'null'
          title: Da Task
          description: Matches field generated by an specific DA task, given its prefix
      additionalProperties: false
      type: object
      required:
      - prop
      - by
      title: Generated
      description: Matches if the field was generated by the given source
    GraphStrategy:
      properties:
        name:
          type: string
          const: graph_beta
          title: Name
          default: graph_beta
        hops:
          type: integer
          maximum: 10.0
          minimum: 1.0
          title: Number of hops
          description: 'Number of hops to take when exploring the graph for relevant
            context.

            For example,

            - hops=1 will explore the neighbors of the starting entities.

            - hops=2 will explore the neighbors of the neighbors of the starting entities.

            And so on.

            Bigger values will discover more intricate relationships but will also
            take more time to compute.'
          default: 3
        top_k:
          type: integer
          maximum: 300.0
          minimum: 1.0
          title: Top k
          description: Number of relationships to keep after each hop after ranking
            them by relevance to the query. This number correlates to more paragraphs
            being sent as context. If not set, this number will be set to 30 if `relation_text_as_paragraphs`
            is set to false or 200 if `relation_text_as_paragraphs` is set to true.
        agentic_graph_only:
          type: boolean
          title: Use only the graph extracted by an agent.
          description: If set to true, only relationships extracted from a graph extraction
            agent are considered for context expansion.
          default: true
        relation_text_as_paragraphs:
          type: boolean
          title: Use relation text as context
          description: If set to true, the text of the relationships is to create
            context paragraphs, this enables to use bigger top K values without running
            into the generative model's context limits. If set to false, the paragraphs
            that contain the relationships are used as context.
          default: false
        relation_ranking:
          $ref: '#/components/schemas/RelationRanking'
          title: Method to rank relationships
          description: 'Method to rank relationships.

            - `reranker` uses the reranker model to rank relationships.

            - `generative` uses first the reranker to first lower the amount of relationships
            and then the generative model to rank relationships.

            The generative model is slower and consumes more tokens, but can provide
            better results.'
          default: reranker
        query_entity_detection:
          $ref: '#/components/schemas/QueryEntityDetection'
          title: Method to detect entities in the query
          description: 'Method to detect entities in the query.

            - `predict` uses NUA to detect entities in the query, slower and more
            accurate but requires an exact text match between Knowledge Box entities
            and entities in the query.

            - `suggest` uses fuzzy search to detect entities. It''s faster and more
            flexible but might have trouble matching entities composed of multiple
            words. It will fallback to Predict if no entities are detected.'
          default: predict
        weight:
          type: number
          minimum: 0.0
          title: Weight
          description: Weight of the graph strategy in the context. The weight is
            used to scale the results of the strategy before adding them to the context.The
            weight should be a positive number.
          default: 3.0
      type: object
      title: GraphStrategy
      description: 'This strategy retrieves context pieces by exploring the Knowledge
        Graph, starting from the entities present in the query.

        It works best if the Knowledge Box has a user-defined Graph Extraction agent
        enabled.'
    HFEmbeddingKey:
      properties:
        url:
          type: string
          title: Url
          default: ''
        key:
          type: string
          title: Key
          default: ''
        matryoshka:
          items:
            type: integer
          type: array
          title: Matryoshka
        similarity:
          type: string
          title: Similarity
          default: ''
        size:
          type: integer
          title: Size
          default: 0
        threshold:
          type: number
          title: Threshold
          default: 0.0
        passage_prompt:
          type: string
          title: Passage Prompt
          default: ''
        query_prompt:
          type: string
          title: Query Prompt
          default: ''
      type: object
      title: HFEmbeddingKey
      description: '     Some models require a specific template (including prefix)
        to work correctly in each task

        For example Snowflake''s Arctic-embed requires a specific prefix to work correctly.

        In that case, the query prompt will be

        ```

        passage_prompt: ""

        query_prompt: "Represent this sentence for searching relevant passages: {}"

        ````

        where {} will be replaced by the actual sentence.

        `passage_prompt` is empty because the model does not require alterations to
        the sentence to embed is as a passage.'
    HFLLMKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        url:
          type: string
          title: Url
          default: ''
        model:
          $ref: '#/components/schemas/ModelType'
          default: 0
      type: object
      title: HFLLMKey
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HierarchyResourceStrategy:
      properties:
        name:
          type: string
          const: hierarchy
          title: Name
          default: hierarchy
        count:
          type: integer
          minimum: 0.0
          title: Count
          description: Number of extra characters that are added to each matching
            paragraph when adding to the context.
          default: 0
      type: object
      title: HierarchyResourceStrategy
    Image:
      properties:
        content_type:
          type: string
          title: Content Type
        b64encoded:
          type: string
          title: B64Encoded
      type: object
      required:
      - content_type
      - b64encoded
      title: Image
    InputConversationField:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/InputMessage'
          type: array
          title: Messages
          default: []
      type: object
      title: InputConversationField
    InputMessage:
      properties:
        timestamp:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Timestamp
        who:
          anyOf:
          - type: string
          - type: 'null'
          title: Who
        to:
          items:
            type: string
          type: array
          title: To
          default: []
        content:
          $ref: '#/components/schemas/InputMessageContent'
        ident:
          type: string
          title: Ident
        type:
          anyOf:
          - $ref: '#/components/schemas/MessageType'
          - type: 'null'
      type: object
      required:
      - content
      - ident
      title: InputMessage
    InputMessageContent:
      properties:
        text:
          type: string
          title: Text
        format:
          $ref: '#/components/schemas/MessageFormat'
          default: PLAIN
        attachments:
          items:
            $ref: '#/components/schemas/FileB64'
          type: array
          title: Attachments
          default: []
        attachments_fields:
          items:
            $ref: '#/components/schemas/FieldRef'
          type: array
          title: Attachments Fields
          default: []
      type: object
      required:
      - text
      title: InputMessageContent
    InputMetadata:
      properties:
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          default: {}
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        languages:
          anyOf:
          - items:
              type: string
            type: array
            maxItems: 1024
          - type: 'null'
          title: Languages
      type: object
      title: InputMetadata
    InputOrigin:
      properties:
        source_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Id
        url:
          anyOf:
          - type: string
          - type: 'null'
          title: Url
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
          description: 'Creation date of the resource at the origin system. This can
            be later used for date range filtering on search endpoints. Have a look
            at the advanced search documentation page: https://docs.nuclia.dev/docs/rag/advanced/search/#date-filtering'
        modified:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Modified
          description: 'Modification date of the resource at the origin system. This
            can be later used for date range filtering on search endpoints.  Have
            a look at the advanced search documentation page: https://docs.nuclia.dev/docs/rag/advanced/search/#date-filtering'
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Generic metadata from the resource at the origin system. It
            can later be used for filtering on search endpoints with '/origin.metadata/{key}/{value}'
          default: {}
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Resource tags about the origin system. It can later be used
            for filtering on search endpoints with '/origin.tags/{tag}'
          default: []
        collaborators:
          items:
            type: string
          type: array
          title: Collaborators
          default: []
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        related:
          items:
            type: string
          type: array
          title: Related
          default: []
        path:
          anyOf:
          - type: string
          - type: 'null'
          title: Path
          description: Path of the original resource. Typically used to store folder
            structure information of the resource at the origin system. It can be
            later used for filtering on search endpoints with '/origin.path/{path}'
      type: object
      title: InputOrigin
    Keyword:
      properties:
        prop:
          type: string
          const: keyword
          title: Prop
        word:
          type: string
          title: Word
          description: Keyword to find
      additionalProperties: false
      type: object
      required:
      - prop
      - word
      title: Keyword
      description: Matches all fields that contain a keyword
    Kind:
      properties:
        prop:
          type: string
          const: kind
          title: Prop
        kind:
          $ref: '#/components/schemas/TypeParagraph'
          description: The kind of paragraph to match
      additionalProperties: false
      type: object
      required:
      - prop
      - kind
      title: Kind
      description: Matches paragraphs of a certain kind
    KnowledgeBoxConfig-Input:
      properties:
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
          description: Slug for the Knowledge Box.
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title for the Knowledge Box.
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: Description for the Knowledge Box.
        learning_configuration:
          anyOf:
          - type: object
          - type: 'null'
          title: Learning Configuration
          description: Learning configuration for the Knowledge Box. If provided,
            NucliaDB will set the learning configuration for the Knowledge Box.
        external_index_provider:
          anyOf:
          - $ref: '#/components/schemas/PineconeIndexProvider'
          - type: 'null'
          title: External Index Provider
          description: External index provider for the Knowledge Box.
        configured_external_index_provider:
          anyOf:
          - type: object
          - type: 'null'
          title: Configured External Index Provider
          description: Metadata for the configured external index provider (if any)
        similarity:
          anyOf:
          - $ref: '#/components/schemas/VectorSimilarity'
          - type: 'null'
          description: This field is deprecated. Use 'learning_configuration' instead.
        hidden_resources_enabled:
          type: boolean
          title: Hidden Resources Enabled
          description: Allow hiding resources
          default: false
        hidden_resources_hide_on_creation:
          type: boolean
          title: Hidden Resources Hide On Creation
          description: Hide newly created resources
          default: false
      type: object
      title: KnowledgeBoxConfig
    KnowledgeBoxConfig-Output:
      properties:
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
          description: Slug for the Knowledge Box.
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title for the Knowledge Box.
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: Description for the Knowledge Box.
        learning_configuration:
          anyOf:
          - type: object
          - type: 'null'
          title: Learning Configuration
          description: Learning configuration for the Knowledge Box. If provided,
            NucliaDB will set the learning configuration for the Knowledge Box.
        external_index_provider:
          anyOf:
          - $ref: '#/components/schemas/PineconeIndexProvider'
          - type: 'null'
          title: External Index Provider
          description: External index provider for the Knowledge Box.
        configured_external_index_provider:
          anyOf:
          - type: object
          - type: 'null'
          title: Configured External Index Provider
          description: Metadata for the configured external index provider (if any)
        similarity:
          anyOf:
          - $ref: '#/components/schemas/VectorSimilarity'
          - type: 'null'
          description: This field is deprecated. Use 'learning_configuration' instead.
        hidden_resources_enabled:
          type: boolean
          title: Hidden Resources Enabled
          description: Allow hiding resources
          default: false
        hidden_resources_hide_on_creation:
          type: boolean
          title: Hidden Resources Hide On Creation
          description: Hide newly created resources
          default: false
      type: object
      title: KnowledgeBoxConfig
    KnowledgeBoxObj:
      properties:
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
        uuid:
          type: string
          title: Uuid
        config:
          anyOf:
          - $ref: '#/components/schemas/KnowledgeBoxConfig'
          - type: 'null'
        model:
          anyOf:
          - $ref: '#/components/schemas/SemanticModelMetadata'
          - type: 'null'
      type: object
      required:
      - uuid
      title: KnowledgeBoxObj
      description: The API representation of a Knowledge Box object.
    KnowledgeBoxObjID:
      properties:
        uuid:
          type: string
          title: Uuid
      type: object
      required:
      - uuid
      title: KnowledgeBoxObjID
    KnowledgeBoxSynonyms:
      properties:
        synonyms:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Synonyms
      type: object
      required:
      - synonyms
      title: KnowledgeBoxSynonyms
    KnowledgeGraphEntity:
      properties:
        name:
          type: string
          title: Name
        type:
          anyOf:
          - $ref: '#/components/schemas/RelationNodeType'
          - type: 'null'
        subtype:
          anyOf:
          - type: string
          - type: 'null'
          title: Subtype
      type: object
      required:
      - name
      title: KnowledgeGraphEntity
    LLMConfig:
      properties:
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/UserLearningKeys'
          - type: 'null'
        generative_model:
          type: string
          title: Generative Model
          default: ''
        generative_provider:
          type: string
          title: Generative Provider
          default: ''
        generative_prompt_id:
          type: string
          title: Generative Prompt Id
          default: ''
      type: object
      title: LLMConfig
    LabelSet:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
          default: blue
        multiple:
          type: boolean
          title: Multiple
          default: true
        kind:
          items:
            $ref: '#/components/schemas/LabelSetKind'
          type: array
          title: Kind
          default: []
        labels:
          items:
            $ref: '#/components/schemas/nucliadb_models__labels__Label'
          type: array
          title: Labels
          default: []
      type: object
      title: LabelSet
    LabelSetKind:
      type: string
      enum:
      - RESOURCES
      - PARAGRAPHS
      - SENTENCES
      - SELECTIONS
      title: LabelSetKind
    Language:
      properties:
        prop:
          type: string
          const: language
          title: Prop
        only_primary:
          type: boolean
          title: Only Primary
          description: Match only the primary language of the document. By default,
            matches any language that appears in the document
          default: false
        language:
          type: string
          title: Language
          description: 'The code of the language to match, e.g: en'
      additionalProperties: false
      type: object
      required:
      - prop
      - language
      title: Language
      description: Matches the language of the field
    LinkField:
      properties:
        headers:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Headers
          default: {}
        cookies:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Cookies
          default: {}
        uri:
          type: string
          title: Uri
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        localstorage:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Localstorage
          default: {}
        css_selector:
          anyOf:
          - type: string
          - type: 'null'
          title: Css Selector
        xpath:
          anyOf:
          - type: string
          - type: 'null'
          title: Xpath
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy to use at processing time.
            If not set, the default strategy will be used. Extract strategies are
            defined at the learning configuration api.
      type: object
      required:
      - uri
      title: LinkField
    MaxTokens:
      properties:
        context:
          anyOf:
          - type: integer
          - type: 'null'
          title: Maximum context tokens
          description: Use to limit the amount of tokens used in the LLM context
        answer:
          anyOf:
          - type: integer
          - type: 'null'
          title: Maximum answer tokens
          description: Use to limit the amount of tokens used in the LLM answer
      type: object
      title: MaxTokens
    MessageFormat:
      type: string
      enum:
      - PLAIN
      - HTML
      - RST
      - MARKDOWN
      - KEEP_MARKDOWN
      title: MessageFormat
    MessageType:
      type: string
      enum:
      - UNSET
      - QUESTION
      - ANSWER
      title: MessageType
    MetadataExtensionStrategy:
      properties:
        name:
          type: string
          const: metadata_extension
          title: Name
          default: metadata_extension
        types:
          items:
            $ref: '#/components/schemas/MetadataExtensionType'
          type: array
          minItems: 1
          title: Types
          description: "\nList of resource metadata types to add to the context.\n\
            \  - 'origin': origin metadata of the resource.\n  - 'classification_labels':\
            \ classification labels of the resource.\n  - 'ner': Named Entity Recognition\
            \ entities detected for the resource.\n  - 'extra_metadata': extra metadata\
            \ of the resource.\n\nTypes for which the metadata is not found at the\
            \ resource are ignored and not added to the context.\n"
          examples:
          - - origin
            - classification_labels
          - - ners
      type: object
      required:
      - types
      title: MetadataExtensionStrategy
      description: 'RAG strategy to enrich the context with metadata of the matching
        paragraphs or its resources.

        This strategy can be combined with any of the other strategies.'
    MetadataExtensionType:
      type: string
      enum:
      - origin
      - classification_labels
      - ners
      - extra_metadata
      title: MetadataExtensionType
    MinScore:
      properties:
        semantic:
          anyOf:
          - type: number
          - type: 'null'
          title: Minimum semantic score
          description: 'Minimum semantic similarity score used to filter vector index
            search. If not specified, the default minimum score of the semantic model
            associated to the Knowledge Box will be used. Check out the documentation
            for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
        bm25:
          type: number
          minimum: 0.0
          title: Minimum bm25 score
          description: 'Minimum score used to filter bm25 index search. Check out
            the documentation for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score'
          default: 0
      type: object
      title: MinScore
    MistralKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: MistralKey
    ModelType:
      type: integer
      enum:
      - 0
      - 1
      title: ModelType
    NeighbouringParagraphsStrategy:
      properties:
        name:
          type: string
          const: neighbouring_paragraphs
          title: Name
          default: neighbouring_paragraphs
        before:
          type: integer
          minimum: 0.0
          title: Before
          description: Number of previous neighbouring paragraphs to add to the context,
            for each matching paragraph in the retrieval step.
          default: 2
        after:
          type: integer
          minimum: 0.0
          title: After
          description: Number of following neighbouring paragraphs to add to the context,
            for each matching paragraph in the retrieval step.
          default: 2
      type: object
      title: NeighbouringParagraphsStrategy
    NewImportedKbResponse:
      properties:
        kbid:
          type: string
          title: Kbid
        slug:
          type: string
          title: Slug
      type: object
      required:
      - kbid
      - slug
      title: NewImportedKbResponse
    Not_FieldFilterExpression_:
      properties:
        not:
          oneOf:
          - $ref: '#/components/schemas/And_FieldFilterExpression_'
          - $ref: '#/components/schemas/Or_FieldFilterExpression_'
          - $ref: '#/components/schemas/Not_FieldFilterExpression_'
          - $ref: '#/components/schemas/Resource-Input'
          - $ref: '#/components/schemas/Field'
          - $ref: '#/components/schemas/Keyword'
          - $ref: '#/components/schemas/DateCreated'
          - $ref: '#/components/schemas/DateModified'
          - $ref: '#/components/schemas/Label'
          - $ref: '#/components/schemas/ResourceMimetype'
          - $ref: '#/components/schemas/FieldMimetype'
          - $ref: '#/components/schemas/Entity-Input'
          - $ref: '#/components/schemas/Language'
          - $ref: '#/components/schemas/OriginTag'
          - $ref: '#/components/schemas/OriginMetadata'
          - $ref: '#/components/schemas/OriginPath'
          - $ref: '#/components/schemas/OriginSource'
          - $ref: '#/components/schemas/OriginCollaborator'
          - $ref: '#/components/schemas/Generated'
          title: Not
      additionalProperties: false
      type: object
      required:
      - not
      title: Not[FieldFilterExpression]
    Not_ParagraphFilterExpression_:
      properties:
        not:
          oneOf:
          - $ref: '#/components/schemas/And_ParagraphFilterExpression_'
          - $ref: '#/components/schemas/Or_ParagraphFilterExpression_'
          - $ref: '#/components/schemas/Not_ParagraphFilterExpression_'
          - $ref: '#/components/schemas/Label'
          - $ref: '#/components/schemas/Kind'
          title: Not
      additionalProperties: false
      type: object
      required:
      - not
      title: Not[ParagraphFilterExpression]
    OpenAIKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        org:
          type: string
          title: Org
          default: ''
      type: object
      title: OpenAIKey
    Operator:
      type: string
      enum:
      - and
      - or
      title: Operator
    Or_FieldFilterExpression_:
      properties:
        or:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_FieldFilterExpression_'
            - $ref: '#/components/schemas/Or_FieldFilterExpression_'
            - $ref: '#/components/schemas/Not_FieldFilterExpression_'
            - $ref: '#/components/schemas/Resource-Input'
            - $ref: '#/components/schemas/Field'
            - $ref: '#/components/schemas/Keyword'
            - $ref: '#/components/schemas/DateCreated'
            - $ref: '#/components/schemas/DateModified'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/ResourceMimetype'
            - $ref: '#/components/schemas/FieldMimetype'
            - $ref: '#/components/schemas/Entity-Input'
            - $ref: '#/components/schemas/Language'
            - $ref: '#/components/schemas/OriginTag'
            - $ref: '#/components/schemas/OriginMetadata'
            - $ref: '#/components/schemas/OriginPath'
            - $ref: '#/components/schemas/OriginSource'
            - $ref: '#/components/schemas/OriginCollaborator'
            - $ref: '#/components/schemas/Generated'
          type: array
          title: Or
      additionalProperties: false
      type: object
      required:
      - or
      title: Or[FieldFilterExpression]
    Or_ParagraphFilterExpression_:
      properties:
        or:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Or_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Not_ParagraphFilterExpression_'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/Kind'
          type: array
          title: Or
      additionalProperties: false
      type: object
      required:
      - or
      title: Or[ParagraphFilterExpression]
    OriginCollaborator:
      properties:
        prop:
          type: string
          const: origin_collaborator
          title: Prop
        collaborator:
          type: string
          title: Collaborator
          description: Collaborator
      additionalProperties: false
      type: object
      required:
      - prop
      - collaborator
      title: OriginCollaborator
      description: Matches the origin collaborators
    OriginMetadata:
      properties:
        prop:
          type: string
          const: origin_metadata
          title: Prop
        field:
          type: string
          title: Field
          description: Metadata field
        value:
          anyOf:
          - type: string
          - type: 'null'
          title: Value
          description: Value of the metadata field. If blank, matches any document
            with the given metadata field set (to any value)
      additionalProperties: false
      type: object
      required:
      - prop
      - field
      title: OriginMetadata
      description: Matches metadata from the origin
    OriginPath:
      properties:
        prop:
          type: string
          const: origin_path
          title: Prop
        prefix:
          anyOf:
          - type: string
          - type: 'null'
          title: Prefix
          description: 'Prefix of the path, matches all paths under this prefixe.g:
            `prefix=/dir/` matches `/dir` and `/dir/a/b` but not `/dirrrr`'
      additionalProperties: false
      type: object
      required:
      - prop
      title: OriginPath
      description: Matches the origin path
    OriginSource:
      properties:
        prop:
          type: string
          const: origin_source
          title: Prop
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
          description: Source ID
      additionalProperties: false
      type: object
      required:
      - prop
      title: OriginSource
      description: Matches the origin source id
    OriginTag:
      properties:
        prop:
          type: string
          const: origin_tag
          title: Prop
        tag:
          type: string
          title: Tag
          description: The tag to match
      additionalProperties: false
      type: object
      required:
      - prop
      - tag
      title: OriginTag
      description: Matches all fields with a given origin tag
    PageImageStrategy:
      properties:
        name:
          type: string
          const: page_image
          title: Name
          default: page_image
        count:
          anyOf:
          - type: integer
          - type: 'null'
          title: Count
          description: Maximum number of images to retrieve from the page. By default,
            at most 5 images are retrieved.
      type: object
      title: PageImageStrategy
    PageSelections:
      properties:
        page:
          type: integer
          title: Page
        visual:
          items:
            $ref: '#/components/schemas/VisualSelection'
          type: array
          title: Visual
      type: object
      required:
      - page
      - visual
      title: PageSelections
    PalmKey:
      properties:
        credentials:
          type: string
          title: Credentials
          default: ''
        location:
          type: string
          title: Location
          default: ''
      type: object
      title: PalmKey
    ParagraphAnnotation:
      properties:
        classifications:
          items:
            $ref: '#/components/schemas/UserClassification'
          type: array
          title: Classifications
          default: []
        key:
          type: string
          title: Key
      type: object
      required:
      - key
      title: ParagraphAnnotation
    ParagraphImageStrategy:
      properties:
        name:
          type: string
          const: paragraph_image
          title: Name
          default: paragraph_image
      type: object
      title: ParagraphImageStrategy
    PineconeIndexProvider:
      properties:
        type:
          $ref: '#/components/schemas/ExternalIndexProviderType'
          default: pinecone
        api_key:
          type: string
          title: Api Key
        serverless_cloud:
          $ref: '#/components/schemas/PineconeServerlessCloud'
      type: object
      required:
      - api_key
      - serverless_cloud
      title: PineconeIndexProvider
    PineconeServerlessCloud:
      type: string
      enum:
      - aws_us_east_1
      - aws_us_west_2
      - aws_eu_west_1
      - gcp_us_central1
      - azure_eastus2
      title: PineconeServerlessCloud
      description: List of cloud providers supported by Pinecone serverless vector
        database.
    PreQueriesStrategy:
      properties:
        name:
          type: string
          const: prequeries
          title: Name
          default: prequeries
        queries:
          items:
            $ref: '#/components/schemas/PreQuery'
          type: array
          maxItems: 15
          minItems: 1
          title: Queries
          description: List of queries to run before the main query. The results are
            added to the context with the specified weights for each query. There
            is a limit of 10 prequeries per request.
        main_query_weight:
          type: number
          minimum: 0.0
          title: Main query weight
          description: Weight of the main query in the context. Use this to control
            the importance of the main query in the context.
          default: 1.0
      type: object
      required:
      - queries
      title: PreQueriesStrategy
      description: 'This strategy allows to run a set of queries before the main query
        and add the results to the context.

        It allows to give more importance to some queries over others by setting the
        weight of each query.

        The weight of the main query can also be set with the `main_query_weight`
        parameter.'
    PreQuery:
      properties:
        request:
          $ref: '#/components/schemas/FindRequest'
          title: Request
          description: The request to be executed before the main query.
        weight:
          type: number
          minimum: 0.0
          title: Weight
          description: Weight of the prequery in the context. The weight is used to
            scale the results of the prequery before adding them to the context.The
            weight should be a positive number, and they are normalized so that the
            sum of all weights for all prequeries is 1.
          default: 1.0
        id:
          anyOf:
          - type: string
            maxLength: 100
            minLength: 1
          - type: 'null'
          title: Prequery id
          description: Identifier of the prequery. If not specified, it is autogenerated
            based on the index of the prequery in the list (prequery_0, prequery_1,
            ...).
          examples:
          - title_prequery
          - summary_prequery
          - prequery_1
        prefilter:
          type: boolean
          title: Prefilter
          description: If set to true, the prequery results are used to filter the
            scope of the remaining queries. The resources of the most relevant paragraphs
            of the prefilter queries are used as resource filters for the main query
            and other prequeries with the prefilter flag set to false.
          default: false
      type: object
      required:
      - request
      title: PreQuery
    PredictReranker:
      properties:
        name:
          type: string
          const: predict
          title: Name
          default: predict
        window:
          anyOf:
          - type: integer
            maximum: 200.0
          - type: 'null'
          title: Reranker window
          description: Number of elements reranker will use. Window must be greater
            or equal to top_k. Greater values will improve results at cost of retrieval
            and reranking time. By default, this reranker uses a default of 2 times
            top_k
      type: object
      title: PredictReranker
    PushProcessingOptions:
      properties:
        ml_text:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Ml Text
          default: true
      type: object
      title: PushProcessingOptions
    QueryEntityDetection:
      type: string
      enum:
      - predict
      - suggest
      title: QueryEntityDetection
    Question:
      properties:
        text:
          type: string
          title: Text
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        ids_paragraphs:
          items:
            type: string
          type: array
          title: Ids Paragraphs
      type: object
      required:
      - text
      - ids_paragraphs
      title: Question
    QuestionAnswer:
      properties:
        question:
          $ref: '#/components/schemas/Question'
        answers:
          items:
            $ref: '#/components/schemas/Answer'
          type: array
          title: Answers
      type: object
      required:
      - question
      - answers
      title: QuestionAnswer
    QuestionAnswerAnnotation:
      properties:
        question_answer:
          $ref: '#/components/schemas/QuestionAnswer'
        cancelled_by_user:
          type: boolean
          title: Cancelled By User
          default: false
      type: object
      required:
      - question_answer
      title: QuestionAnswerAnnotation
    RankFusionName:
      type: string
      enum:
      - rrf
      title: RankFusionName
    ReciprocalRankFusion:
      properties:
        name:
          type: string
          const: rrf
          title: Name
          default: rrf
        k:
          type: number
          title: RRF k parameter
          description: k parameter changes the influence top-ranked and lower-ranked
            elements have. Research has shown that 60 is a performant value across
            datasets
          default: 60.0
        window:
          anyOf:
          - type: integer
            maximum: 500.0
          - type: 'null'
          title: RRF window
          description: Number of elements for retrieval to do RRF. Window must be
            greater or equal to top_k. Greater values will increase probability of
            multi match at cost of retrieval time
        boosting:
          $ref: '#/components/schemas/ReciprocalRankFusionWeights'
          title: Retrievers boosting
          description: "Define different weights for each retriever. This allows to\
            \ assign different priorities to different retrieval methods. RRF scores\
            \ will be multiplied by this value.\n\nThe default is 1 for each retriever,\
            \ which means no extra boost for any of them. Weights below 0 can be used\
            \ for negative boosting.\n\nThis kind of boosting can be useful in multilingual\
            \ search, for example, where keyword search may not give good results\
            \ and can degrade the final search experience\n        "
      type: object
      title: ReciprocalRankFusion
    ReciprocalRankFusionWeights:
      properties:
        keyword:
          type: number
          title: Keyword
          default: 1.0
        semantic:
          type: number
          title: Semantic
          default: 1.0
      type: object
      title: ReciprocalRankFusionWeights
    Relation:
      properties:
        relation:
          $ref: '#/components/schemas/RelationType'
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
        metadata:
          anyOf:
          - $ref: '#/components/schemas/RelationMetadata'
          - type: 'null'
        from:
          anyOf:
          - $ref: '#/components/schemas/RelationEntity'
          - type: 'null'
        to:
          $ref: '#/components/schemas/RelationEntity'
      type: object
      required:
      - relation
      - to
      title: Relation
    RelationEntity:
      properties:
        value:
          type: string
          title: Value
        type:
          $ref: '#/components/schemas/RelationNodeType'
        group:
          anyOf:
          - type: string
          - type: 'null'
          title: Group
      type: object
      required:
      - value
      - type
      title: RelationEntity
    RelationMetadata:
      properties:
        paragraph_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Paragraph Id
        source_start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Source Start
        source_end:
          anyOf:
          - type: integer
          - type: 'null'
          title: Source End
        to_start:
          anyOf:
          - type: integer
          - type: 'null'
          title: To Start
        to_end:
          anyOf:
          - type: integer
          - type: 'null'
          title: To End
        data_augmentation_task_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Data Augmentation Task Id
      type: object
      title: RelationMetadata
    RelationNodeType:
      type: string
      enum:
      - entity
      - label
      - resource
      - user
      title: RelationNodeType
    RelationRanking:
      type: string
      enum:
      - reranker
      - generative
      title: RelationRanking
    RelationType:
      type: string
      enum:
      - ABOUT
      - CHILD
      - COLAB
      - ENTITY
      - OTHER
      - SYNONYM
      title: RelationType
    RequestSecurity:
      properties:
        groups:
          items:
            type: string
          type: array
          title: Groups
          description: 'List of group ids to do the request with. '
          default: []
      type: object
      title: RequestSecurity
      description: Security metadata for the search request
    RerankerName:
      type: string
      enum:
      - predict
      - noop
      title: RerankerName
      description: "Rerankers\n\n- Predict reranker: after retrieval, send the results\
        \ to Predict API to\n  rerank it. This method uses a reranker model, so one\
        \ can expect better\n  results at the expense of more latency.\n\n  This will\
        \ be the new default\n\n- No-operation (noop) reranker: maintain order and\
        \ do not rerank the results\n  after retrieval"
    Resource:
      properties:
        prop:
          type: string
          const: resource
          title: Prop
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
          description: ID of the resource to match
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
          description: Slug of the resource to match
      additionalProperties: false
      type: object
      required:
      - prop
      title: Resource
      description: Matches all fields of a resource given its id or slug
    ResourceCreated:
      properties:
        uuid:
          type: string
          title: Uuid
        elapsed:
          anyOf:
          - type: number
          - type: 'null'
          title: Elapsed
        seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seqid
      type: object
      required:
      - uuid
      title: ResourceCreated
    ResourceFieldAdded:
      properties:
        seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seqid
      type: object
      title: ResourceFieldAdded
    ResourceFileUploaded:
      properties:
        seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seqid
        uuid:
          anyOf:
          - type: string
          - type: 'null'
          title: Uuid
        field_id:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Field Id
      type: object
      title: ResourceFileUploaded
    ResourceMimetype:
      properties:
        prop:
          type: string
          const: resource_mimetype
          title: Prop
        type:
          type: string
          title: Type
          description: 'Type of the mimetype to match. e.g: In image/jpeg, type is
            image'
        subtype:
          anyOf:
          - type: string
          - type: 'null'
          title: Subtype
          description: 'Type of the mimetype to match. e.g: In image/jpeg, subtype
            is jpeg.Leave blank to match all mimetype of the type'
      additionalProperties: false
      type: object
      required:
      - prop
      - type
      title: ResourceMimetype
      description: 'Matches resources with a mimetype.


        The mimetype of a resource can be assigned independently of the mimetype of
        its fields.

        In resources with multiple fields, you may prefer to use `field_mimetype`'
    ResourceProperties:
      type: string
      enum:
      - basic
      - origin
      - extra
      - relations
      - values
      - extracted
      - errors
      - security
      title: ResourceProperties
    ResourceSecurity:
      properties:
        access_groups:
          items:
            type: string
          type: array
          title: Access groups
          description: List of group ids that can access the resource.
          default: []
      type: object
      title: ResourceSecurity
      description: Security metadata for the resource
    ResourceUpdated:
      properties:
        seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seqid
      type: object
      title: ResourceUpdated
    SearchOptions:
      type: string
      enum:
      - fulltext
      - keyword
      - relations
      - semantic
      title: SearchOptions
    SemanticModelMetadata:
      properties:
        similarity_function:
          $ref: '#/components/schemas/VectorSimilarity'
          description: Vector similarity algorithm that is applied on search
        vector_dimension:
          anyOf:
          - type: integer
          - type: 'null'
          title: Vector Dimension
          description: Dimension of the indexed vectors/embeddings
        default_min_score:
          anyOf:
          - type: number
          - type: 'null'
          title: Default Min Score
          description: Deprecated
      type: object
      required:
      - similarity_function
      title: SemanticModelMetadata
      description: Metadata of the semantic model associated to the KB
    SplitConfig:
      properties:
        max_paragraph:
          type: integer
          title: Max Paragraph
          default: 0
      type: object
      title: SplitConfig
    TableImageStrategy:
      properties:
        name:
          type: string
          const: tables
          title: Name
          default: tables
      type: object
      title: TableImageStrategy
    TextField:
      properties:
        body:
          type: string
          maxLength: 2097152
          title: Body
          description: 'The text body. The format of the text should be specified
            in the format field.

            The sum of all text fields in the request may not exceed 2MB.

            If you need to store more text, consider using a file field instead or
            splitting into multiple requests for each text field.'
        format:
          $ref: '#/components/schemas/TextFormat'
          description: The format of the text.
          default: PLAIN
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy to use at processing time.
            If not set, the default strategy will be used. Extract strategies are
            defined at the learning configuration api.
      type: object
      required:
      - body
      title: TextField
    TextFormat:
      type: string
      enum:
      - PLAIN
      - HTML
      - RST
      - MARKDOWN
      - JSON
      - KEEP_MARKDOWN
      - JSONL
      - PLAIN_BLANKLINE_SPLIT
      title: TextFormat
    TextGenerationKey:
      properties:
        model:
          type: string
          title: Model
          default: ''
      type: object
      title: TextGenerationKey
    TokenSplit:
      properties:
        token:
          type: string
          title: Token
        klass:
          type: string
          title: Klass
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
        cancelled_by_user:
          type: boolean
          title: Cancelled By User
          default: false
      type: object
      required:
      - token
      - klass
      - start
      - end
      title: TokenSplit
    TypeParagraph:
      type: string
      enum:
      - TEXT
      - OCR
      - INCEPTION
      - DESCRIPTION
      - TRANSCRIPT
      - TITLE
      - TABLE
      title: TypeParagraph
    UpdateEntitiesGroupPayload:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
        add:
          additionalProperties:
            $ref: '#/components/schemas/nucliadb_models__entities__Entity'
          type: object
          title: Add
          default: {}
        update:
          additionalProperties:
            $ref: '#/components/schemas/nucliadb_models__entities__Entity'
          type: object
          title: Update
          default: {}
        delete:
          items:
            type: string
          type: array
          title: Delete
          default: []
      type: object
      title: UpdateEntitiesGroupPayload
    UpdateResourcePayload:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
          description: The slug is the user-defined id for the resource
        thumbnail:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail
        metadata:
          anyOf:
          - $ref: '#/components/schemas/InputMetadata'
          - type: 'null'
        usermetadata:
          anyOf:
          - $ref: '#/components/schemas/UserMetadata'
          - type: 'null'
        fieldmetadata:
          anyOf:
          - items:
              $ref: '#/components/schemas/UserFieldMetadata'
            type: array
          - type: 'null'
          title: Fieldmetadata
        origin:
          anyOf:
          - $ref: '#/components/schemas/InputOrigin'
          - type: 'null'
        extra:
          anyOf:
          - $ref: '#/components/schemas/Extra'
          - type: 'null'
          title: Extra
          description: Extra metadata for the resource. It can be used to store structured
            information about the resource that can't be used to query at retrieval
            time. If not set, the existing extra metadata will not be modified.
        files:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/FileField'
          type: object
          title: Files
          description: 'Dictionary of file fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        links:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/LinkField'
          type: object
          title: Links
          description: 'Dictionary of link fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        texts:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/TextField'
          type: object
          title: Texts
          description: 'Dictionary of text fields to be added to the resource. The
            keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        conversations:
          patternProperties:
            ^[a-zA-Z0-9:_-]+$:
              $ref: '#/components/schemas/InputConversationField'
          type: object
          title: Conversations
          description: 'Dictionary of conversation fields to be added to the resource.
            The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$'
          default: {}
        processing_options:
          anyOf:
          - $ref: '#/components/schemas/PushProcessingOptions'
          - type: 'null'
          description: Options for processing the resource. If not set, the default
            options will be used.
          default:
            ml_text: true
        security:
          anyOf:
          - $ref: '#/components/schemas/ResourceSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the resource. It can be used to have
            fine-grained control over who can access the resource.
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hidden
          description: Modify the hidden status of the resource. If not set, the hidden
            status will not be modified.
      type: object
      title: UpdateResourcePayload
    UserClassification:
      properties:
        labelset:
          type: string
          title: Labelset
        label:
          type: string
          title: Label
        cancelled_by_user:
          type: boolean
          title: Cancelled By User
          default: false
      type: object
      required:
      - labelset
      - label
      title: UserClassification
    UserFieldMetadata:
      properties:
        token:
          items:
            $ref: '#/components/schemas/TokenSplit'
          type: array
          title: Token
          default: []
        paragraphs:
          items:
            $ref: '#/components/schemas/ParagraphAnnotation'
          type: array
          title: Paragraphs
          default: []
        selections:
          items:
            $ref: '#/components/schemas/PageSelections'
          type: array
          title: Selections
          default: []
        question_answers:
          items:
            $ref: '#/components/schemas/QuestionAnswerAnnotation'
          type: array
          title: Question Answers
          default: []
        field:
          $ref: '#/components/schemas/FieldID'
      type: object
      required:
      - field
      title: UserFieldMetadata
      description: Field-level metadata set by the user via the rest api
    UserLearningKeys:
      properties:
        openai:
          anyOf:
          - $ref: '#/components/schemas/OpenAIKey'
          - type: 'null'
        azure_openai:
          anyOf:
          - $ref: '#/components/schemas/AzureOpenAIKey'
          - type: 'null'
        palm:
          anyOf:
          - $ref: '#/components/schemas/PalmKey'
          - type: 'null'
        anthropic:
          anyOf:
          - $ref: '#/components/schemas/AnthropicKey'
          - type: 'null'
        claude3:
          anyOf:
          - $ref: '#/components/schemas/AnthropicKey'
          - type: 'null'
        text_generation:
          anyOf:
          - $ref: '#/components/schemas/TextGenerationKey'
          - type: 'null'
        mistral:
          anyOf:
          - $ref: '#/components/schemas/MistralKey'
          - type: 'null'
        azure_mistral:
          anyOf:
          - $ref: '#/components/schemas/AzureMistralKey'
          - type: 'null'
        hf_llm:
          anyOf:
          - $ref: '#/components/schemas/HFLLMKey'
          - type: 'null'
        hf_embedding:
          anyOf:
          - $ref: '#/components/schemas/HFEmbeddingKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
    UserMetadata:
      properties:
        classifications:
          items:
            $ref: '#/components/schemas/UserClassification'
          type: array
          title: Classifications
          default: []
        relations:
          items:
            $ref: '#/components/schemas/Relation'
          type: array
          title: Relations
          default: []
      type: object
      title: UserMetadata
    VLLMExtractionConfig:
      properties:
        rules:
          items:
            type: string
          type: array
          title: Rules
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig'
          - type: 'null'
      type: object
      title: VLLMExtractionConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    VectorSimilarity:
      type: string
      enum:
      - cosine
      - dot
      title: VectorSimilarity
    VisualSelection:
      properties:
        label:
          type: string
          title: Label
        top:
          type: number
          title: Top
        left:
          type: number
          title: Left
        right:
          type: number
          title: Right
        bottom:
          type: number
          title: Bottom
        token_ids:
          items:
            type: integer
          type: array
          title: Token Ids
      type: object
      required:
      - label
      - top
      - left
      - right
      - bottom
      - token_ids
      title: VisualSelection
    nucliadb_models__entities__Entity:
      properties:
        value:
          type: string
          title: Value
        merged:
          type: boolean
          title: Merged
          default: false
        represents:
          items:
            type: string
          type: array
          title: Represents
          default: []
      type: object
      required:
      - value
      title: Entity
    nucliadb_models__filters__Entity:
      properties:
        prop:
          type: string
          const: entity
          title: Prop
        subtype:
          type: string
          title: Subtype
          description: 'Type of the entity. e.g: PERSON'
        value:
          anyOf:
          - type: string
          - type: 'null'
          title: Value
          description: 'Value of the entity. e.g: Anna. If blank, matches any entity
            of the given type'
      additionalProperties: false
      type: object
      required:
      - prop
      - subtype
      title: Entity
      description: Matches fields that contains a detected entity
    nucliadb_models__filters__Label:
      properties:
        prop:
          type: string
          const: label
          title: Prop
        labelset:
          type: string
          title: Labelset
          description: The labelset to match
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
          description: The label to match. If blank, matches all labels in the given
            labelset
      additionalProperties: false
      type: object
      required:
      - prop
      - labelset
      title: Label
      description: Matches fields/paragraphs with a label (or labelset)
    nucliadb_models__labels__Label:
      properties:
        title:
          type: string
          title: Title
        related:
          anyOf:
          - type: string
          - type: 'null'
          title: Related
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
        uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Uri
      type: object
      required:
      - title
      title: Label
    AnonimizationModel:
      title: AnonimizationModel
      enum:
      - disabled
      - multilingual
      type: string
      description: An enumeration.
    GenerativeModel:
      title: GenerativeModel
      enum:
      - generative-multilingual-2023
      - chatgpt
      type: string
      description: An enumeration.
    LearningConfigurationUpdate:
      title: LearningConfigurationUpdate
      type: object
      properties:
        anonymization_model:
          allOf:
          - $ref: '#/components/schemas/AnonimizationModel'
          default: disabled
        generative_model:
          allOf:
          - $ref: '#/components/schemas/GenerativeModel'
          default: chatgpt
        ner_model:
          allOf:
          - $ref: '#/components/schemas/NERModel'
          default: multilingual
      additionalProperties: false
    NERModel:
      title: NERModel
      enum:
      - multilingual
      type: string
      description: An enumeration.
    StoredLearningConfiguration:
      title: StoredLearningConfiguration
      required:
      - semantic_model
      - anonymization_model
      - generative_model
      - ner_model
      - semantic_vector_similarity
      type: object
      properties:
        semantic_model:
          title: Semantic Model
          type: string
        anonymization_model:
          title: Anonymization Model
          type: string
        generative_model:
          title: Generative Model
          type: string
        ner_model:
          title: Ner Model
          type: string
        semantic_vector_similarity:
          title: Semantic Vector Similarity
          type: string
        semantic_vector_size:
          title: Semantic Vector Size
          type: integer
      description: 'Model to map in a generic way what we really store on the db,
        without valdations.

        As enum values containing the versions change from time to time, and we don''t
        keep

        historics, we cannot use the model enums here, as it will fail with older
        values'
    Classification:
      properties:
        labelset:
          type: string
          title: Labelset
        label:
          type: string
          title: Label
      type: object
      required:
      - labelset
      - label
      title: Classification
    CloudLink:
      properties:
        uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Uri
        size:
          anyOf:
          - type: integer
          - type: 'null'
          title: Size
        content_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Content Type
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
      type: object
      title: CloudLink
    ComputedMetadata:
      properties:
        field_classifications:
          items:
            $ref: '#/components/schemas/FieldClassification'
          type: array
          title: Field Classifications
          default: []
      type: object
      title: ComputedMetadata
      description: 'The purpose of this field is to show a cherry-picked set of fields
        from computed metadata

        without having to load the whole computed metadata field.'
    ConversationFieldData:
      properties:
        value:
          anyOf:
          - $ref: '#/components/schemas/FieldConversation'
          - type: 'null'
        extracted:
          anyOf:
          - $ref: '#/components/schemas/ConversationFieldExtractedData'
          - type: 'null'
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      title: ConversationFieldData
    ConversationFieldExtractedData:
      properties:
        text:
          anyOf:
          - $ref: '#/components/schemas/ExtractedText'
          - type: 'null'
        metadata:
          anyOf:
          - $ref: '#/components/schemas/FieldComputedMetadata'
          - type: 'null'
        large_metadata:
          anyOf:
          - $ref: '#/components/schemas/LargeComputedMetadata'
          - type: 'null'
        vectors:
          anyOf:
          - $ref: '#/components/schemas/VectorObject'
          - type: 'null'
        question_answers:
          anyOf:
          - $ref: '#/components/schemas/FieldQuestionAnswers'
          - type: 'null'
      type: object
      title: ConversationFieldExtractedData
    EntitiesGroup:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title of the entities group
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
          description: Color of the entities group. This is for display purposes only.
        custom:
          type: boolean
          title: Custom
          description: Denotes if it has been created by the user
          default: false
        entities:
          additionalProperties:
            $ref: '#/components/schemas/nucliadb_models__entities__Entity'
          type: object
          title: Entities
          default: {}
      type: object
      title: EntitiesGroup
    EntitiesGroupSummary:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title of the entities group
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
          description: Color of the entities group. This is for display purposes only.
        custom:
          type: boolean
          title: Custom
          description: Denotes if it has been created by the user
          default: false
        entities:
          additionalProperties:
            $ref: '#/components/schemas/nucliadb_models__entities__Entity'
          type: object
          title: '[Deprecated] Entities in the group'
          description: This field is deprecated and will be removed in future versions.
            It will always be empty. Use the /api/v1/kb/{kbid}/entitiesgroup/{group}
            endpoint to get the entities of a group.
          default: {}
      type: object
      title: EntitiesGroupSummary
    Error:
      properties:
        body:
          type: string
          title: Body
        code:
          type: integer
          title: Code
        code_str:
          type: string
          title: Code Str
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
      type: object
      required:
      - body
      - code
      - code_str
      - created
      title: Error
    ExtractedText:
      properties:
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
        split_text:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Split Text
        deleted_splits:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Deleted Splits
      type: object
      title: ExtractedText
    FieldClassification:
      properties:
        field:
          $ref: '#/components/schemas/FieldID'
        classifications:
          items:
            $ref: '#/components/schemas/Classification'
          type: array
          title: Classifications
          default: []
      type: object
      required:
      - field
      title: FieldClassification
    FieldComputedMetadata:
      properties:
        metadata:
          $ref: '#/components/schemas/FieldMetadata'
        split_metadata:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/FieldMetadata'
            type: object
          - type: 'null'
          title: Split Metadata
        deleted_splits:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Deleted Splits
      type: object
      required:
      - metadata
      title: FieldComputedMetadata
    FieldConversation:
      properties:
        pages:
          anyOf:
          - type: integer
          - type: 'null'
          title: Pages
        size:
          anyOf:
          - type: integer
          - type: 'null'
          title: Size
        total:
          anyOf:
          - type: integer
          - type: 'null'
          title: Total
      type: object
      title: FieldConversation
      description: 'This is a metadata representation of a conversation about how
        many pages

        of messages and total of messages we have.


        This class is used mainly when exposing a conversation in the resource level'
    FieldEntities:
      properties:
        entities:
          items:
            $ref: '#/components/schemas/FieldEntity'
          type: array
          title: Entities
      type: object
      required:
      - entities
      title: FieldEntities
      description: Wrapper for the entities extracted from a field (required because
        protobuf doesn't support lists of lists)
    FieldEntity:
      properties:
        text:
          type: string
          title: Text
        label:
          type: string
          title: Label
        positions:
          items:
            $ref: '#/components/schemas/Position'
          type: array
          title: Positions
      type: object
      required:
      - text
      - label
      - positions
      title: FieldEntity
    FieldFile:
      properties:
        added:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Added
        file:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        password:
          anyOf:
          - type: string
          - type: 'null'
          title: Password
        external:
          type: boolean
          title: External
          default: false
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy used at processing time.
            If not set, the default strategy was used. Extract strategies are defined
            at the learning configuration api.
      type: object
      title: FieldFile
    FieldLargeMetadata:
      properties:
        entities:
          anyOf:
          - items:
              $ref: '#/components/schemas/Entity-Output'
            type: array
          - type: 'null'
          title: Entities
        tokens:
          anyOf:
          - additionalProperties:
              type: integer
            type: object
          - type: 'null'
          title: Tokens
      type: object
      title: FieldLargeMetadata
    FieldLink:
      properties:
        added:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Added
        headers:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Headers
        cookies:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Cookies
        uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Uri
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        localstorage:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Localstorage
        css_selector:
          anyOf:
          - type: string
          - type: 'null'
          title: Css Selector
        xpath:
          anyOf:
          - type: string
          - type: 'null'
          title: Xpath
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy used at processing time.
            If not set, the default strategy was used. Extract strategies are defined
            at the learning configuration api.
      type: object
      title: FieldLink
    FieldMetadata:
      properties:
        links:
          items:
            type: string
          type: array
          title: Links
        paragraphs:
          items:
            $ref: '#/components/schemas/nucliadb_models__common__Paragraph'
          type: array
          title: Paragraphs
        ner:
          additionalProperties:
            type: string
          type: object
          title: Ner
        entities:
          additionalProperties:
            $ref: '#/components/schemas/FieldEntities'
          type: object
          title: Entities
        classifications:
          items:
            $ref: '#/components/schemas/Classification'
          type: array
          title: Classifications
        last_index:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Index
        last_understanding:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Understanding
        last_extract:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Extract
        last_summary:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Summary
        thumbnail:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        positions:
          additionalProperties:
            $ref: '#/components/schemas/Positions'
          type: object
          title: Positions
        relations:
          anyOf:
          - items:
              $ref: '#/components/schemas/Relation'
            type: array
          - type: 'null'
          title: Relations
        mime_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Mime Type
      type: object
      required:
      - links
      - paragraphs
      - ner
      - entities
      - classifications
      - positions
      title: FieldMetadata
    FieldQuestionAnswers:
      properties:
        question_answers:
          $ref: '#/components/schemas/QuestionAnswers'
        split_question_answers:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/QuestionAnswers'
            type: object
          - type: 'null'
          title: Split Question Answers
        deleted_splits:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Deleted Splits
      type: object
      required:
      - question_answers
      title: FieldQuestionAnswers
    FieldText:
      properties:
        body:
          anyOf:
          - type: string
          - type: 'null'
          title: Body
        format:
          anyOf:
          - $ref: '#/components/schemas/TextFormat'
          - type: 'null'
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
          description: Id of the Nuclia extract strategy used at processing time.
            If not set, the default strategy was used. Extract strategies are defined
            at the learning configuration api.
      type: object
      title: FieldText
    FileExtractedData:
      properties:
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
        nested:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Nested
        file_generated:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/CloudLink'
            type: object
          - type: 'null'
          title: File Generated
        file_rows_previews:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/RowsPreview'
            type: object
          - type: 'null'
          title: File Rows Previews
        file_preview:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        file_pages_previews:
          anyOf:
          - $ref: '#/components/schemas/FilePages'
          - type: 'null'
        file_thumbnail:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        field:
          anyOf:
          - type: string
          - type: 'null'
          title: Field
        icon:
          anyOf:
          - type: string
          - type: 'null'
          title: Icon
        nested_position:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/NestedPosition'
            type: object
          - type: 'null'
          title: Nested Position
        nested_list_position:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/NestedListPosition'
            type: object
          - type: 'null'
          title: Nested List Position
      type: object
      title: FileExtractedData
    FileFieldData:
      properties:
        value:
          anyOf:
          - $ref: '#/components/schemas/FieldFile'
          - type: 'null'
        extracted:
          anyOf:
          - $ref: '#/components/schemas/FileFieldExtractedData'
          - type: 'null'
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      title: FileFieldData
    FileFieldExtractedData:
      properties:
        text:
          anyOf:
          - $ref: '#/components/schemas/ExtractedText'
          - type: 'null'
        metadata:
          anyOf:
          - $ref: '#/components/schemas/FieldComputedMetadata'
          - type: 'null'
        large_metadata:
          anyOf:
          - $ref: '#/components/schemas/LargeComputedMetadata'
          - type: 'null'
        vectors:
          anyOf:
          - $ref: '#/components/schemas/VectorObject'
          - type: 'null'
        question_answers:
          anyOf:
          - $ref: '#/components/schemas/FieldQuestionAnswers'
          - type: 'null'
        file:
          anyOf:
          - $ref: '#/components/schemas/FileExtractedData'
          - type: 'null'
      type: object
      title: FileFieldExtractedData
    FilePages:
      properties:
        pages:
          anyOf:
          - items:
              $ref: '#/components/schemas/CloudLink'
            type: array
          - type: 'null'
          title: Pages
        positions:
          anyOf:
          - items:
              $ref: '#/components/schemas/PagePositions'
            type: array
          - type: 'null'
          title: Positions
        structures:
          anyOf:
          - items:
              $ref: '#/components/schemas/PageStructure'
            type: array
          - type: 'null'
          title: Structures
      type: object
      title: FilePages
    GenericFieldData:
      properties:
        value:
          anyOf:
          - type: string
          - type: 'null'
          title: Value
        extracted:
          anyOf:
          - $ref: '#/components/schemas/TextFieldExtractedData'
          - type: 'null'
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      title: GenericFieldData
    KnowledgeBoxConfig:
      properties:
        slug:
          anyOf:
          - type: string
            pattern: ^[a-zA-Z0-9:_-]+$
          - type: 'null'
          title: Slug
          description: Slug for the Knowledge Box.
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title for the Knowledge Box.
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: Description for the Knowledge Box.
        learning_configuration:
          anyOf:
          - type: object
          - type: 'null'
          title: Learning Configuration
          description: Learning configuration for the Knowledge Box. If provided,
            NucliaDB will set the learning configuration for the Knowledge Box.
        external_index_provider:
          anyOf:
          - $ref: '#/components/schemas/PineconeIndexProvider'
          - type: 'null'
          title: External Index Provider
          description: External index provider for the Knowledge Box.
        configured_external_index_provider:
          anyOf:
          - type: object
          - type: 'null'
          title: Configured External Index Provider
          description: Metadata for the configured external index provider (if any)
        similarity:
          anyOf:
          - $ref: '#/components/schemas/VectorSimilarity'
          - type: 'null'
          description: This field is deprecated. Use 'learning_configuration' instead.
        hidden_resources_enabled:
          type: boolean
          title: Hidden Resources Enabled
          description: Allow hiding resources
          default: false
        hidden_resources_hide_on_creation:
          type: boolean
          title: Hidden Resources Hide On Creation
          description: Hide newly created resources
          default: false
      type: object
      title: KnowledgeBoxConfig
    KnowledgeBoxEntities:
      properties:
        uuid:
          type: string
          title: Uuid
        groups:
          additionalProperties:
            $ref: '#/components/schemas/EntitiesGroupSummary'
          type: object
          title: Groups
          default: {}
      type: object
      required:
      - uuid
      title: KnowledgeBoxEntities
    KnowledgeBoxLabels:
      properties:
        uuid:
          type: string
          title: Uuid
        labelsets:
          additionalProperties:
            $ref: '#/components/schemas/LabelSet'
          type: object
          title: Labelsets
          default: {}
      type: object
      required:
      - uuid
      title: KnowledgeBoxLabels
    LargeComputedMetadata:
      properties:
        metadata:
          anyOf:
          - $ref: '#/components/schemas/FieldLargeMetadata'
          - type: 'null'
        split_metadata:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/FieldLargeMetadata'
            type: object
          - type: 'null'
          title: Split Metadata
        deleted_splits:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Deleted Splits
      type: object
      title: LargeComputedMetadata
    LinkExtractedData:
      properties:
        date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Date
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
        link_thumbnail:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        link_preview:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        field:
          anyOf:
          - type: string
          - type: 'null'
          title: Field
        link_image:
          anyOf:
          - $ref: '#/components/schemas/CloudLink'
          - type: 'null'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
        embed:
          anyOf:
          - type: string
          - type: 'null'
          title: Embed
        file_generated:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/CloudLink'
            type: object
          - type: 'null'
          title: File Generated
      type: object
      title: LinkExtractedData
    LinkFieldData:
      properties:
        value:
          anyOf:
          - $ref: '#/components/schemas/FieldLink'
          - type: 'null'
        extracted:
          anyOf:
          - $ref: '#/components/schemas/LinkFieldExtractedData'
          - type: 'null'
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      title: LinkFieldData
    LinkFieldExtractedData:
      properties:
        text:
          anyOf:
          - $ref: '#/components/schemas/ExtractedText'
          - type: 'null'
        metadata:
          anyOf:
          - $ref: '#/components/schemas/FieldComputedMetadata'
          - type: 'null'
        large_metadata:
          anyOf:
          - $ref: '#/components/schemas/LargeComputedMetadata'
          - type: 'null'
        vectors:
          anyOf:
          - $ref: '#/components/schemas/VectorObject'
          - type: 'null'
        question_answers:
          anyOf:
          - $ref: '#/components/schemas/FieldQuestionAnswers'
          - type: 'null'
        link:
          anyOf:
          - $ref: '#/components/schemas/LinkExtractedData'
          - type: 'null'
      type: object
      title: LinkFieldExtractedData
    Metadata:
      properties:
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          default: {}
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        languages:
          anyOf:
          - items:
              type: string
            type: array
            maxItems: 1024
          - type: 'null'
          title: Languages
        status:
          $ref: '#/components/schemas/ResourceProcessingStatus'
      type: object
      required:
      - status
      title: Metadata
    NestedListPosition:
      properties:
        positions:
          items:
            $ref: '#/components/schemas/NestedPosition'
          type: array
          title: Positions
      type: object
      required:
      - positions
      title: NestedListPosition
    NestedPosition:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        page:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page
      type: object
      title: NestedPosition
    Origin:
      properties:
        source_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Id
        url:
          anyOf:
          - type: string
          - type: 'null'
          title: Url
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        modified:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Modified
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Generic metadata from the resource at the origin system. It
            can later be used for filtering on search endpoints with '/origin.metadata/{key}/{value}'
          default: {}
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Resource tags about the origin system. It can later be used
            for filtering on search endpoints with '/origin.tags/{tag}'
          default: []
        collaborators:
          items:
            type: string
          type: array
          title: Collaborators
          default: []
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        related:
          items:
            type: string
          type: array
          title: Related
          default: []
        path:
          anyOf:
          - type: string
          - type: 'null'
          title: Path
          description: Path of the original resource. Typically used to store folder
            structure information of the resource at the origin system. It can be
            later used for filtering on search endpoints with '/origin.path/{path}'
        source:
          anyOf:
          - $ref: '#/components/schemas/Source'
          - type: 'null'
          default: API
      type: object
      title: Origin
    PageInformation:
      properties:
        page:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page
        page_with_visual:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Page With Visual
      type: object
      title: PageInformation
    PagePositions:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
      type: object
      title: PagePositions
    PageStructure:
      properties:
        page:
          $ref: '#/components/schemas/PageStructurePage'
        tokens:
          items:
            $ref: '#/components/schemas/PageStructureToken'
          type: array
          title: Tokens
      type: object
      required:
      - page
      - tokens
      title: PageStructure
    PageStructurePage:
      properties:
        width:
          type: integer
          title: Width
        height:
          type: integer
          title: Height
      type: object
      required:
      - width
      - height
      title: PageStructurePage
    PageStructureToken:
      properties:
        x:
          type: number
          title: X
        y:
          type: number
          title: Y
        width:
          type: number
          title: Width
        height:
          type: number
          title: Height
        text:
          type: string
          title: Text
        line:
          type: number
          title: Line
      type: object
      required:
      - x
      - y
      - width
      - height
      - text
      - line
      title: PageStructureToken
    Paragraph:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        start_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Start Seconds
        end_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: End Seconds
        kind:
          anyOf:
          - $ref: '#/components/schemas/TypeParagraph'
          - type: 'null'
        classifications:
          anyOf:
          - items:
              $ref: '#/components/schemas/Classification'
            type: array
          - type: 'null'
          title: Classifications
        sentences:
          anyOf:
          - items:
              $ref: '#/components/schemas/Sentence'
            type: array
          - type: 'null'
          title: Sentences
        key:
          anyOf:
          - type: string
          - type: 'null'
          title: Key
        page:
          anyOf:
          - $ref: '#/components/schemas/PageInformation'
          - type: 'null'
        representation:
          anyOf:
          - $ref: '#/components/schemas/Representation'
          - type: 'null'
        relations:
          anyOf:
          - $ref: '#/components/schemas/ParagraphRelations'
          - type: 'null'
      type: object
      title: Paragraph
    ParagraphRelations:
      properties:
        parents:
          items:
            type: string
          type: array
          title: Parents
          default: []
        siblings:
          items:
            type: string
          type: array
          title: Siblings
          default: []
        replacements:
          items:
            type: string
          type: array
          title: Replacements
          default: []
      type: object
      title: ParagraphRelations
    Position:
      properties:
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
      type: object
      required:
      - start
      - end
      title: Position
    Positions:
      properties:
        position:
          items:
            $ref: '#/components/schemas/Position'
          type: array
          title: Position
        entity:
          type: string
          title: Entity
      type: object
      required:
      - position
      - entity
      title: Positions
    QuestionAnswers:
      properties:
        question_answer:
          items:
            $ref: '#/components/schemas/QuestionAnswer'
          type: array
          title: Question Answer
      type: object
      required:
      - question_answer
      title: QuestionAnswers
    QueueType:
      type: string
      enum:
      - private
      - shared
      title: QueueType
    Representation:
      properties:
        is_a_table:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is A Table
        reference_file:
          anyOf:
          - type: string
          - type: 'null'
          title: Reference File
      type: object
      title: Representation
    RequestsResult:
      properties:
        processing_id:
          type: string
          title: Processing ID
          description: Processing ID of the resource.
        resource_id:
          type: string
          title: Resource ID
          description: Resource ID.
        kbid:
          type: string
          title: KnowledgeBox ID
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          description: Title of the resource.
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: Labels of the resource.
          default: []
        completed:
          type: boolean
          title: Completed
          description: Whether the resource has been completed
        scheduled:
          type: boolean
          title: Scheduled
          description: Whether the resource has been scheduled
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Timestamp of when the resource was first scheduled.
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
          description: Timestamp of when the resource was completed
        scheduled_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Scheduled At
          description: Timestamp of when the resource was first scheduled.
        failed:
          type: boolean
          title: Failed
          description: Whether the resource has failed to process
          default: false
        retries:
          type: integer
          title: Retries
          description: Number of retries for the resource.
          default: 0
        schedule_eta:
          type: number
          title: Schedule ETA
          description: Estimated time until the resource is scheduled.
          default: 0.0
        schedule_order:
          type: integer
          title: Schedule Order
          description: Order of the resource in the schedule queue.
          default: 0
      type: object
      required:
      - processing_id
      - resource_id
      - kbid
      - completed
      - scheduled
      - timestamp
      title: RequestsResult
    RequestsResults:
      properties:
        results:
          items:
            $ref: '#/components/schemas/RequestsResult'
          type: array
          title: Results
          description: List of results.
          default: []
        cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
          description: Cursor to use for the next page of results.
      type: object
      title: RequestsResults
    ResourceData:
      properties:
        texts:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/TextFieldData'
            type: object
          - type: 'null'
          title: Texts
        files:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/FileFieldData'
            type: object
          - type: 'null'
          title: Files
        links:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/LinkFieldData'
            type: object
          - type: 'null'
          title: Links
        conversations:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/ConversationFieldData'
            type: object
          - type: 'null'
          title: Conversations
        generics:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/GenericFieldData'
            type: object
          - type: 'null'
          title: Generics
      type: object
      title: ResourceData
    ResourceField:
      properties:
        field_type:
          $ref: '#/components/schemas/FieldTypeName'
        field_id:
          type: string
          title: Field Id
        value:
          title: Value
        extracted:
          anyOf:
          - $ref: '#/components/schemas/TextFieldExtractedData'
          - $ref: '#/components/schemas/FileFieldExtractedData'
          - $ref: '#/components/schemas/LinkFieldExtractedData'
          - $ref: '#/components/schemas/ConversationFieldExtractedData'
          - type: 'null'
          title: Extracted
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      required:
      - field_type
      - field_id
      title: ResourceField
    ResourceFieldProperties:
      type: string
      enum:
      - value
      - extracted
      - error
      title: ResourceFieldProperties
    ResourceList:
      properties:
        resources:
          items:
            $ref: '#/components/schemas/nucliadb_models__resource__Resource'
          type: array
          title: Resources
        pagination:
          $ref: '#/components/schemas/ResourcePagination'
      type: object
      required:
      - resources
      - pagination
      title: ResourceList
    ResourcePagination:
      properties:
        page:
          type: integer
          title: Page
        size:
          type: integer
          title: Size
        last:
          type: boolean
          title: Last
      type: object
      required:
      - page
      - size
      - last
      title: ResourcePagination
    ResourceProcessingStatus:
      type: string
      enum:
      - PENDING
      - PROCESSED
      - ERROR
      - EMPTY
      - BLOCKED
      - EXPIRED
      title: ResourceProcessingStatus
    Row:
      properties:
        cell:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Cell
      type: object
      title: Row
    RowsPreview:
      properties:
        sheets:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/Sheet'
            type: object
          - type: 'null'
          title: Sheets
      type: object
      title: RowsPreview
    Sentence:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        key:
          anyOf:
          - type: string
          - type: 'null'
          title: Key
      type: object
      title: Sentence
    Sheet:
      properties:
        rows:
          anyOf:
          - items:
              $ref: '#/components/schemas/Row'
            type: array
          - type: 'null'
          title: Rows
      type: object
      title: Sheet
    Source:
      type: string
      enum:
      - WEB
      - DESKTOP
      - API
      - PYSDK
      title: Source
    Status:
      properties:
        prop:
          type: string
          const: status
          title: Prop
        status:
          $ref: '#/components/schemas/ResourceProcessingStatus'
          description: The status of the resource
      additionalProperties: false
      type: object
      required:
      - prop
      - status
      title: Status
      description: Matches resource in a certain processing status
    StatusResponse:
      properties:
        status:
          $ref: '#/components/schemas/Status'
        total:
          type: integer
          title: Total
          default: 0
        processed:
          type: integer
          title: Processed
          default: 0
        retries:
          type: integer
          title: Retries
          default: 0
      type: object
      required:
      - status
      title: StatusResponse
    TextFieldData:
      properties:
        value:
          anyOf:
          - $ref: '#/components/schemas/FieldText'
          - type: 'null'
        extracted:
          anyOf:
          - $ref: '#/components/schemas/TextFieldExtractedData'
          - type: 'null'
        error:
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: 'null'
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        errors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Error'
            type: array
          - type: 'null'
          title: Errors
      type: object
      title: TextFieldData
    TextFieldExtractedData:
      properties:
        text:
          anyOf:
          - $ref: '#/components/schemas/ExtractedText'
          - type: 'null'
        metadata:
          anyOf:
          - $ref: '#/components/schemas/FieldComputedMetadata'
          - type: 'null'
        large_metadata:
          anyOf:
          - $ref: '#/components/schemas/LargeComputedMetadata'
          - type: 'null'
        vectors:
          anyOf:
          - $ref: '#/components/schemas/VectorObject'
          - type: 'null'
        question_answers:
          anyOf:
          - $ref: '#/components/schemas/FieldQuestionAnswers'
          - type: 'null'
      type: object
      title: TextFieldExtractedData
    Vector:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        start_paragraph:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start Paragraph
        end_paragraph:
          anyOf:
          - type: integer
          - type: 'null'
          title: End Paragraph
        vector:
          anyOf:
          - items:
              type: number
            type: array
          - type: 'null'
          title: Vector
      type: object
      title: Vector
    VectorObject:
      properties:
        vectors:
          anyOf:
          - $ref: '#/components/schemas/Vectors'
          - type: 'null'
        split_vectors:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/Vectors'
            type: object
          - type: 'null'
          title: Split Vectors
        deleted_splits:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Deleted Splits
      type: object
      title: VectorObject
    Vectors:
      properties:
        vectors:
          anyOf:
          - items:
              $ref: '#/components/schemas/Vector'
            type: array
          - type: 'null'
          title: Vectors
      type: object
      title: Vectors
    nucliadb_models__extracted__Entity:
      properties:
        token:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
        root:
          anyOf:
          - type: string
          - type: 'null'
          title: Root
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
      type: object
      title: Entity
    nucliadb_models__filters__Resource:
      properties:
        prop:
          type: string
          const: resource
          title: Prop
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
          description: ID of the resource to match
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
          description: Slug of the resource to match
      additionalProperties: false
      type: object
      required:
      - prop
      title: Resource
      description: Matches all fields of a resource given its id or slug
    nucliadb_models__resource__Resource:
      properties:
        id:
          type: string
          title: Id
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        icon:
          anyOf:
          - type: string
          - type: 'null'
          title: Icon
        thumbnail:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail
        metadata:
          anyOf:
          - $ref: '#/components/schemas/Metadata'
          - type: 'null'
        usermetadata:
          anyOf:
          - $ref: '#/components/schemas/UserMetadata'
          - type: 'null'
        fieldmetadata:
          anyOf:
          - items:
              $ref: '#/components/schemas/UserFieldMetadata'
            type: array
          - type: 'null'
          title: Fieldmetadata
        computedmetadata:
          anyOf:
          - $ref: '#/components/schemas/ComputedMetadata'
          - type: 'null'
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        modified:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Modified
        last_seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Seqid
        last_account_seq:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Account Seq
        queue:
          anyOf:
          - $ref: '#/components/schemas/QueueType'
          - type: 'null'
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hidden
        origin:
          anyOf:
          - $ref: '#/components/schemas/Origin'
          - type: 'null'
        extra:
          anyOf:
          - $ref: '#/components/schemas/Extra'
          - type: 'null'
        relations:
          anyOf:
          - items:
              $ref: '#/components/schemas/Relation'
            type: array
          - type: 'null'
          title: Relations
        data:
          anyOf:
          - $ref: '#/components/schemas/ResourceData'
          - type: 'null'
        security:
          anyOf:
          - $ref: '#/components/schemas/ResourceSecurity'
          - type: 'null'
          title: Security
          description: Resource security metadata
      type: object
      required:
      - id
      title: Resource
    AgentType:
      type: string
      enum:
      - graph
      - label
      - ask
      - qa
      - extract
      - prompt_guard
      - llama_guard
      title: AgentType
    AgentsFilter:
      properties:
        type:
          $ref: '#/components/schemas/AgentType'
        task_names:
          items:
            type: string
          type: array
          title: Task Names
          description: list of task names. If None or empty, all tasks for that operation
            are applied.
      type: object
      required:
      - type
      title: AgentsFilter
    And_ResourceFilterExpression_:
      properties:
        and:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Or_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Not_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Resource-Input'
            - $ref: '#/components/schemas/DateCreated'
            - $ref: '#/components/schemas/DateModified'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/ResourceMimetype'
            - $ref: '#/components/schemas/Language'
            - $ref: '#/components/schemas/OriginTag'
            - $ref: '#/components/schemas/OriginMetadata'
            - $ref: '#/components/schemas/OriginPath'
            - $ref: '#/components/schemas/OriginSource'
            - $ref: '#/components/schemas/OriginCollaborator'
            - $ref: '#/components/schemas/Status'
          type: array
          title: And
      additionalProperties: false
      type: object
      required:
      - and
      title: And[ResourceFilterExpression]
    AppliedDataAugmentation:
      properties:
        qas:
          anyOf:
          - $ref: '#/components/schemas/QuestionAnswers'
          - type: 'null'
          description: Question and answers generated by the Question Answers agent
        new_text_fields:
          items:
            $ref: '#/components/schemas/NewTextField'
          type: array
          title: New Text Fields
          description: New text fields. Only generated by the Generator agent as of
            now.
        changed:
          type: boolean
          title: Changed
          description: Indicates if the FieldMetadata was changed by the agents
          default: true
      type: object
      title: AppliedDataAugmentation
    AskRequest:
      properties:
        audit_metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Audit metadata
          description: A dictionary containing optional audit-specific metadata, such
            as user_id, environment, or other contextual information. This metadata
            can be leveraged for filtering and analyzing activity logs in future operations.
            Each key-value pair represents a piece of metadata relevant to the user's
            request.
          examples:
          - environment: test
            user: my-user-123
        query:
          type: string
          maxLength: 20000
          title: Query
          description: The query to get a generative answer for
        top_k:
          type: integer
          maximum: 200.0
          minimum: 1.0
          title: Top k
          description: The top most relevant results to fetch at the retrieval step.
            The maximum number of results allowed is 200.
          default: 20
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/FilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        keyword_filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Keyword filters
          description: 'List of keyword filter expressions to apply to the retrieval
            step. The text block search will only be performed on the documents that
            contain the specified keywords. The filters are case-insensitive, and
            only alphanumeric characters and spaces are allowed. Filtering examples
            can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
          examples:
          - - NLP
            - BERT
          - - all:
              - NLP
              - BERT
          - - Friedrich Nietzsche
            - Immanuel Kant
        vectorset:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum score
          description: Minimum score to filter search results. Results with a lower
            score will be ignored. Accepts either a float or a dictionary with the
            minimum scores for the bm25 and vector indexes. If a float is provided,
            it is interpreted as the minimum score for vector index search.
        features:
          items:
            $ref: '#/components/schemas/ChatOptions'
          type: array
          title: Chat features
          description: Features enabled for the chat endpoint. Semantic search is
            done if `semantic` is included. If `keyword` is included, the results
            will include matching paragraphs from the bm25 index. If `relations` is
            included, a graph of entities related to the answer is returned. `paragraphs`
            and `vectors` are deprecated, please use `keyword` and `semantic` instead
          default:
          - semantic
          - keyword
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        field_type_filter:
          items:
            $ref: '#/components/schemas/FieldTypeName'
          type: array
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        extracted:
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          type: array
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
          deprecated: true
        context:
          anyOf:
          - items:
              $ref: '#/components/schemas/ChatContextMessage'
            type: array
          - type: 'null'
          title: Chat history
          description: Use to rephrase the new LLM query by taking into account the
            chat conversation history
        extra_context:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Extra query context
          description: "Additional context that is added to the retrieval context\
            \ sent to the LLM.\n        It allows extending the chat feature with\
            \ content that may not be in the Knowledge Box."
        extra_context_images:
          anyOf:
          - items:
              $ref: '#/components/schemas/Image'
            type: array
          - type: 'null'
          title: Extra query context images
          description: "Additional images added to the retrieval context sent to the\
            \ LLM.\"\n        It allows extending the chat feature with content that\
            \ may not be in the Knowledge Box."
        autofilter:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        highlight:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        resource_filters:
          items:
            type: string
          type: array
          title: Resources filter
          description: List of resource ids to filter search results for. Only paragraphs
            from the specified resources will be returned.
          default: []
        prompt:
          anyOf:
          - type: string
          - $ref: '#/components/schemas/CustomPrompt'
          - type: 'null'
          title: Prompts
          description: Use to customize the prompts given to the generative model.
            Both system and user prompts can be customized. If a string is provided,
            it is interpreted as the user prompt.
        rank_fusion:
          anyOf:
          - $ref: '#/components/schemas/RankFusionName'
          - oneOf:
            - $ref: '#/components/schemas/ReciprocalRankFusion'
            discriminator:
              propertyName: name
              mapping:
                rrf: '#/components/schemas/ReciprocalRankFusion'
          title: Rank fusion
          description: Rank fusion algorithm to use to merge results from multiple
            retrievers (keyword, semantic)
          default: rrf
        reranker:
          anyOf:
          - $ref: '#/components/schemas/RerankerName'
          - oneOf:
            - $ref: '#/components/schemas/PredictReranker'
            discriminator:
              propertyName: name
              mapping:
                predict: '#/components/schemas/PredictReranker'
          title: Reranker
          description: Reranker let you specify which method you want to use to rerank
            your results at the end of retrieval
          default: predict
        citations:
          type: boolean
          title: Citations
          description: Whether to include the citations for the answer in the response
          default: false
        citation_threshold:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Citation Threshold
          description: If citations is True, this sets the similarity threshold (0
            to 1) for paragraphs to be included as citations. Lower values result
            in more citations. If not provided, Nuclia's default threshold is used.
        security:
          anyOf:
          - $ref: '#/components/schemas/RequestSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the request. If not provided, the search
            request is done without the security lookup phase.
        show_hidden:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        rag_strategies:
          items:
            oneOf:
            - $ref: '#/components/schemas/FieldExtensionStrategy'
            - $ref: '#/components/schemas/FullResourceStrategy'
            - $ref: '#/components/schemas/HierarchyResourceStrategy'
            - $ref: '#/components/schemas/NeighbouringParagraphsStrategy'
            - $ref: '#/components/schemas/MetadataExtensionStrategy'
            - $ref: '#/components/schemas/ConversationalStrategy'
            - $ref: '#/components/schemas/PreQueriesStrategy'
            - $ref: '#/components/schemas/GraphStrategy'
            discriminator:
              propertyName: name
              mapping:
                conversation: '#/components/schemas/ConversationalStrategy'
                field_extension: '#/components/schemas/FieldExtensionStrategy'
                full_resource: '#/components/schemas/FullResourceStrategy'
                graph_beta: '#/components/schemas/GraphStrategy'
                hierarchy: '#/components/schemas/HierarchyResourceStrategy'
                metadata_extension: '#/components/schemas/MetadataExtensionStrategy'
                neighbouring_paragraphs: '#/components/schemas/NeighbouringParagraphsStrategy'
                prequeries: '#/components/schemas/PreQueriesStrategy'
          type: array
          title: RAG context building strategies
          description: 'Options for tweaking how the context for the LLM model is
            crafted:

            - `full_resource` will add the full text of the matching resources to
            the context. This strategy cannot be combined with `hierarchy`, `neighbouring_paragraphs`,
            or `field_extension`.

            - `field_extension` will add the text of the matching resource''s specified
            fields to the context.

            - `hierarchy` will add the title and summary text of the parent resource
            to the context for each matching paragraph.

            - `neighbouring_paragraphs` will add the sorrounding paragraphs to the
            context for each matching paragraph.

            - `metadata_extension` will add the metadata of the matching paragraphs
            or its resources to the context.

            - `prequeries` allows to run multiple retrieval queries before the main
            query and add the results to the context. The results of specific queries
            can be boosted by the specifying weights.


            If empty, the default strategy is used, which simply adds the text of
            the matching paragraphs to the context.

            '
          default: []
          examples:
          - - count: 2
              name: full_resource
          - - fields:
              - t/amend
              - a/title
              name: field_extension
          - - count: 2
              name: hierarchy
          - - after: 2
              before: 2
              name: neighbouring_paragraphs
          - - name: metadata_extension
              types:
              - origin
              - classification_labels
          - - name: prequeries
              queries:
              - request:
                  features:
                  - keyword
                  query: What is the capital of France?
                weight: 0.5
              - request:
                  query: What is the capital of Germany?
                weight: 0.5
        rag_images_strategies:
          items:
            oneOf:
            - $ref: '#/components/schemas/PageImageStrategy'
            - $ref: '#/components/schemas/ParagraphImageStrategy'
            - $ref: '#/components/schemas/TableImageStrategy'
            discriminator:
              propertyName: name
              mapping:
                page_image: '#/components/schemas/PageImageStrategy'
                paragraph_image: '#/components/schemas/ParagraphImageStrategy'
                tables: '#/components/schemas/TableImageStrategy'
          type: array
          title: RAG image context building strategies
          description: 'Options for tweaking how the image based context for the LLM
            model is crafted:

            - `page_image` will add the full page image of the matching resources
            to the context.

            - `tables` will send the table images for the paragraphs that contain
            tables and matched the retrieval query.

            - `paragraph_image` will add the images of the paragraphs that contain
            images (images for tables are not included).

            No image strategy is used by default. Note that this is only available
            for LLM models that support visual inputs. If the model does not support
            visual inputs, the image strategies will be ignored.'
          default: []
        debug:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative model
          description: The generative model to use for the chat endpoint. If not provided,
            the model configured for the Knowledge Box is used.
        max_tokens:
          anyOf:
          - type: integer
          - $ref: '#/components/schemas/MaxTokens'
          - type: 'null'
          title: Maximum LLM tokens to use for the request
          description: Use to limit the amount of tokens used in the LLM context and/or
            for generating the answer. If not provided, the default maximum tokens
            of the generative model will be used. If an integer is provided, it is
            interpreted as the maximum tokens for the answer.
        rephrase:
          type: boolean
          title: Rephrase
          description: Rephrase the query for a more efficient retrieval. This will
            consume LLM tokens and make the request slower.
          default: false
        prefer_markdown:
          type: boolean
          title: Prefer markdown
          description: If set to true, the response will be in markdown format
          default: false
        answer_json_schema:
          anyOf:
          - type: object
          - type: 'null'
          title: Answer JSON schema
          description: 'Desired JSON schema for the LLM answer.

            This schema is passed to the LLM so that it answers in a scructured format
            following the schema. If not provided, textual response is returned.

            Note that when using this parameter, the answer in the generative response
            will not be returned in chunks, the whole response text will be returned
            instead.

            Using this feature also disables the `citations` parameter. For maximal
            accuracy, please include a `description` for each field of the schema.

            '
          examples:
          - description: Structured response with custom fields
            name: structred_response
            parameters:
              properties:
                answer:
                  description: Text responding to the user's query with the given
                    context.
                  type: string
                confidence:
                  description: The confidence level of the response, on a scale from
                    0 to 5.
                  maximum: 5
                  minimum: 0
                  type: integer
                machinery_mentioned:
                  description: Optional field listing any machinery mentioned in the
                    response.
                  items:
                    description: A list of machinery mentioned in the response, if
                      any. Use machine IDs if possible.
                    type: string
                  type: array
              required:
              - answer
              - confidence
              type: object
        generate_answer:
          type: boolean
          title: Generate Answer
          description: Whether to generate an answer using the generative model. If
            set to false, the response will only contain the retrieval results.
          default: true
        search_configuration:
          anyOf:
          - type: string
          - type: 'null'
          title: Search Configuration
          description: Load ask parameters from this configuration
      type: object
      required:
      - query
      title: AskRequest
    AskRetrievalMatch:
      properties:
        id:
          type: string
          title: Id
          description: Id of the matching text block
      type: object
      required:
      - id
      title: AskRetrievalMatch
    AskTimings:
      properties:
        generative_first_chunk:
          anyOf:
          - type: number
          - type: 'null'
          title: Generative first chunk
          description: Time the LLM took to generate the first chunk of the answer
        generative_total:
          anyOf:
          - type: number
          - type: 'null'
          title: Generative total
          description: Total time the LLM took to generate the answer
      type: object
      title: AskTimings
    AskTokens:
      properties:
        input:
          type: integer
          title: Input tokens
          description: Number of LLM tokens used for the context in the query
        output:
          type: integer
          title: Output tokens
          description: Number of LLM tokens used for the answer
        input_nuclia:
          anyOf:
          - type: number
          - type: 'null'
          title: Input Nuclia tokens
          description: Number of Nuclia LLM tokens used for the context in the query
        output_nuclia:
          anyOf:
          - type: number
          - type: 'null'
          title: Output Nuclia tokens
          description: Number of Nuclia LLM tokens used for the answer
      type: object
      required:
      - input
      - output
      title: AskTokens
    AugmentedField:
      properties:
        metadata:
          $ref: '#/components/schemas/FieldMetadata'
          title: The updated metadata of the field
        applied_data_augmentation:
          $ref: '#/components/schemas/AppliedDataAugmentation'
          title: The results of the Applied Data Augmentation
        input_nuclia_tokens:
          type: number
          title: The number of input Nuclia tokens consumed for the field
        output_nuclia_tokens:
          type: number
          title: The number of output Nuclia tokens consumed for the field
        time:
          type: number
          title: The time taken to execute the Data Augmentation agents to the field
      type: object
      required:
      - metadata
      - applied_data_augmentation
      - input_nuclia_tokens
      - output_nuclia_tokens
      - time
      title: AugmentedField
    CatalogFilterExpression:
      properties:
        resource:
          oneOf:
          - $ref: '#/components/schemas/And_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Or_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Not_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Resource-Input'
          - $ref: '#/components/schemas/DateCreated'
          - $ref: '#/components/schemas/DateModified'
          - $ref: '#/components/schemas/Label'
          - $ref: '#/components/schemas/ResourceMimetype'
          - $ref: '#/components/schemas/Language'
          - $ref: '#/components/schemas/OriginTag'
          - $ref: '#/components/schemas/OriginMetadata'
          - $ref: '#/components/schemas/OriginPath'
          - $ref: '#/components/schemas/OriginSource'
          - $ref: '#/components/schemas/OriginCollaborator'
          - $ref: '#/components/schemas/Status'
          title: Resource
          description: Filter to apply to resources
      additionalProperties: false
      type: object
      required:
      - resource
      title: CatalogFilterExpression
      description: 'Returns only documents that match this filter expression.

        Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters


        This allows building complex filtering expressions and replaces the following
        parameters:

        `filters`, `range_*`, `with_status`.'
    CatalogRequest:
      properties:
        query:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/CatalogFilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`filters`, `range_*`, `with_status`.'
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        faceted:
          items:
            type: string
          type: array
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        sort:
          anyOf:
          - $ref: '#/components/schemas/SortOptions'
          - type: 'null'
          title: Sort options
          description: Options for results sorting
        page_number:
          type: integer
          title: Page number
          description: The page number of the results to return
          default: 0
        page_size:
          type: integer
          maximum: 200.0
          title: Page size
          description: The number of results to return per page. The maximum number
            of results per page allowed is 200.
          default: 20
        with_status:
          anyOf:
          - $ref: '#/components/schemas/ResourceProcessingStatus'
          - type: 'null'
          title: With processing status
          description: Filter results by resource processing status
          deprecated: true
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Filter resources by hidden
          description: Set to filter only hidden or only non-hidden resources. Default
            is to return everything
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
          - errors
      type: object
      title: CatalogRequest
    DirectionalRelation:
      properties:
        entity:
          type: string
          title: Entity
        entity_type:
          $ref: '#/components/schemas/RelationNodeType'
        entity_subtype:
          type: string
          title: Entity Subtype
        relation:
          $ref: '#/components/schemas/RelationType'
        relation_label:
          type: string
          title: Relation Label
        direction:
          $ref: '#/components/schemas/RelationDirection'
        metadata:
          anyOf:
          - $ref: '#/components/schemas/RelationMetadata'
          - type: 'null'
        resource_id:
          type: string
          title: Resource Id
      type: object
      required:
      - entity
      - entity_type
      - entity_subtype
      - relation
      - relation_label
      - direction
      - resource_id
      title: DirectionalRelation
    Entity-Input:
      properties:
        prop:
          type: string
          const: entity
          title: Prop
        subtype:
          type: string
          title: Subtype
          description: 'Type of the entity. e.g: PERSON'
        value:
          anyOf:
          - type: string
          - type: 'null'
          title: Value
          description: 'Value of the entity. e.g: Anna. If blank, matches any entity
            of the given type'
      additionalProperties: false
      type: object
      required:
      - prop
      - subtype
      title: Entity
      description: Matches fields that contains a detected entity
    Entity-Output:
      properties:
        token:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
        root:
          anyOf:
          - type: string
          - type: 'null'
          title: Root
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
      type: object
      title: Entity
    EntitySubgraph:
      properties:
        related_to:
          items:
            $ref: '#/components/schemas/DirectionalRelation'
          type: array
          title: Related To
      type: object
      required:
      - related_to
      title: EntitySubgraph
    FeedbackRequest:
      properties:
        ident:
          type: string
          title: Request identifier
          description: Id of the request to provide feedback for. This id is returned
            in the response header `Nuclia-Learning-Id` of the chat endpoint.
        good:
          type: boolean
          title: Good
          description: Whether the result was good or not
        task:
          $ref: '#/components/schemas/FeedbackTasks'
          title: Task
          description: The task the feedback is for. For now, only `CHAT` task is
            available
        feedback:
          anyOf:
          - type: string
          - type: 'null'
          title: Feedback
          description: Feedback text
        text_block_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Text block
          description: Text block id
      type: object
      required:
      - ident
      - good
      - task
      title: FeedbackRequest
    FeedbackTasks:
      type: string
      enum:
      - CHAT
      title: FeedbackTasks
    FindField:
      properties:
        paragraphs:
          additionalProperties:
            $ref: '#/components/schemas/FindParagraph'
          type: object
          title: Paragraphs
      type: object
      required:
      - paragraphs
      title: FindField
    FindParagraph:
      properties:
        score:
          type: number
          title: Score
        score_type:
          $ref: '#/components/schemas/SCORE_TYPE'
        order:
          type: integer
          minimum: 0.0
          title: Order
          default: 0
        text:
          type: string
          title: Text
        id:
          type: string
          title: Id
        labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Labels
          default: []
        position:
          anyOf:
          - $ref: '#/components/schemas/TextPosition'
          - type: 'null'
        fuzzy_result:
          type: boolean
          title: Fuzzy Result
          default: false
        page_with_visual:
          type: boolean
          title: Page where this paragraph belongs is a visual page
          description: This flag informs if the page may have information that has
            not been extracted
          default: false
        reference:
          anyOf:
          - type: string
          - type: 'null'
          title: Reference to the image that represents this text
          description: Reference to the extracted image that represents this paragraph
        is_a_table:
          type: boolean
          title: Is a table
          description: The referenced image of the paragraph is a table
          default: false
        relevant_relations:
          anyOf:
          - $ref: '#/components/schemas/Relations'
          - type: 'null'
          title: Relevant relations
          description: Relevant relations from which the paragraph was found, will
            only be filled if using the Graph RAG Strategy
      type: object
      required:
      - score
      - score_type
      - text
      - id
      title: FindParagraph
    FindResource:
      properties:
        id:
          type: string
          title: Id
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        icon:
          anyOf:
          - type: string
          - type: 'null'
          title: Icon
        thumbnail:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail
        metadata:
          anyOf:
          - $ref: '#/components/schemas/Metadata'
          - type: 'null'
        usermetadata:
          anyOf:
          - $ref: '#/components/schemas/UserMetadata'
          - type: 'null'
        fieldmetadata:
          anyOf:
          - items:
              $ref: '#/components/schemas/UserFieldMetadata'
            type: array
          - type: 'null'
          title: Fieldmetadata
        computedmetadata:
          anyOf:
          - $ref: '#/components/schemas/ComputedMetadata'
          - type: 'null'
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        modified:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Modified
        last_seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Seqid
        last_account_seq:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Account Seq
        queue:
          anyOf:
          - $ref: '#/components/schemas/QueueType'
          - type: 'null'
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hidden
        origin:
          anyOf:
          - $ref: '#/components/schemas/Origin'
          - type: 'null'
        extra:
          anyOf:
          - $ref: '#/components/schemas/Extra'
          - type: 'null'
        relations:
          anyOf:
          - items:
              $ref: '#/components/schemas/Relation'
            type: array
          - type: 'null'
          title: Relations
        data:
          anyOf:
          - $ref: '#/components/schemas/ResourceData'
          - type: 'null'
        security:
          anyOf:
          - $ref: '#/components/schemas/ResourceSecurity'
          - type: 'null'
          title: Security
          description: Resource security metadata
        fields:
          additionalProperties:
            $ref: '#/components/schemas/FindField'
          type: object
          title: Fields
      type: object
      required:
      - id
      - fields
      title: FindResource
    KnowledgeboxCounters:
      properties:
        resources:
          type: integer
          title: Resources
        paragraphs:
          type: integer
          title: Paragraphs
        fields:
          type: integer
          title: Fields
        sentences:
          type: integer
          title: Sentences
        shards:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shards
        index_size:
          type: number
          title: Index size (bytes)
          default: 0.0
      type: object
      required:
      - resources
      - paragraphs
      - fields
      - sentences
      title: KnowledgeboxCounters
    KnowledgeboxFindResults:
      properties:
        resources:
          additionalProperties:
            $ref: '#/components/schemas/FindResource'
          type: object
          title: Resources
        relations:
          anyOf:
          - $ref: '#/components/schemas/Relations'
          - type: 'null'
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        rephrased_query:
          anyOf:
          - type: string
          - type: 'null'
          title: Rephrased Query
        total:
          type: integer
          title: Total
          default: 0
        page_number:
          type: integer
          title: Page Number
          description: Pagination will be deprecated, please, refer to `top_k` in
            the request
          default: 0
        page_size:
          type: integer
          title: Page Size
          description: Pagination will be deprecated, please, refer to `top_k` in
            the request
          default: 20
        next_page:
          type: boolean
          title: Next Page
          description: Pagination will be deprecated, please, refer to `top_k` in
            the request
          default: false
        nodes:
          anyOf:
          - items:
              additionalProperties:
                type: string
              type: object
            type: array
          - type: 'null'
          title: Nodes
          description: List of nodes queried in the search
        shards:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shards
          description: The list of shard replica ids used for the search.
        autofilters:
          items:
            type: string
          type: array
          title: Autofilters
          description: List of filters automatically applied to the search query
          default: []
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum result score
          description: The minimum scores that have been used for the search operation.
          default:
            bm25: 0.0
        best_matches:
          items:
            type: string
          type: array
          title: Best matches
          description: List of ids of best matching paragraphs. The list is sorted
            by decreasing relevance (most relevant first).
          default: []
      type: object
      required:
      - resources
      title: KnowledgeboxFindResults
      description: Find on knowledgebox results
    KnowledgeboxSearchResults:
      properties:
        resources:
          additionalProperties:
            $ref: '#/components/schemas/Resource-Output'
          type: object
          title: Resources
          default: {}
        sentences:
          anyOf:
          - $ref: '#/components/schemas/Sentences'
          - type: 'null'
        paragraphs:
          anyOf:
          - $ref: '#/components/schemas/Paragraphs'
          - type: 'null'
        fulltext:
          anyOf:
          - $ref: '#/components/schemas/Resources'
          - type: 'null'
        relations:
          anyOf:
          - $ref: '#/components/schemas/Relations'
          - type: 'null'
        nodes:
          anyOf:
          - items:
              additionalProperties:
                type: string
              type: object
            type: array
          - type: 'null'
          title: Nodes
        shards:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shards
        autofilters:
          items:
            type: string
          type: array
          title: Autofilters
          description: List of filters automatically applied to the search query
          default: []
      type: object
      title: KnowledgeboxSearchResults
      description: Search on knowledgebox results
    KnowledgeboxSuggestResults:
      properties:
        paragraphs:
          anyOf:
          - $ref: '#/components/schemas/Paragraphs'
          - type: 'null'
        entities:
          anyOf:
          - $ref: '#/components/schemas/RelatedEntities'
          - type: 'null'
        shards:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shards
      type: object
      title: KnowledgeboxSuggestResults
      description: Suggest on resource results
    Label:
      properties:
        prop:
          type: string
          const: label
          title: Prop
        labelset:
          type: string
          title: Labelset
          description: The labelset to match
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
          description: The label to match. If blank, matches all labels in the given
            labelset
      additionalProperties: false
      type: object
      required:
      - prop
      - labelset
      title: Label
      description: Matches fields/paragraphs with a label (or labelset)
    NewTextField:
      properties:
        text_field:
          $ref: '#/components/schemas/FieldText'
        destination:
          type: string
          title: Destination
      type: object
      required:
      - text_field
      - destination
      title: NewTextField
    Not_ResourceFilterExpression_:
      properties:
        not:
          oneOf:
          - $ref: '#/components/schemas/And_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Or_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Not_ResourceFilterExpression_'
          - $ref: '#/components/schemas/Resource-Input'
          - $ref: '#/components/schemas/DateCreated'
          - $ref: '#/components/schemas/DateModified'
          - $ref: '#/components/schemas/Label'
          - $ref: '#/components/schemas/ResourceMimetype'
          - $ref: '#/components/schemas/Language'
          - $ref: '#/components/schemas/OriginTag'
          - $ref: '#/components/schemas/OriginMetadata'
          - $ref: '#/components/schemas/OriginPath'
          - $ref: '#/components/schemas/OriginSource'
          - $ref: '#/components/schemas/OriginCollaborator'
          - $ref: '#/components/schemas/Status'
          title: Not
      additionalProperties: false
      type: object
      required:
      - not
      title: Not[ResourceFilterExpression]
    NucliaDBClientType:
      type: string
      enum:
      - api
      - widget
      - web
      - dashboard
      - desktop
      - chrome_extension
      title: NucliaDBClientType
    Or_ResourceFilterExpression_:
      properties:
        or:
          items:
            oneOf:
            - $ref: '#/components/schemas/And_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Or_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Not_ResourceFilterExpression_'
            - $ref: '#/components/schemas/Resource-Input'
            - $ref: '#/components/schemas/DateCreated'
            - $ref: '#/components/schemas/DateModified'
            - $ref: '#/components/schemas/Label'
            - $ref: '#/components/schemas/ResourceMimetype'
            - $ref: '#/components/schemas/Language'
            - $ref: '#/components/schemas/OriginTag'
            - $ref: '#/components/schemas/OriginMetadata'
            - $ref: '#/components/schemas/OriginPath'
            - $ref: '#/components/schemas/OriginSource'
            - $ref: '#/components/schemas/OriginCollaborator'
            - $ref: '#/components/schemas/Status'
          type: array
          title: Or
      additionalProperties: false
      type: object
      required:
      - or
      title: Or[ResourceFilterExpression]
    Paragraphs:
      properties:
        results:
          items:
            $ref: '#/components/schemas/nucliadb_models__search__Paragraph'
          type: array
          title: Results
          default: []
        facets:
          anyOf:
          - type: object
          - type: 'null'
          title: Facets
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        total:
          type: integer
          title: Total
          default: 0
        page_number:
          type: integer
          title: Page Number
          default: 0
        page_size:
          type: integer
          title: Page Size
          default: 20
        next_page:
          type: boolean
          title: Next Page
          default: false
        min_score:
          type: number
          title: Minimum score
          description: Minimum bm25 score used to filter bm25 index search. Results
            with a lower score have been ignored.
      type: object
      required:
      - min_score
      title: Paragraphs
    PredictProxiedEndpoints:
      type: string
      enum:
      - tokens
      - chat
      - rephrase
      - run-agents-text
      - summarize
      - rerank
      - remi
      title: PredictProxiedEndpoints
      description: Enum for the different endpoints that are proxied to the Predict
        API
    RelatedEntities:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        entities:
          items:
            $ref: '#/components/schemas/RelatedEntity'
          type: array
          title: Entities
          default: []
      type: object
      title: RelatedEntities
    RelatedEntity:
      properties:
        family:
          type: string
          title: Family
        value:
          type: string
          title: Value
      type: object
      required:
      - family
      - value
      title: RelatedEntity
    RelationDirection:
      type: string
      enum:
      - in
      - out
      title: RelationDirection
    Relations:
      properties:
        entities:
          additionalProperties:
            $ref: '#/components/schemas/EntitySubgraph'
          type: object
          title: Entities
      type: object
      required:
      - entities
      title: Relations
    Resource-Input:
      properties:
        prop:
          type: string
          const: resource
          title: Prop
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
          description: ID of the resource to match
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
          description: Slug of the resource to match
      additionalProperties: false
      type: object
      required:
      - prop
      title: Resource
      description: Matches all fields of a resource given its id or slug
    Resource-Output:
      properties:
        id:
          type: string
          title: Id
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
        icon:
          anyOf:
          - type: string
          - type: 'null'
          title: Icon
        thumbnail:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail
        metadata:
          anyOf:
          - $ref: '#/components/schemas/Metadata'
          - type: 'null'
        usermetadata:
          anyOf:
          - $ref: '#/components/schemas/UserMetadata'
          - type: 'null'
        fieldmetadata:
          anyOf:
          - items:
              $ref: '#/components/schemas/UserFieldMetadata'
            type: array
          - type: 'null'
          title: Fieldmetadata
        computedmetadata:
          anyOf:
          - $ref: '#/components/schemas/ComputedMetadata'
          - type: 'null'
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        modified:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Modified
        last_seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Seqid
        last_account_seq:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Account Seq
        queue:
          anyOf:
          - $ref: '#/components/schemas/QueueType'
          - type: 'null'
        hidden:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hidden
        origin:
          anyOf:
          - $ref: '#/components/schemas/Origin'
          - type: 'null'
        extra:
          anyOf:
          - $ref: '#/components/schemas/Extra'
          - type: 'null'
        relations:
          anyOf:
          - items:
              $ref: '#/components/schemas/Relation'
            type: array
          - type: 'null'
          title: Relations
        data:
          anyOf:
          - $ref: '#/components/schemas/ResourceData'
          - type: 'null'
        security:
          anyOf:
          - $ref: '#/components/schemas/ResourceSecurity'
          - type: 'null'
          title: Security
          description: Resource security metadata
      type: object
      required:
      - id
      title: Resource
    ResourceAgentsRequest:
      properties:
        filters:
          anyOf:
          - items:
              $ref: '#/components/schemas/AgentsFilter'
            type: array
          - type: 'null'
          title: Filters
          description: Filters to apply to the agents. If None, all curently configured
            agents are applied.
      type: object
      title: ResourceAgentsRequest
    ResourceAgentsResponse:
      properties:
        results:
          additionalProperties:
            $ref: '#/components/schemas/AugmentedField'
          type: object
          title: Pairs of augmented FieldMetadata and Data Augmentation results by
            field id
      type: object
      required:
      - results
      title: ResourceAgentsResponse
    ResourceResult:
      properties:
        score:
          anyOf:
          - type: number
          - type: integer
          title: Score
        rid:
          type: string
          title: Rid
        field_type:
          type: string
          title: Field Type
        field:
          type: string
          title: Field
        labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Labels
      type: object
      required:
      - score
      - rid
      - field_type
      - field
      title: ResourceResult
    ResourceSearchResults:
      properties:
        sentences:
          anyOf:
          - $ref: '#/components/schemas/Sentences'
          - type: 'null'
        paragraphs:
          anyOf:
          - $ref: '#/components/schemas/Paragraphs'
          - type: 'null'
        relations:
          anyOf:
          - $ref: '#/components/schemas/Relations'
          - type: 'null'
        nodes:
          anyOf:
          - items:
              additionalProperties:
                type: string
              type: object
            type: array
          - type: 'null'
          title: Nodes
        shards:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shards
      type: object
      title: ResourceSearchResults
      description: Search on resource results
    Resources:
      properties:
        results:
          items:
            $ref: '#/components/schemas/ResourceResult'
          type: array
          title: Results
        facets:
          anyOf:
          - type: object
          - type: 'null'
          title: Facets
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        total:
          type: integer
          title: Total
          default: 0
        page_number:
          type: integer
          title: Page Number
          default: 0
        page_size:
          type: integer
          title: Page Size
          default: 20
        next_page:
          type: boolean
          title: Next Page
          default: false
        min_score:
          type: number
          title: Minimum score
          description: Minimum bm25 score used to filter bm25 index search. Results
            with a lower score have been ignored.
      type: object
      required:
      - results
      - min_score
      title: Resources
    SCORE_TYPE:
      type: string
      enum:
      - VECTOR
      - BM25
      - BOTH
      - RERANKER
      - RELATION_RELEVANCE
      title: SCORE_TYPE
    SearchRequest:
      properties:
        audit_metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Audit metadata
          description: A dictionary containing optional audit-specific metadata, such
            as user_id, environment, or other contextual information. This metadata
            can be leveraged for filtering and analyzing activity logs in future operations.
            Each key-value pair represents a piece of metadata relevant to the user's
            request.
          examples:
          - environment: test
            user: my-user-123
        query:
          type: string
          maxLength: 20000
          title: Query
          description: The query to search for
          default: ''
        filter_expression:
          anyOf:
          - $ref: '#/components/schemas/FilterExpression'
          - type: 'null'
          title: Filter resource by an expression
          description: 'Returns only documents that match this filter expression.Filtering
            examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search_filters
            This allows building complex filtering expressions and replaces the following
            parameters:`fields`, `filters`, `range_*`, `resource_filters`, `keyword_filters`.'
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: 'The list of fields to search in. For instance: `a/title` to
            search only on title field. For more details on filtering by field, see:
            https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field. '
          default: []
        filters:
          anyOf:
          - items:
              type: string
            type: array
          - items:
              $ref: '#/components/schemas/Filter'
            type: array
          title: Filters
          description: 'The list of filters to apply. Filtering examples can be found
            here: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        top_k:
          type: integer
          maximum: 200.0
          title: Top k
          description: The number of results search should return. The maximum number
            of results allowed is 200.
          default: 20
        min_score:
          anyOf:
          - type: number
          - $ref: '#/components/schemas/MinScore'
          - type: 'null'
          title: Minimum score
          description: Minimum score to filter search results. Results with a lower
            score will be ignored. Accepts either a float or a dictionary with the
            minimum scores for the bm25 and vector indexes. If a float is provided,
            it is interpreted as the minimum score for vector index search.
        range_creation_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range start
          description: 'Resources created before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_creation_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource creation range end
          description: 'Resources created after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_start:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range start
          description: 'Resources modified before this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        range_modification_end:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Resource modification range end
          description: 'Resources modified after this date will be filtered out of
            search results. Datetime are represented as a str in ISO 8601 format,
            like: 2008-09-15T15:53:00+05:00.'
        features:
          items:
            $ref: '#/components/schemas/SearchOptions'
          type: array
          title: Search features
          description: List of search features to use. Each value corresponds to a
            lookup into on of the different indexes
          default:
          - keyword
          - fulltext
          - semantic
        debug:
          type: boolean
          title: Debug mode
          description: If set, the response will include some extra metadata for debugging
            purposes, like the list of queried nodes.
          default: false
        highlight:
          type: boolean
          title: Highlight
          description: If set to true, the query terms will be highlighted in the
            results between <mark>...</mark> tags
          default: false
        show:
          items:
            $ref: '#/components/schemas/ResourceProperties'
          type: array
          title: Show metadata
          description: Controls which types of metadata are serialized on resources
            of search results
          default:
          - basic
        field_type_filter:
          items:
            $ref: '#/components/schemas/FieldTypeName'
          type: array
          title: Field type filter
          description: Define which field types are serialized on resources of search
            results
          default:
          - text
          - file
          - link
          - conversation
          - generic
        extracted:
          items:
            $ref: '#/components/schemas/ExtractedDataTypeName'
          type: array
          title: Extracted metadata
          description: '[Deprecated] Please use GET resource endpoint instead to get
            extracted metadata'
          default: []
          deprecated: true
        vector:
          anyOf:
          - items:
              type: number
            type: array
          - type: 'null'
          title: Search Vector
          description: The vector to perform the search with. If not provided, NucliaDB
            will use Nuclia Predict API to create the vector off from the query.
        vectorset:
          anyOf:
          - type: string
          - type: 'null'
          title: Vectorset
          description: Vectors index to perform the search in. If not provided, NucliaDB
            will use the default one
        with_duplicates:
          type: boolean
          title: With duplicate paragraphs
          description: Whether to return duplicate paragraphs on the same document
          default: false
        with_synonyms:
          type: boolean
          title: With custom synonyms
          description: 'Whether to return matches for custom knowledge box synonyms
            of the query terms. Note: only supported for `keyword` and `fulltext`
            search options.'
          default: false
        autofilter:
          type: boolean
          title: Automatic search filtering
          description: If set to true, the search will automatically add filters to
            the query. For example, it will filter results containing the entities
            detected in the query
          default: false
        resource_filters:
          items:
            type: string
          type: array
          title: Resources filter
          description: List of resource ids to filter search results for. Only paragraphs
            from the specified resources will be returned.
          default: []
        security:
          anyOf:
          - $ref: '#/components/schemas/RequestSecurity'
          - type: 'null'
          title: Security
          description: Security metadata for the request. If not provided, the search
            request is done without the security lookup phase.
        show_hidden:
          type: boolean
          title: Show hidden resources
          description: If set to false (default), excludes hidden resources from search
          default: false
        rephrase:
          type: boolean
          title: Rephrase
          description: Rephrase the query for a more efficient retrieval. This will
            consume LLM tokens and make the request slower.
          default: false
        rephrase_prompt:
          anyOf:
          - type: string
            minLength: 1
          - type: 'null'
          title: Rephrase
          description: 'Rephrase prompt given to the generative model responsible
            for rephrasing the query for a more effective retrieval step. This is
            only used if the `rephrase` flag is set to true in the request.

            If not specified, Nuclia''s default prompt is used. It must include the
            {question} placeholder. The placeholder will be replaced with the original
            question'
          examples:
          - 'Rephrase this question so its better for retrieval, and keep the rephrased
            question in the same language as the original.

            QUESTION: {question}

            Please return ONLY the question without any explanation. Just the rephrased
            question.'
          - "Rephrase this question so its better for retrieval, identify any part\
            \ numbers and append them to the end of the question separated by a commas.\n\
            \            QUESTION: {question}\n            Please return ONLY the\
            \ question without any explanation."
        faceted:
          items:
            type: string
          type: array
          maxItems: 50
          title: Faceted
          description: 'The list of facets to calculate. The facets follow the same
            syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search_filters'
          default: []
        sort:
          anyOf:
          - $ref: '#/components/schemas/SortOptions'
          - type: 'null'
          title: Sort options
          description: Options for results sorting
      type: object
      title: SearchRequest
    Sentences:
      properties:
        results:
          items:
            $ref: '#/components/schemas/nucliadb_models__search__Sentence'
          type: array
          title: Results
          default: []
        facets:
          type: object
          title: Facets
        page_number:
          type: integer
          title: Page Number
          default: 0
        page_size:
          type: integer
          title: Page Size
          default: 20
        min_score:
          type: number
          title: Minimum score
          description: Minimum similarity score used to filter vector index search.
            Results with a lower score have been ignored.
      type: object
      required:
      - facets
      - min_score
      title: Sentences
    SortField:
      type: string
      enum:
      - score
      - created
      - modified
      - title
      title: SortField
    SortOptions:
      properties:
        field:
          $ref: '#/components/schemas/SortField'
        limit:
          anyOf:
          - type: integer
            exclusiveMinimum: 0.0
          - type: 'null'
          title: Limit
        order:
          $ref: '#/components/schemas/SortOrder'
          default: desc
      type: object
      required:
      - field
      title: SortOptions
    SortOrder:
      type: string
      enum:
      - asc
      - desc
      title: SortOrder
    SuggestOptions:
      type: string
      enum:
      - paragraph
      - entities
      title: SuggestOptions
    SummarizeRequest:
      properties:
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative model
          description: The generative model to use for the summarization. If not provided,
            the model configured for the Knowledge Box is used.
        user_prompt:
          anyOf:
          - type: string
          - type: 'null'
          title: User prompt
          description: Optional custom prompt input by the user
        resources:
          items:
            type: string
          type: array
          maxItems: 100
          minItems: 1
          title: Resources
          description: Uids or slugs of the resources to summarize. If the resources
            are not found, they will be ignored.
        summary_kind:
          $ref: '#/components/schemas/SummaryKind'
          title: Summary kind
          description: Option to customize how the summary will be
          default: simple
      type: object
      required:
      - resources
      title: SummarizeRequest
      description: Model for the request payload of the summarize endpoint
    SummarizedResource:
      properties:
        summary:
          type: string
          title: Summary
          description: Summary of the resource
        tokens:
          type: integer
          title: Tokens
      type: object
      required:
      - summary
      - tokens
      title: SummarizedResource
    SummarizedResponse:
      properties:
        resources:
          additionalProperties:
            $ref: '#/components/schemas/SummarizedResource'
          type: object
          title: Resources
          description: Individual resource summaries. The key is the resource id or
            slug.
          default: {}
        summary:
          type: string
          title: Summary
          description: Global summary of all resources combined.
          default: ''
      type: object
      title: SummarizedResponse
    SummaryKind:
      type: string
      enum:
      - simple
      - extended
      title: SummaryKind
    SyncAskMetadata:
      properties:
        tokens:
          anyOf:
          - $ref: '#/components/schemas/AskTokens'
          - type: 'null'
          title: Tokens
          description: Number of tokens used in the LLM context and answer
        timings:
          anyOf:
          - $ref: '#/components/schemas/AskTimings'
          - type: 'null'
          title: Timings
          description: Timings of the generative model
      type: object
      title: SyncAskMetadata
    SyncAskResponse:
      properties:
        answer:
          type: string
          title: Answer
          description: The generative answer to the query
        answer_json:
          anyOf:
          - type: object
          - type: 'null'
          title: Answer JSON
          description: The generative JSON answer to the query. This is returned only
            if the answer_json_schema parameter is provided in the request.
        status:
          type: string
          title: Status
          description: The status of the query execution. It can be 'success', 'error',
            'no_context' or 'no_retrieval_data'
        retrieval_results:
          $ref: '#/components/schemas/KnowledgeboxFindResults'
          title: Retrieval results
          description: The retrieval results of the query
        retrieval_best_matches:
          items:
            $ref: '#/components/schemas/AskRetrievalMatch'
          type: array
          title: Retrieval best matches
          description: Sorted list of best matching text blocks in the retrieval step.
            This includes the main query and prequeries results, if any.
          default: []
        prequeries:
          anyOf:
          - additionalProperties:
              $ref: '#/components/schemas/KnowledgeboxFindResults'
            type: object
          - type: 'null'
          title: Prequeries
          description: The retrieval results of the prequeries
        learning_id:
          type: string
          title: Learning id
          description: The id of the learning request. This id can be used to provide
            feedback on the learning process.
          default: ''
        relations:
          anyOf:
          - $ref: '#/components/schemas/Relations'
          - type: 'null'
          title: Relations
          description: The detected relations of the answer
        citations:
          type: object
          title: Citations
          description: The citations of the answer. List of references to the resources
            used to generate the answer.
          default: {}
        prompt_context:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Prompt context
          description: The prompt context used to generate the answer. Returned only
            if the debug flag is set to true
        predict_request:
          anyOf:
          - type: object
          - type: 'null'
          title: Predict request
          description: The internal predict request used to generate the answer. Returned
            only if the debug flag is set to true
        metadata:
          anyOf:
          - $ref: '#/components/schemas/SyncAskMetadata'
          - type: 'null'
          title: Metadata
          description: Metadata of the query execution. This includes the number of
            tokens used in the LLM context and answer, and the timings of the generative
            model.
        error_details:
          anyOf:
          - type: string
          - type: 'null'
          title: Error details
          description: Error details message in case there was an error
        debug:
          anyOf:
          - type: object
          - type: 'null'
          title: Debug information
          description: Debug information about predict
      type: object
      required:
      - answer
      - status
      - retrieval_results
      title: SyncAskResponse
    TextPosition:
      properties:
        page_number:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page Number
        index:
          type: integer
          title: Index
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
        start_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Start Seconds
        end_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: End Seconds
      type: object
      required:
      - index
      - start
      - end
      title: TextPosition
    nucliadb_models__common__Paragraph:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        start_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Start Seconds
        end_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: End Seconds
        kind:
          anyOf:
          - $ref: '#/components/schemas/TypeParagraph'
          - type: 'null'
        classifications:
          anyOf:
          - items:
              $ref: '#/components/schemas/Classification'
            type: array
          - type: 'null'
          title: Classifications
        sentences:
          anyOf:
          - items:
              $ref: '#/components/schemas/nucliadb_models__common__Sentence'
            type: array
          - type: 'null'
          title: Sentences
        key:
          anyOf:
          - type: string
          - type: 'null'
          title: Key
        page:
          anyOf:
          - $ref: '#/components/schemas/PageInformation'
          - type: 'null'
        representation:
          anyOf:
          - $ref: '#/components/schemas/Representation'
          - type: 'null'
        relations:
          anyOf:
          - $ref: '#/components/schemas/ParagraphRelations'
          - type: 'null'
      type: object
      title: Paragraph
    nucliadb_models__common__Sentence:
      properties:
        start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start
        end:
          anyOf:
          - type: integer
          - type: 'null'
          title: End
        key:
          anyOf:
          - type: string
          - type: 'null'
          title: Key
      type: object
      title: Sentence
    nucliadb_models__search__Paragraph:
      properties:
        score:
          type: number
          title: Score
        rid:
          type: string
          title: Rid
        field_type:
          type: string
          title: Field Type
        field:
          type: string
          title: Field
        text:
          type: string
          title: Text
        labels:
          items:
            type: string
          type: array
          title: Labels
          default: []
        start_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Start Seconds
        end_seconds:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: End Seconds
        position:
          anyOf:
          - $ref: '#/components/schemas/TextPosition'
          - type: 'null'
        fuzzy_result:
          type: boolean
          title: Fuzzy Result
          default: false
      type: object
      required:
      - score
      - rid
      - field_type
      - field
      - text
      title: Paragraph
    nucliadb_models__search__Sentence:
      properties:
        score:
          type: number
          title: Score
        rid:
          type: string
          title: Rid
        text:
          type: string
          title: Text
        field_type:
          type: string
          title: Field Type
        field:
          type: string
          title: Field
        index:
          anyOf:
          - type: string
          - type: 'null'
          title: Index
        position:
          anyOf:
          - $ref: '#/components/schemas/TextPosition'
          - type: 'null'
      type: object
      required:
      - score
      - rid
      - text
      - field_type
      - field
      title: Sentence
