info:
  title: Nuclia Understanding API
  description: API reference for the Nuclia Understanding API.
  version: v1
openapi: 3.0.2
servers:
- url: https://{region-x}.stashify.cloud/api/v1
  description: Development server
tags:
- name: Processing
  description: Ingest API endpoints to process data and get results back.
- name: Processing TUS uploads
  description: Processing uploads using TUS protocol
- name: Training
  description: Training API endpoints to train custom models with your data.
- name: Models
  description: Models API
- name: Knowledge Boxes
  description: Knowledge Boxes API
- name: Predict
  description: Predict API to get predictions from our models
- name: Collector
  description: Collector API
paths:
  /account/{account_id}/dataset/{dataset_id}:
    delete:
      tags:
      - Datasets
      summary: Delete Dataset
      description: Deletes a dataset
      operationId: delete_dataset_api_v1_account__account_id__dataset__dataset_id__delete
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Datasets
      summary: Get Dataset
      description: Get a dataset
      operationId: get_dataset_api_v1_account__account_id__dataset__dataset_id__get
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetCreated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/dataset/{dataset_id}/models:
    get:
      tags:
      - Models
      summary: Learning Configuration Schema
      description: Get available models
      operationId: Learning_configuration_schema_api_v1_account__account_id__dataset__dataset_id__models_get
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Learning Configuration Schema Api V1 Account  Account
                  Id  Dataset  Dataset Id  Models Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/dataset/{dataset_id}/partition/{partition_id}:
    put:
      tags:
      - Datasets
      summary: Upload Partition Account
      description: Upload a partition of a dataset
      operationId: upload_partition_account_api_v1_account__account_id__dataset__dataset_id__partition__partition_id__put
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - name: partition_id
        in: path
        required: true
        schema:
          type: string
          title: Partition Id
      - name: content-length
        in: header
        required: true
        schema:
          type: integer
          title: Content-Length
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Datasets
      summary: Delete Dataset Partition
      description: Deletes a partition of a dataset
      operationId: delete_dataset_partition_api_v1_account__account_id__dataset__dataset_id__partition__partition_id__delete
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: partition_id
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-zA-Z0-9-_]+$
          title: Partition Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/dataset/{dataset_id}/partitions:
    delete:
      tags:
      - Datasets
      summary: Delete Dataset Partitions
      description: Deletes all partitions of a dataset
      operationId: delete_dataset_partitions_api_v1_account__account_id__dataset__dataset_id__partitions_delete
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/datasets:
    post:
      tags:
      - Datasets
      summary: Create Dataset Account
      description: Creates a new dataset
      operationId: create_dataset_account_api_v1_account__account_id__datasets_post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetInfo'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetCreated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Datasets
      summary: List Datasets
      description: Lists all datasets
      operationId: list_datasets_api_v1_account__account_id__datasets_get
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetsList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/model/{model_id}:
    get:
      tags:
      - Models
      summary: Learning Configuration Schema
      description: Get trained models
      operationId: Learning_configuration_schema_api_v1_account__account_id__model__model_id__get
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - name: model_id
        in: path
        required: true
        schema:
          type: string
          title: Model Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Learning Configuration Schema Api V1 Account  Account
                  Id  Model  Model Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Models
      summary: Model Deletion On Account
      description: Delete specific model from account, destroying action
      operationId: Model_deletion_on_account_api_v1_account__account_id__model__model_id__delete
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - 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'
  /account/{account_id}/models:
    get:
      tags:
      - Models
      summary: Learning Configuration Models From Account
      description: Get trained models
      operationId: Learning_configuration_models_from_account_api_v1_account__account_id__models_get
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Learning Configuration Models From Account Api V1
                  Account  Account Id  Models Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/models/{kbid}:
    post:
      tags:
      - Models
      summary: Add A Model To A Kb
      description: Add a model to a KB to be used
      operationId: Add_a_model_to_a_KB_api_v1_account__account_id__models__kbid__post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelID'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/models/{kbid}/{model_id}:
    delete:
      tags:
      - Models
      summary: Delete A Model From A Kb
      description: Remove from availability a model from a KB
      operationId: Delete_a_model_from_a_KB_api_v1_account__account_id__models__kbid___model_id__delete
      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: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /account/{account_id}/schema:
    get:
      tags:
      - Models
      summary: Learning Configuration Schema
      description: Get schema for creating a KB
      operationId: Learning_configuration_schema_api_v1_account__account_id__schema_get
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /collect/feedback/{kbid}:
    get:
      tags:
      - Collector
      summary: Feedback Avalaible Months
      description: List of months within the last year with feedback data
      operationId: Feedback_avalaible_months_api_v1_collect_feedback__kbid__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'
  /collect/feedback/{kbid}/{month}:
    get:
      tags:
      - Collector
      summary: Get Feedback
      description: Given a month, returns a csv with all the feedback data from it
      operationId: Get_feedback_api_v1_collect_feedback__kbid___month__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: month
        in: path
        required: true
        schema:
          type: string
          title: Month
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /config/{kbid}:
    get:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Models Configuration
      description: Current configuration of models assigned to a knowledgebox
      operationId: Knowledgebox_models_configuration_api_v1_config__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/LearningConfiguration'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Models Add Configuration
      description: Current configuration of models assigned to a knowledgebox
      operationId: Knowledgebox_models_Add_configuration_api_v1_config__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LearningConfigurationCreation'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearningConfiguration'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Models Update Configuration
      description: Current configuration of models assigned to a knowledgebox
      operationId: Knowledgebox_models_update_configuration_api_v1_config__kbid__patch
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LearningConfigurationUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearningConfiguration'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Knowledge Boxes
      summary: Knowledgebox Models Configuration
      description: Delete a KB configuration
      operationId: Knowledgebox_models_configuration_api_v1_config__kbid__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'
  /dataset/{dataset_id}:
    delete:
      tags:
      - Datasets
      summary: Dataset Delete
      description: Deletes a dataset
      operationId: dataset_delete_api_v1_dataset__dataset_id__delete
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/partition/{partition_id}:
    put:
      tags:
      - Datasets
      summary: Upload Partition
      description: Upload a partition of a dataset
      operationId: upload_partition_api_v1_dataset__dataset_id__partition__partition_id__put
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: partition_id
        in: path
        required: true
        schema:
          type: string
          title: Partition Id
      - name: content-length
        in: header
        required: true
        schema:
          type: integer
          title: Content-Length
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/task/start:
    post:
      tags:
      - Task
      summary: Start Dataset Training Task
      description: Start a train task on a dataset
      operationId: start_dataset_training_task_api_v1_dataset__dataset_id__task_start_post
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStart'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/task/{task_id}:
    delete:
      tags:
      - Task
      summary: Delete Dataset Task
      description: Delete a task from a Dataset
      operationId: delete_dataset_task_api_v1_dataset__dataset_id__task__task_id__delete
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/task/{task_id}/inspect:
    get:
      tags:
      - Task
      summary: Inspect Dataset Training Task
      description: Get the status of a train task on a dataset
      operationId: inspect_dataset_training_task_api_v1_dataset__dataset_id__task__task_id__inspect_get
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTaskRequest'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/task/{task_id}/stop:
    post:
      tags:
      - Task
      summary: Stop Dataset Training Task
      description: Stop a train task on a dataset
      operationId: stop_dataset_training_task_api_v1_dataset__dataset_id__task__task_id__stop_post
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /dataset/{dataset_id}/tasks:
    get:
      tags:
      - Task
      summary: List Account Possible Tasks
      description: Get the available tasks on a KB
      operationId: list_account_possible_tasks_api_v1_dataset__dataset_id__tasks_get
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          title: Dataset Id
      - name: count
        in: query
        required: false
        schema:
          type: integer
          description: How many finished tasks to return
          default: 10
          title: Count
        description: How many finished tasks to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /datasets:
    post:
      tags:
      - Datasets
      summary: Create Dataset
      description: Creates a new dataset
      operationId: create_dataset_api_v1_datasets_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetInfo'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetCreated'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /download/{kbid}/model/{model_id}/{filename}:
    get:
      tags:
      - Training
      summary: Download Account Predictive Model File
      description: Download the trained model or any other generated file as a result
        of a training task on a Knowledge Box
      operationId: download_account_predictive_model_file_api_v1_download__kbid__model__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
      - name: account_id
        in: query
        required: true
        schema:
          type: string
          title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /extract_strategies/{kbid}:
    get:
      tags:
      - Extract Strategies
      summary: Learning Extract Strategies
      description: Get available extract strategies onprem
      operationId: Learning_extract_strategies_api_v1_extract_strategies__kbid__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-Output'
                title: Response Learning Extract Strategies Api V1 Extract Strategies  Kbid  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Extract Strategies
      summary: Add A Extract Strategy To A Kb Onprem
      description: Add a extract strategy to a KB to be used
      operationId: Add_a_extract_strategy_to_a_KB_OnPrem_api_v1_extract_strategies__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractConfig-Input'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Add A Extract Strategy To A Kb Onprem Api V1 Extract
                  Strategies  Kbid  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /extract_strategies/{kbid}/strategies/{strategy_id}:
    get:
      tags:
      - Extract Strategies
      summary: Extract Strategy Configuration
      description: Get extract strategy for a given id
      operationId: Extract_strategy_configuration_api_v1_extract_strategies__kbid__strategies__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:
                $ref: '#/components/schemas/ExtractConfig-Output'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Extract Strategies
      summary: Disable Extract Strategy Onprem
      description: Disable a extract strategy from a Knowledge Box
      operationId: disable_extract_strategy_onprem_api_v1_extract_strategies__kbid__strategies__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:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/start:
    post:
      tags:
      - Task
      summary: Start Knowledge Box Training Task
      description: Start a train task on a knowledge box
      operationId: start_knowledge_box_training_task_api_v1_kb__kb_uuid__task_start_post
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStartKB'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}:
    delete:
      tags:
      - Task
      summary: Delete Knowledge Box Training Task
      description: Delete a task from a Knowledge Box
      operationId: delete_knowledge_box_training_task_api_v1_kb__kb_uuid__task__task_id__delete
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: cleanup
        in: query
        required: false
        schema:
          type: boolean
          description: Cleanup all data associated with the task
          default: false
          title: Cleanup
        description: Cleanup all data associated with the task
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}/cleanup:
    post:
      tags:
      - Task
      summary: Cleanup Knowledge Box Training Task
      description: Start a cleanup process for the task
      operationId: cleanup_knowledge_box_training_task_api_v1_kb__kb_uuid__task__task_id__cleanup_post
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTaskSet'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}/inspect:
    get:
      tags:
      - Task
      summary: Inspect Knowledge Box Training Task
      description: Get the status of a task on a knowledge box
      operationId: inspect_knowledge_box_training_task_api_v1_kb__kb_uuid__task__task_id__inspect_get
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTaskSet'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}/restart:
    post:
      tags:
      - Task
      summary: Restart Knowledge Box Training Task
      description: Stop a train task on a knowledge box
      operationId: restart_knowledge_box_training_task_api_v1_kb__kb_uuid__task__task_id__restart_post
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}/stop:
    post:
      tags:
      - Task
      summary: Stop Knowledge Box Training Task
      description: Stop a train task on a knowledge box
      operationId: stop_knowledge_box_training_task_api_v1_kb__kb_uuid__task__task_id__stop_post
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/task/{task_id}/worker_config:
    get:
      tags:
      - Task
      summary: Inspect Knowledge Box Training Task Worker Config
      description: Get the worker config of a task on a knowledge box
      operationId: inspect_knowledge_box_training_task_worker_config_api_v1_kb__kb_uuid__task__task_id__worker_config_get
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRequest'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /kb/{kb_uuid}/tasks:
    get:
      tags:
      - Task
      summary: List Knowledge Box Possible Tasks
      description: Get the available tasks on a KB
      operationId: list_knowledge_box_possible_tasks_api_v1_kb__kb_uuid__tasks_get
      parameters:
      - name: kb_uuid
        in: path
        required: true
        schema:
          type: string
          title: Kb Uuid
      - name: count
        in: query
        required: false
        schema:
          type: integer
          description: How many finished tasks to return
          default: 10
          title: Count
        description: How many finished tasks to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /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_api_v1_learning_configuration_schema_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /models/{kbid}:
    get:
      tags:
      - Models
      summary: Learning Configuration Schema
      description: Get available models onprem
      operationId: Learning_configuration_schema_api_v1_models__kbid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Learning Configuration Schema Api V1 Models  Kbid  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Models
      summary: Add A Model To A Kb Onprem
      description: Add a model to a KB to be used
      operationId: Add_a_model_to_a_KB_OnPrem_api_v1_models__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelID'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /models/{kbid}/model/{model_id}:
    get:
      tags:
      - Models
      summary: Model Configuration
      description: Get trained models
      operationId: Model_configuration_api_v1_models__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:
                type: object
                title: Response Model Configuration Api V1 Models  Kbid  Model  Model
                  Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/chat:
    post:
      tags:
      - Predict
      summary: Predict Chat
      description: Chat interface for your NucliaDB
      operationId: predict_chat_api_v1_predict_chat_post
      parameters:
      - name: model
        in: query
        required: false
        schema:
          type: string
          default: chatgpt-azure-4o
          title: Model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/chat/{kbid}:
    post:
      tags:
      - Predict
      summary: Predict Chat Kbid
      description: Chat interface for your NucliaDB
      operationId: predict_chat_kbid_api_v1_predict_chat__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/query:
    get:
      tags:
      - Predict
      summary: Predict Query
      description: Get the vector of a sentence
      operationId: predict_query_api_v1_predict_query_get
      parameters:
      - name: text
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Text to process
          title: Text
        description: Text to process
      - name: semantic_model
        in: query
        required: false
        schema:
          type: string
          default: multilingual-2024-05-06
          title: Semantic Model
      - name: token_model
        in: query
        required: false
        schema:
          type: string
          default: multilingual
          title: Token Model
      - name: generative_model
        in: query
        required: false
        schema:
          type: string
          default: chatgpt-azure-4o
          title: Generative Model
      - name: rephrase
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Rephrase
      - name: rephrase_prompt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Prompt to rephrase the sentence, if not provided, the default
            prompt will be 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."
          title: Rephrase Prompt
        description: Prompt to rephrase the sentence, if not provided, the default
          prompt will be used. It must include the {question} placeholder. The placeholder
          will be replaced with the original question.
      - name: agentic_entities
        in: query
        required: false
        schema:
          type: boolean
          description: If true, the model will return the entities detected in the
            sentence guided by an already defined Graph Extraction Agent in the Knowledge
            Box.
          default: false
          title: Agentic Entities
        description: If true, the model will return the entities detected in the sentence
          guided by an already defined Graph Extraction Agent in the Knowledge Box.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/query/{kbid}:
    get:
      tags:
      - Predict
      summary: Predict Query Kbid
      description: Get the vector of a sentence
      operationId: predict_query_kbid_api_v1_predict_query__kbid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: text
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Text to process
          title: Text
        description: Text to process
      - name: semantic_models
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          description: Semantic models to compute the sentence vector for, if not
            provided, it will only compute the sentence vector for default semantic
            model in the Knowledge box's configuration.
          title: Semantic Models
        description: Semantic models to compute the sentence vector for, if not provided,
          it will only compute the sentence vector for default semantic model in the
          Knowledge box's configuration.
      - name: generative_model
        in: query
        required: false
        schema:
          type: string
          default: chatgpt-azure-4o-mini
          title: Generative Model
      - name: rephrase
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Rephrase
      - name: rephrase_prompt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Prompt to rephrase the sentence, if not provided, the default
            prompt will be 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."
          title: Rephrase Prompt
        description: Prompt to rephrase the sentence, if not provided, the default
          prompt will be used. It must include the {question} placeholder. The placeholder
          will be replaced with the original question.
      - name: agentic_entities
        in: query
        required: false
        schema:
          type: boolean
          description: If true, the model will return the entities detected in the
            sentence guided by an already defined Graph Extraction Agent in the Knowledge
            Box.
          default: false
          title: Agentic Entities
        description: If true, the model will return the entities detected in the sentence
          guided by an already defined Graph Extraction Agent in the Knowledge Box.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/remi:
    post:
      tags:
      - Predict
      summary: Predict Remi
      description: 'The REMi model is a model that computes metrics for a given question,
        answer and contexts. The metrics computed are:

        - Answer Relevance: Measures the relevance of the generated answer to the
        user query, in a scale of 0 to 5.

        - Context Relevance: Measures the relevance of the retrieved context to the
        user query, in a scale of 0 to 5.

        - Groundedness: Measures the degree to which the generated answer is grounded
        in the retrieved context, in a scale of 0 to 5.


        More information about REMi metrics and how to interpret in the following
        link: https://nuclia.com/developers/remi-open-source-rag-evaluation-model/'
      operationId: predict_remi_api_v1_predict_remi_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemiRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemiResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/remi/{kbid}:
    post:
      tags:
      - Predict
      summary: Predict Remi Kbid
      description: 'The REMi model is a model that computes metrics for a given question,
        answer and contexts. The metrics computed are:

        - Answer Relevance: Measures the relevance of the generated answer to the
        user query, in a scale of 0 to 5.

        - Context Relevance: Measures the relevance of the retrieved context to the
        user query, in a scale of 0 to 5.

        - Groundedness: Measures the degree to which the generated answer is grounded
        in the retrieved context, in a scale of 0 to 5.


        More information about REMi metrics and how to interpret in the following
        link: https://nuclia.com/developers/remi-open-source-rag-evaluation-model/'
      operationId: predict_remi_kbid_api_v1_predict_remi__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemiRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemiResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/rephrase:
    post:
      tags:
      - Predict
      summary: Predict Rephrase
      description: Rephrase interface for your NucliaDB
      operationId: predict_rephrase_api_v1_predict_rephrase_post
      parameters:
      - name: model
        in: query
        required: false
        schema:
          type: string
          default: chatgpt-azure-4o
          title: Model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RephraseModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Predict Rephrase Api V1 Predict Rephrase Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/rephrase/{kbid}:
    post:
      tags:
      - Predict
      summary: Predict Rephrase Kbid
      description: Rephrase interface for your NucliaDB with Container
      operationId: predict_rephrase_kbid_api_v1_predict_rephrase__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RephraseModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/rerank:
    post:
      tags:
      - Predict
      summary: Predict Rerank
      description: Rerank your results
      operationId: predict_rerank_api_v1_predict_rerank_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerankModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RerankResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/rerank/{kbid}:
    post:
      tags:
      - Predict
      summary: Predict Rerank Kbid
      description: Rerank your results
      operationId: predict_rerank_kbid_api_v1_predict_rerank__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerankModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RerankResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/sentence:
    get:
      tags:
      - Predict
      summary: Predict Sentence
      description: Get the vector of a sentence
      operationId: predict_sentence_api_v1_predict_sentence_get
      parameters:
      - name: text
        in: query
        required: true
        schema:
          type: string
          title: Text
      - name: model
        in: query
        required: false
        schema:
          type: string
          default: multilingual-2024-05-06
          title: Model
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SentenceSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/sentence/{kbid}:
    get:
      tags:
      - Predict
      summary: Predict Sentence Kbid
      description: Get the vector of a sentence
      operationId: predict_sentence_kbid_api_v1_predict_sentence__kbid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: text
        in: query
        required: true
        schema:
          type: string
          title: Text
      - name: models
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          description: Semantic models to compute the sentence vector for, if not
            provided, it will only compute the sentence vector for default semantic
            model in the Knowledge box's configuration.
          title: Models
        description: Semantic models to compute the sentence vector for, if not provided,
          it will only compute the sentence vector for default semantic model in the
          Knowledge box's configuration.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SentenceSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/summarize:
    post:
      tags:
      - Predict
      summary: Predict Summarize
      description: Get summarized answers via NUA
      operationId: predict_summarize_api_v1_predict_summarize_post
      parameters:
      - name: model
        in: query
        required: false
        schema:
          type: string
          default: claude-3-fast
          title: Model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummarizeModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/summarize/{kbid}:
    post:
      tags:
      - Predict
      summary: Predict Summarize Kbid
      description: Get summarized answers via NUA with Container
      operationId: predict_summarize_kbid_api_v1_predict_summarize__kbid__post
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummarizeModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/tokens:
    get:
      tags:
      - Predict
      summary: Predict Tokens
      description: Get tokens of a sentence
      operationId: predict_tokens_api_v1_predict_tokens_get
      parameters:
      - name: text
        in: query
        required: true
        schema:
          type: string
          title: Text
      - name: model
        in: query
        required: false
        schema:
          type: string
          default: multilingual
          title: Model
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /predict/tokens/{kbid}:
    get:
      tags:
      - Predict
      summary: Predict Tokens Kbid
      description: Get tokens of a sentence with Container
      operationId: predict_tokens_kbid_api_v1_predict_tokens__kbid__get
      parameters:
      - name: kbid
        in: path
        required: true
        schema:
          type: string
          title: Kbid
      - name: text
        in: query
        required: true
        schema:
          type: string
          title: Text
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/download:
    get:
      tags:
      - Processing
      summary: Download Binary File
      description: Download a file referenced in an upload token
      operationId: Download_binary_file_api_v1_processing_download_get
      parameters:
      - name: token
        in: query
        required: true
        schema:
          type: string
          title: Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/pull:
    get:
      tags:
      - Processing
      summary: Pull
      description: Pull internal message on a partition
      operationId: pull_api_v1_processing_pull_get
      parameters:
      - name: timeout
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          default: 5
          title: Timeout
      - name: partition
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          default: 1
          title: Partition
      - name: from_cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: From Cursor
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 5
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/pull/position:
    get:
      tags:
      - Processing
      summary: Pull Head
      description: Get the pull api position
      operationId: pull_head_api_v1_processing_pull_position_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullPosition'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/push:
    post:
      tags:
      - Processing
      summary: Send Data To Process
      description: Push data to process
      operationId: Send_data_to_process_api_v1_processing_push_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/requests:
    get:
      tags:
      - Processing
      summary: Get Processed Data
      description: Retreive status of processed and unprocessed payloads from a zone
      operationId: Get_processed_data_api_v1_processing_requests_get
      parameters:
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 20
          title: Limit
      - name: scheduled
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Scheduled
      - name: kbid
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
      - name: sort_on
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortFields'
          default: timestamp
      - name: sort_order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/SortOrder'
          default: asc
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessRequestStatusResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/requests/{processing_id}:
    get:
      tags:
      - Processing
      summary: Get Processed Data
      description: Retreive status of processed and unprocessed payloads from a zone
      operationId: Get_processed_data_api_v1_processing_requests__processing_id__get
      parameters:
      - name: processing_id
        in: path
        required: true
        schema:
          type: string
          title: Processing Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessRequestStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /processing/tusupload:
    post:
      tags:
      - Processing TUS uploads
      summary: Create New Upload
      description: An empty POST request is used to create a new upload resource.
        The Upload-Length header indicates the size of the entire upload in bytes.
      operationId: Create_new_upload_api_v1_processing_tusupload_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /processing/tusupload/{upload_id}:
    options:
      tags:
      - Processing TUS uploads
      summary: Tus Server Information
      description: "Gather information about the Server\u2019s current configuration\
        \ such as enabled extensions, version..."
      operationId: TUS_Server_information_api_v1_processing_tusupload__upload_id__options
      parameters:
      - name: upload_id
        in: path
        required: true
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Upload Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    head:
      tags:
      - Processing TUS uploads
      summary: Upload Information
      description: Get information about a current download (completed upload size)
      operationId: Upload_information_api_v1_processing_tusupload__upload_id__head
      parameters:
      - 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'
    patch:
      tags:
      - Processing TUS uploads
      summary: Upload Data
      description: Upload all bytes in the requests and append them in the specifyied
        offset
      operationId: Upload_data_api_v1_processing_tusupload__upload_id__patch
      parameters:
      - 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'
  /processing/upload:
    post:
      tags:
      - Processing
      summary: Upload Binary File
      description: Upload a file using a multipart request
      operationId: Upload_binary_file_api_v1_processing_upload_post
      parameters:
      - name: x-filename
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          default: ''
          title: X-Filename
      - name: x-password
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Password
      - 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
          - type: 'null'
          title: X-Md5
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /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_api_v1_schema_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /schema/{kbid}:
    get:
      tags:
      - Knowledge Boxes
      summary: Learning Configuration Schema
      description: Get jsonschema definition for `learning_configuration` field of
        knowledgebox update payload
      operationId: Learning_configuration_schema_api_v1_schema__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/ConfigSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
x-metadata:
  processing:
    commit: e904e19
    last_updated: '2025-02-25T14:27:12.326258'
  workers:
    commit: dea5ff9
    last_updated: '2025-03-13T10:54:18.287321'
  collector:
    commit: d8651a6
    last_updated: '2024-11-06T11:20:18.210121'
  predict:
    commit: 99fc34a
    last_updated: '2025-03-14T15:10:53.452507'
  learning:
    commit: 99fc34a
    last_updated: '2025-03-14T15:09:11.801263'
components:
  schemas:
    Format:
      type: integer
      enum:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      title: Format
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LayoutFormat:
      type: integer
      enum:
      - 0
      title: LayoutFormat
    LearningConfig:
      properties:
        semantic_models:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Semantic Models
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative Model
        ner_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Ner Model
        anonymization_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Anonymization Model
        visual_labeling:
          anyOf:
          - type: string
          - type: 'null'
          title: Visual Labeling
      type: object
      title: LearningConfig
    LinkUpload:
      properties:
        link:
          type: string
          title: Link
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
        cookies:
          additionalProperties:
            type: string
          type: object
          title: Cookies
        localstorage:
          additionalProperties:
            type: string
          type: object
          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
      type: object
      required:
      - link
      - headers
      - cookies
      - localstorage
      title: LinkUpload
    ProcessRequestStatus:
      properties:
        processing_id:
          type: string
          title: Processing Id
        resource_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Resource Id
        kbid:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        labels:
          items:
            type: string
          type: array
          title: Labels
        completed:
          type: boolean
          title: Completed
        scheduled:
          type: boolean
          title: Scheduled
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        scheduled_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Scheduled At
        failed:
          type: boolean
          title: Failed
          default: false
        retries:
          type: integer
          title: Retries
          default: 0
        schedule_eta:
          type: number
          title: Schedule Eta
          default: 0.0
        schedule_order:
          type: integer
          title: Schedule Order
          default: 0
        request:
          anyOf:
          - type: string
          - type: 'null'
          title: Request
        response:
          anyOf:
          - type: string
          - type: 'null'
          title: Response
      type: object
      required:
      - processing_id
      - resource_id
      - kbid
      - title
      - labels
      - completed
      - scheduled
      - timestamp
      - completed_at
      - scheduled_at
      title: ProcessRequestStatus
    ProcessRequestStatusResults:
      properties:
        results:
          items:
            $ref: '#/components/schemas/ProcessRequestStatus'
          type: array
          title: Results
        cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
      type: object
      required:
      - results
      - cursor
      title: ProcessRequestStatusResults
    ProcessingBlock:
      properties:
        x:
          type: integer
          title: X
        y:
          type: integer
          title: Y
        cols:
          type: integer
          title: Cols
        rows:
          type: integer
          title: Rows
        type:
          $ref: '#/components/schemas/TypeBlock'
        ident:
          type: string
          title: Ident
        payload:
          type: string
          title: Payload
      type: object
      required:
      - x
      - y
      - cols
      - rows
      - type
      - ident
      - payload
      title: ProcessingBlock
    ProcessingConversation:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/ProcessingMessage'
          type: array
          title: Messages
      type: object
      required:
      - messages
      title: ProcessingConversation
    ProcessingLayoutDiff:
      properties:
        format:
          $ref: '#/components/schemas/LayoutFormat'
        blocks:
          additionalProperties:
            $ref: '#/components/schemas/ProcessingBlock'
          type: object
          title: Blocks
      type: object
      required:
      - format
      - blocks
      title: ProcessingLayoutDiff
    ProcessingMessage:
      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/ProcessingMessageContent'
        ident:
          type: string
          title: Ident
      type: object
      required:
      - content
      - ident
      title: ProcessingMessage
    ProcessingMessageContent:
      properties:
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
        format:
          $ref: '#/components/schemas/Format'
      type: object
      required:
      - format
      title: ProcessingMessageContent
    ProcessingQueueType:
      type: string
      enum:
      - shared
      - private
      title: ProcessingQueueType
    PullPosition:
      properties:
        cursor:
          type: integer
          title: Cursor
      type: object
      required:
      - cursor
      title: PullPosition
    PullResponse:
      properties:
        status:
          $ref: '#/components/schemas/PullStatus'
        payload:
          anyOf:
          - type: string
            format: binary
          - type: 'null'
          title: Payload
        payloads:
          items:
            type: string
            format: binary
          type: array
          title: Payloads
          default: []
        msgid:
          anyOf:
          - type: string
          - type: 'null'
          title: Msgid
        cursor:
          anyOf:
          - type: integer
          - type: 'null'
          title: Cursor
      type: object
      required:
      - status
      title: PullResponse
    PullStatus:
      type: string
      enum:
      - ok
      - error
      - empty
      - notfound
      title: PullStatus
    PushPayload:
      properties:
        kbid:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
        uuid:
          anyOf:
          - type: string
          - type: 'null'
          title: Uuid
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        labels:
          items:
            type: string
          type: array
          title: Labels
          default: []
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
        source:
          anyOf:
          - $ref: '#/components/schemas/Source'
          - type: 'null'
        userid:
          anyOf:
          - type: string
          - type: 'null'
          title: Userid
        genericfield:
          additionalProperties:
            $ref: '#/components/schemas/Text'
          type: object
          title: Genericfield
          default: {}
        filefield:
          additionalProperties:
            type: string
          type: object
          title: Filefield
          default: {}
        linkfield:
          additionalProperties:
            $ref: '#/components/schemas/LinkUpload'
          type: object
          title: Linkfield
          default: {}
        textfield:
          additionalProperties:
            $ref: '#/components/schemas/Text'
          type: object
          title: Textfield
          default: {}
        layoutfield:
          additionalProperties:
            $ref: '#/components/schemas/ProcessingLayoutDiff'
          type: object
          title: Layoutfield
          default: {}
        conversationfield:
          additionalProperties:
            $ref: '#/components/schemas/ProcessingConversation'
          type: object
          title: Conversationfield
          default: {}
        processing_options:
          anyOf:
          - $ref: '#/components/schemas/PushProcessingOptions'
          - type: 'null'
        learning_config:
          anyOf:
          - $ref: '#/components/schemas/LearningConfig'
          - type: 'null'
        webhook_config:
          anyOf:
          - $ref: '#/components/schemas/WebhookConfig'
          - type: 'null'
      type: object
      title: PushPayload
    PushProcessingOptions:
      properties:
        ml_text:
          type: boolean
          title: Ml Text
          default: true
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
      type: object
      title: PushProcessingOptions
    PushResponse:
      properties:
        seqid:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seqid
        account_seq:
          anyOf:
          - type: integer
          - type: 'null'
          title: Account Seq
        queue:
          anyOf:
          - $ref: '#/components/schemas/ProcessingQueueType'
          - type: 'null'
        uuid:
          anyOf:
          - type: string
          - type: 'null'
          title: Uuid
        processing_id:
          type: string
          title: Processing Id
      type: object
      required:
      - processing_id
      title: PushResponse
    SortFields:
      type: string
      enum:
      - timestamp
      - scheduled_at
      - completed_at
      title: SortFields
    SortOrder:
      type: string
      enum:
      - asc
      - desc
      title: SortOrder
    Source:
      type: integer
      enum:
      - 0
      - 1
      title: Source
    Text:
      properties:
        body:
          type: string
          title: Body
        format:
          $ref: '#/components/schemas/Format'
        extract_strategy:
          anyOf:
          - type: string
          - type: 'null'
          title: Extract Strategy
      type: object
      required:
      - body
      - format
      title: Text
    TypeBlock:
      type: integer
      enum:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      title: TypeBlock
    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
    WebhookConfig:
      properties:
        uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Uri
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          default: {}
      type: object
      title: WebhookConfig
    AnthropicKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: AnthropicKey
    AnthropicUserPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
          examples:
          - "Taking into account our chat history: {chat_history} and this provided\
            \ context: <Context> {context} </Context>\n    Can you answer this question\
            \ in a clear, concise way: <Question> {question} </Question>"
          - "Taking into account this provided context.\n    Context:\n    {context}\n\
            \    Answer this QUESTION: \"{question}\" like a medical professional."
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Answer this question: <Question> {question} </Question>\n    If you\
            \ do not find an answer in the context, say that you don't have enough\
            \ data."
          info: Input here your prompt with the words{chat_history}, {context} and
            {question} in brackets where you want those fields to be placed, in case
            you want them in your prompt.
      type: object
      required:
      - prompt
      title: AnthropicUserPrompt
    ApplyOptions:
      type: string
      enum:
      - EXISTING
      - NEW
      - ALL
      title: ApplyOptions
      description: 'Defines how the tasks should be applied to the existing data.

        - EXSITING: Only apply to existing data (starts a worker that executes the
        task)

        - NEW: Only apply to new data (enables the task at processing time)

        - ALL: Apply to all data (both of the above)'
    ApplyTo:
      type: integer
      enum:
      - 0
      - 1
      title: ApplyTo
    AskOperation:
      properties:
        question:
          type: string
          title: Question
        destination:
          type: string
          title: Destination
        json:
          type: boolean
          title: Json
          default: false
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
        user_prompt:
          type: string
          title: Custom User Prompt
          description: Prompt to use when executing the agent over a field, it must
            include the {context} placeholder and optionally the {question} placeholder
            if you wish. If not given, the default prompt will be used. Only supported
            when `json` is not set
          default: ''
      type: object
      required:
      - question
      - destination
      title: AskOperation
    AzureAIIKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        url:
          type: string
          title: Url
          default: ''
        model:
          type: string
          title: Model
          default: ''
      type: object
      title: AzureAIIKey
    AzureMistralKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        url:
          type: string
          title: Url
          default: ''
      type: object
      title: AzureMistralKey
    AzureMistralUserPrompt:
      properties:
        system:
          type: string
          title: System
          default: ''
          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
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples:
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Can you answer this question in a clear, concise way: <Question>\
            \ {question} </Question>"
          - "Taking into account this provided context.\n    Context:\n    {context}\n\
            \    Answer this QUESTION: \"{question}\" like an economy expert."
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Answer this question: <Question> {question} </Question>\n    If you\
            \ do not find an answer in the context, say that you don't have enough\
            \ data."
          info: Input here your prompt with the words {context} and {question} in
            brackets where you want those fields to be placed, in case you want them
            in your prompt.
      type: object
      required:
      - prompt
      title: AzureMistralUserPrompt
    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
    AzureUserPrompt:
      properties:
        system:
          type: string
          title: System
          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
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Taking into account our previous conversation, and this context: {context}
            answer this question: {question}'
          - 'Give a detailed answer to this question: {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: {question} in a
            concise way using the provided context'
          - 'Given this context: {context}. Answer this question: {question} using
            the provided context. Please, answer always in French'
          info: "Input here your prompt with the words {context} and {question} in\
            \ brackets where you want those fields to be placed, in case you want\
            \ them in your prompt.\n For this generative model {chat_history} is not\
            \ available to modify in the prompt"
      type: object
      required:
      - system
      - prompt
      title: AzureUserPrompt
    Claude3UserPrompt:
      properties:
        system:
          type: string
          title: System
          examples:
          - You are a medical assistant, use medical terminology
          - 'Never answer any question related to any of these forbidden topics: medical
            advice, betting, offensive topics'
          - You are a very friendly customer service assistant, be polite
          - Always answer in Spanish
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Taking into account our previous conversation, and this context: {context}
            answer this question: {question}'
          - 'Give a detailed answer to this question: {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: {question} in a
            concise way using the provided context'
          - 'Given this context: {context}. Answer this question: {question} using
            the provided context. Please, answer always in French'
          info: "Input here your prompt with the words  {context} and {question} in\
            \ brackets where you want those fields to be placed, in case you want\
            \ them in your prompt.\n For this generative model {chat_history} is not\
            \ available to modify in the prompt"
      type: object
      required:
      - system
      - prompt
      title: Claude3UserPrompt
    DataAugmentation-Input:
      properties:
        name:
          type: string
          title: Name
          default: ''
        'on':
          $ref: '#/components/schemas/ApplyTo'
          description: Defines if the task should be applied to paragraphs (0) or
            whole fields (1)
          default: 0
        filter:
          anyOf:
          - $ref: '#/components/schemas/Filter'
          - type: 'null'
          description: Filter to apply the data augmentation
        operations:
          items:
            $ref: '#/components/schemas/Operation-Input'
          type: array
          title: Operations
        llm:
          $ref: '#/components/schemas/LLMConfig-Input'
      type: object
      required:
      - llm
      title: DataAugmentation
    DataAugmentation-Output:
      properties:
        name:
          type: string
          title: Name
          default: ''
        'on':
          $ref: '#/components/schemas/ApplyTo'
          description: Defines if the task should be applied to paragraphs (0) or
            whole fields (1)
          default: 0
        filter:
          anyOf:
          - $ref: '#/components/schemas/Filter'
          - type: 'null'
          description: Filter to apply the data augmentation
        operations:
          items:
            $ref: '#/components/schemas/Operation-Output'
          type: array
          title: Operations
        llm:
          $ref: '#/components/schemas/LLMConfig-Output'
      type: object
      required:
      - llm
      title: DataAugmentation
    Dataset:
      properties:
        id:
          type: string
          title: Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        account_id:
          type: string
          title: Account Id
        nua_client_id:
          type: string
          title: Nua Client Id
        account_type:
          type: string
          title: Account Type
        type:
          type: string
          title: Type
        path:
          type: string
          title: Path
        filter:
          type: object
          title: Filter
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
      type: object
      required:
      - id
      - timestamp
      - account_id
      - nua_client_id
      - account_type
      - type
      - path
      - filter
      title: Dataset
    DatasetCreated:
      properties:
        id:
          type: string
          title: Id
      type: object
      required:
      - id
      title: DatasetCreated
    DatasetFilter:
      properties:
        labels:
          items:
            type: string
          type: array
          title: Labels
      type: object
      required:
      - labels
      title: DatasetFilter
    DatasetInfo:
      properties:
        name:
          type: string
          title: Name
        filter:
          $ref: '#/components/schemas/DatasetFilter'
        type:
          $ref: '#/components/schemas/Task-Input'
      type: object
      required:
      - name
      - filter
      - type
      title: DatasetInfo
    DatasetsList:
      properties:
        datasets:
          items:
            $ref: '#/components/schemas/Dataset'
          type: array
          title: Datasets
      type: object
      required:
      - datasets
      title: DatasetsList
    DeepSeekUserPrompt:
      properties:
        system:
          type: string
          title: System
          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
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples:
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Can you answer this question in a clear, concise way: <Question>\
            \ {question} </Question>"
          - "Taking into account this provided context.\n    Context:\n    {context}\n\
            \    Answer this QUESTION: \"{question}\" like an economy expert."
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Answer this question: <Question> {question} </Question>\n    If you\
            \ do not find an answer in the context, say that you don't have enough\
            \ data."
          info: Input here your prompt with the words {context} and {question} in
            brackets where you want those fields to be placed, in case you want them
            in your prompt.
      type: object
      required:
      - system
      - prompt
      title: DeepSeekUserPrompt
    EntityDefinition:
      properties:
        label:
          type: string
          title: Label
          description: Entity type
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: Description of the entity type
          default: ''
      type: object
      required:
      - label
      title: EntityDefinition
    EntityExample:
      properties:
        name:
          type: string
          title: Name
          description: Name associated with the entity
        label:
          type: string
          title: Label
          description: Type of entity
      type: object
      required:
      - name
      - label
      title: EntityExample
    ExtractOperation:
      properties:
        model:
          $ref: '#/components/schemas/Model'
          default: 0
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      title: ExtractOperation
    Filter:
      properties:
        contains:
          items:
            type: string
          type: array
          title: Contains
          description: Text that must be contained in the field in order to apply
            the data augmentation, if multiple values are provided, at least one must
            be present
        resource_type:
          items:
            type: string
          type: array
          title: Resource Type
          description: Data Augmentation will only be applied to resources of the
            specified types
        field_types:
          items:
            type: string
          type: array
          title: Field Types
          description: Data Augmentation will only be applied to fields of the specified
            types
        not_field_types:
          items:
            type: string
          type: array
          title: Not Field Types
          description: Data Augmentation will not be applied to fields of the specified
            types
        rids:
          items:
            type: string
          type: array
          title: Rids
          description: Data Augmentation will only be applied resources matching the
            specified resource ids
        fields:
          items:
            type: string
          type: array
          title: Fields
          description: Data Augmentation will only be applied to fields matching the
            specified field ids
        splits:
          items:
            type: string
          type: array
          title: Splits
          description: Data Augmentation will only be applied to fields matching the
            specified field splits
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: Data Augmentation will only be applied to fields matching the
            specified labels
        apply_to_agent_generated_fields:
          type: boolean
          title: Apply To Agent Generated Fields
          description: If enabled, the data augmentation will also be applied to fields
            generated by other data augmentation agents. This functionality is only
            supported for agents that do not generate fields.
          default: false
      type: object
      title: Filter
    GraphExtractionExample:
      properties:
        entities:
          items:
            $ref: '#/components/schemas/EntityExample'
          type: array
          title: Entities
          description: Examples of entities extracted from the example text
        relations:
          items:
            $ref: '#/components/schemas/RelationExample'
          type: array
          title: Relations
          description: Examples of relations extracted from the example text, all
            entities must be included in the entities list
        text:
          type: string
          title: Text
          description: Example text where entities and relations were extracted
      type: object
      required:
      - entities
      - relations
      - text
      title: GraphExtractionExample
    GraphOperation-Input:
      properties:
        entity_defs:
          items:
            $ref: '#/components/schemas/EntityDefinition'
          type: array
          title: Entity Defs
          description: Types of entities that will be considered for extraction
        examples:
          items:
            $ref: '#/components/schemas/GraphExtractionExample'
          type: array
          title: Examples
          description: Examples to be sent to the model as few-shot learning
        ident:
          type: string
          title: ID of Operation, Will be used to tag the extracted entities and relationships
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      required:
      - ident
      title: GraphOperation
    GraphOperation-Output:
      properties:
        entity_defs:
          items:
            $ref: '#/components/schemas/EntityDefinition'
          type: array
          title: Entity Defs
          description: Types of entities that will be considered for extraction
        examples:
          items:
            $ref: '#/components/schemas/GraphExtractionExample'
          type: array
          title: Examples
          description: Examples to be sent to the model as few-shot learning
        ident:
          type: string
          title: ID of Operation, Will be used to tag the extracted entities and relationships
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      required:
      - ident
      title: GraphOperation
    GuardOperation:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: false
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      title: GuardOperation
    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
    JobStatus:
      type: string
      enum:
      - not_running
      - finished
      - running
      - started
      - stopped
      - failed
      - terminating
      - starting
      title: JobStatus
    LLMConfig-Input:
      properties:
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__UserLearningKeys-Input'
          - 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
    LLMConfig-Output:
      properties:
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__UserLearningKeys-Output'
          - 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
    Label:
      properties:
        label:
          type: string
          title: Label Name
        description:
          type: string
          title: Description of the Label
          default: ''
        examples:
          items:
            type: string
          type: array
          title: Examples
      type: object
      required:
      - label
      title: Label
    LabelOperation:
      properties:
        labels:
          items:
            $ref: '#/components/schemas/Label'
          type: array
          title: Labels
        ident:
          type: string
          title: ID of Operation, Will be used to name the generated Label Set
        description:
          type: string
          title: Description of the Operation, will be used to describe to the model
            the task at hand
          default: ''
        multiple:
          type: boolean
          title: Multiple
          default: false
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      required:
      - ident
      title: LabelOperation
    MistralKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: MistralKey
    MistralUserPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
          examples:
          - "Taking into account our chat history: {chat_history} and this provided\
            \ context: <Context> {context} </Context>\n    Can you answer this question\
            \ in a clear, concise way: <Question> {question} </Question>"
          - "Taking into account this provided context.\n    Context:\n    {context}\n\
            \    Answer this QUESTION: \"{question}\" like a medical professional."
          - "Taking into account this provided context: <Context> {context} </Context>\n\
            \    Answer this question: <Question> {question} </Question>\n    If you\
            \ do not find an answer in the context, say that you don't have enough\
            \ data."
          info: Input here your prompt with the words {chat_history}, {context} and
            {question} in brackets where you want those fields to be placed, in case
            you want them in your prompt.
      type: object
      required:
      - prompt
      title: MistralUserPrompt
    Model:
      type: integer
      enum:
      - 0
      title: Model
    ModelType:
      type: integer
      enum:
      - 0
      - 1
      title: ModelType
    OpenAIKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        org:
          type: string
          title: Org
          default: ''
      type: object
      title: OpenAIKey
    OpenAIUserPrompt:
      properties:
        system:
          type: string
          title: System
          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
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Taking into account our previous conversation, and this context: {context}
            answer this question: {question}'
          - 'Give a detailed answer to this question: {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: {question} in a
            concise way using the provided context'
          - 'Given this context: {context}. Answer this question: {question} using
            the provided context. Please, answer always in French'
          info: "Input here your prompt with the words {context} and {question} in\
            \ brackets where you want those fields to be placed, in case you want\
            \ them in your prompt.\n For this generative model {chat_history} is not\
            \ available to modify in the prompt"
      type: object
      required:
      - system
      - prompt
      title: OpenAIUserPrompt
    Operation-Input:
      properties:
        graph:
          anyOf:
          - $ref: '#/components/schemas/GraphOperation-Input'
          - type: 'null'
          title: Graph Config
        label:
          anyOf:
          - $ref: '#/components/schemas/LabelOperation'
          - type: 'null'
          title: Label Config
        ask:
          anyOf:
          - $ref: '#/components/schemas/AskOperation'
          - type: 'null'
          title: Ask Config
        qa:
          anyOf:
          - $ref: '#/components/schemas/QAOperation'
          - type: 'null'
          title: QA Config
        extract:
          anyOf:
          - $ref: '#/components/schemas/ExtractOperation'
          - type: 'null'
          title: Extract Config
        prompt_guard:
          anyOf:
          - $ref: '#/components/schemas/GuardOperation'
          - type: 'null'
          title: Prompt Guard Config
        llama_guard:
          anyOf:
          - $ref: '#/components/schemas/GuardOperation'
          - type: 'null'
          title: Llama Guard Config
      type: object
      title: Operation
      description: 'XXX: Hey developer! If you modify this message, update the `OperationType``
        enum above'
    Operation-Output:
      properties:
        graph:
          anyOf:
          - $ref: '#/components/schemas/GraphOperation-Output'
          - type: 'null'
          title: Graph Config
        label:
          anyOf:
          - $ref: '#/components/schemas/LabelOperation'
          - type: 'null'
          title: Label Config
        ask:
          anyOf:
          - $ref: '#/components/schemas/AskOperation'
          - type: 'null'
          title: Ask Config
        qa:
          anyOf:
          - $ref: '#/components/schemas/QAOperation'
          - type: 'null'
          title: QA Config
        extract:
          anyOf:
          - $ref: '#/components/schemas/ExtractOperation'
          - type: 'null'
          title: Extract Config
        prompt_guard:
          anyOf:
          - $ref: '#/components/schemas/GuardOperation'
          - type: 'null'
          title: Prompt Guard Config
        llama_guard:
          anyOf:
          - $ref: '#/components/schemas/GuardOperation'
          - type: 'null'
          title: Llama Guard Config
      type: object
      title: Operation
      description: 'XXX: Hey developer! If you modify this message, update the `OperationType``
        enum above'
    PalmKey:
      properties:
        credentials:
          type: string
          title: Credentials
        location:
          type: string
          title: Location
          default: ''
      type: object
      required:
      - credentials
      title: PalmKey
    PalmUserPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Answer my question in an informal tone, based only in this context: {context}.
            Question: {question}'
          - 'Answer my question in a concise way using the provided context: {context}.
            If you do not find an answer in the context, say that you don''t have
            enough data. Question: {question}'
          - 'You answer my questions like a medical professional, based only in this
            context: {context}. This is my question: {question}'
          info: "Input here your prompt with the words {context} and {question} in\
            \ brackets where you want those fields to be placed, in case you want\
            \ them in your prompt.\n For this generative model {chat_history} is not\
            \ available to modify in the prompt"
      type: object
      required:
      - prompt
      title: PalmUserPrompt
    PublicTask:
      properties:
        name:
          type: string
          title: Name
        data_augmentation:
          type: boolean
          title: Data Augmentation
          default: false
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        can_cleanup:
          type: boolean
          title: Can Cleanup
          description: Whether the task supports the cleanup mode at task deletion
            time
          default: false
      type: object
      required:
      - name
      title: PublicTask
    PublicTaskConfig:
      properties:
        task:
          $ref: '#/components/schemas/PublicTask'
        kbid:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
        account_id:
          type: string
          title: Account Id
        account_type:
          type: string
          title: Account Type
        nua_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Nua Client Id
        user_id:
          type: string
          title: User Id
        parameters:
          anyOf:
          - $ref: '#/components/schemas/DataAugmentation-Output'
          - $ref: '#/components/schemas/SemanticModelMigrationParams'
          - type: 'null'
          title: Parameters
        id:
          type: string
          title: Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        defined_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Defined At
      type: object
      required:
      - task
      - account_id
      - account_type
      - user_id
      - id
      - timestamp
      title: PublicTaskConfig
    PublicTaskRequest:
      properties:
        task:
          $ref: '#/components/schemas/PublicTask'
        source:
          $ref: '#/components/schemas/TrainingTaskDatasetSource'
        kbid:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
        dataset_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Dataset Id
        account_id:
          type: string
          title: Account Id
        nua_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Nua Client Id
        user_id:
          type: string
          title: User Id
        id:
          type: string
          title: Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        scheduled:
          type: boolean
          title: Scheduled
          default: false
        completed:
          type: boolean
          title: Completed
          default: false
        stopped:
          type: boolean
          title: Stopped
          default: false
        scheduled_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Scheduled At
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        stopped_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Stopped At
        failed:
          type: boolean
          title: Failed
          default: false
        retries:
          type: integer
          title: Retries
          default: 0
        parameters:
          anyOf:
          - $ref: '#/components/schemas/DataAugmentation-Output'
          - $ref: '#/components/schemas/SemanticModelMigrationParams'
          - type: 'null'
          title: Parameters
        log:
          anyOf:
          - type: string
          - type: 'null'
          title: Log
        cleanup_parent_task_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Cleanup Parent Task Id
          description: The ID of the task that this cleanup task is cleaning up after.
            This is only set to cleanup tasks.
      type: object
      required:
      - task
      - source
      - account_id
      - user_id
      - id
      - timestamp
      title: PublicTaskRequest
    PublicTaskSet:
      properties:
        request:
          anyOf:
          - $ref: '#/components/schemas/PublicTaskRequest'
          - type: 'null'
        config:
          anyOf:
          - $ref: '#/components/schemas/PublicTaskConfig'
          - type: 'null'
      type: object
      title: PublicTaskSet
    QAOperation:
      properties:
        question_generator_prompt:
          type: string
          title: Question Generator Prompt
          default: ''
        system_question_generator_prompt:
          type: string
          title: System Question Generator Prompt
          default: ''
        summary_prompt:
          type: string
          title: Summary Prompt
          default: ''
        generate_answers_prompt:
          type: string
          title: Generate Answers Prompt
          default: ''
        triggers:
          items:
            $ref: '#/components/schemas/Trigger'
          type: array
          title: Triggers to execute when the operation is executed
      type: object
      title: QAOperation
    RelationExample:
      properties:
        source:
          type: string
          title: Source
          description: Entity name from which the relation starts
        target:
          type: string
          title: Target
          description: Entity name to which the relation ends
        label:
          type: string
          title: Label
          description: Type of relation
      type: object
      required:
      - source
      - target
      - label
      title: RelationExample
    SemanticModelMigrationParams:
      properties:
        semantic_model_id:
          type: string
          title: Semantic Model Id
          description: The id of the semantic model to migrate to. This must be a
            valid semantic model id available for the account
        hf_embedding_key:
          anyOf:
          - $ref: '#/components/schemas/workers_api__models__HFEmbeddingKey'
          - type: 'null'
          description: The HuggingFace embedding key to use. This is only required
            if the semantic model is `hf_embedding`
      type: object
      required:
      - semantic_model_id
      title: SemanticModelMigrationParams
    Task-Input:
      type: string
      enum:
      - PARAGRAPH_CLASSIFICATION
      - FIELD_CLASSIFICATION
      - SENTENCE_CLASSIFICATION
      - TOKEN_CLASSIFICATION
      - IMAGE_CLASSIFICATION
      - PARAGRAPH_STREAMING
      - QUESTION_ANSWER_STREAMING
      - FIELD_STREAMING
      title: Task
    Task-Output:
      properties:
        name:
          type: string
          title: Name
        image_repository:
          type: string
          title: Image Repository
          default: europe-west4-docker.pkg.dev/nuclia-internal/nuclia
        image_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Image Name
        image_version:
          type: string
          title: Image Version
          default: latest
        entrypoint:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Entrypoint
        sentry_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sentry Id
        memory:
          type: string
          title: Memory
          default: 1Gi
        cpu:
          type: string
          title: Cpu
          default: 1000m
        imagePullPolicy:
          type: string
          title: Imagepullpolicy
          default: Always
        use_gpu:
          type: boolean
          title: Use Gpu
          default: false
        trainset_type:
          anyOf:
          - type: integer
          - type: 'null'
          title: Trainset Type
        command:
          items:
            type: string
          type: array
          title: Command
        disallowed_account_types:
          items:
            type: string
          type: array
          title: Disallowed Account Types
          default: []
        model_type:
          title: Model Type
        listing:
          type: boolean
          title: Listing
          default: true
        data_augmentation:
          type: boolean
          title: Data Augmentation
          default: false
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        feedback:
          type: boolean
          title: Feedback
          default: false
        cleanup_command:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Cleanup Command
      type: object
      required:
      - name
      - command
      title: Task
    TaskDefinition:
      properties:
        name:
          $ref: '#/components/schemas/TaskName'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        validation:
          anyOf:
          - type: object
          - type: 'null'
          title: Validation
      type: object
      required:
      - name
      title: TaskDefinition
    TaskList:
      properties:
        tasks:
          items:
            $ref: '#/components/schemas/TaskDefinition'
          type: array
          title: Tasks
        running:
          items:
            $ref: '#/components/schemas/PublicTaskRequest'
          type: array
          title: Running
        configs:
          items:
            $ref: '#/components/schemas/PublicTaskConfig'
          type: array
          title: Configs
        done:
          items:
            $ref: '#/components/schemas/PublicTaskRequest'
          type: array
          title: Done
      type: object
      required:
      - tasks
      - running
      - configs
      - done
      title: TaskList
    TaskName:
      type: string
      enum:
      - dummy
      - env
      - demo-dataset
      - labeler
      - llm-graph
      - synthetic-questions
      - ask
      - llm-align
      - semantic-model-migrator
      - llama-guard
      - prompt-guard
      title: TaskName
    TaskRequest:
      properties:
        task:
          $ref: '#/components/schemas/Task-Output'
        source:
          $ref: '#/components/schemas/TrainingTaskDatasetSource'
        kbid:
          anyOf:
          - type: string
          - type: 'null'
          title: Kbid
        dataset_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Dataset Id
        dataset_path:
          anyOf:
          - type: string
          - type: 'null'
          title: Dataset Path
        account_id:
          type: string
          title: Account Id
        account_type:
          type: string
          title: Account Type
        nua_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Nua Client Id
        user_id:
          type: string
          title: User Id
        parameters:
          anyOf:
          - $ref: '#/components/schemas/DataAugmentation-Output'
          - $ref: '#/components/schemas/SemanticModelMigrationParams'
          - type: 'null'
          title: Parameters
        id:
          type: string
          title: Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        scheduled:
          type: boolean
          title: Scheduled
          default: false
        completed:
          type: boolean
          title: Completed
          default: false
        stopped:
          type: boolean
          title: Stopped
          default: false
        scheduled_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Scheduled At
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        stopped_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Stopped At
        failed:
          type: boolean
          title: Failed
          default: false
        retries:
          type: integer
          title: Retries
          default: 0
        token:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
        key_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Key Id
        ndb_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Ndb Token
        log:
          anyOf:
          - type: string
          - type: 'null'
          title: Log
        cleanup_parent_task_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Cleanup Parent Task Id
          description: The ID of the task that this cleanup task is cleaning up after.
            This is only set to cleanup tasks.
      type: object
      required:
      - task
      - source
      - account_id
      - account_type
      - user_id
      - id
      - timestamp
      title: TaskRequest
    TaskResponse:
      properties:
        name:
          $ref: '#/components/schemas/TaskName'
        status:
          $ref: '#/components/schemas/JobStatus'
        id:
          type: string
          title: Id
      type: object
      required:
      - name
      - status
      - id
      title: TaskResponse
    TaskStart:
      properties:
        name:
          $ref: '#/components/schemas/TaskName'
        parameters:
          anyOf:
          - $ref: '#/components/schemas/DataAugmentation-Input'
          - $ref: '#/components/schemas/SemanticModelMigrationParams'
          - type: 'null'
          title: Parameters
          description: Parameters to be passed to the task. These must match the `validation`
            field for the Task definition class
      additionalProperties: false
      type: object
      required:
      - name
      - parameters
      title: TaskStart
    TaskStartKB:
      properties:
        name:
          $ref: '#/components/schemas/TaskName'
        parameters:
          anyOf:
          - $ref: '#/components/schemas/DataAugmentation-Input'
          - $ref: '#/components/schemas/SemanticModelMigrationParams'
          - type: 'null'
          title: Parameters
          description: Parameters to be passed to the task. These must match the `validation`
            field for the Task definition class
        apply:
          $ref: '#/components/schemas/ApplyOptions'
          description: "\n    Defines how the tasks should be applied to the existing\
            \ data.\n    - EXSITING: Only apply to existing data (starts a worker\
            \ that executes the task)\n    - NEW: Only apply to new data (enables\
            \ the task at processing time)\n    - ALL: Apply to all data (both of\
            \ the above)\n    "
          default: ALL
      additionalProperties: false
      type: object
      required:
      - name
      - parameters
      title: TaskStartKB
    TextGenerationKey:
      properties:
        model:
          type: string
          title: Model
          default: ''
      type: object
      title: TextGenerationKey
    TextGenerationUserPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Taking into account our chat history: {chat_history} and this provided
            context: {context}, answer this question: "{question}" :'
          - 'Answer this question: "{question}" . If you do not find an answer in
            the context, say that you don''t have enough data. Taking into account
            the provided context: {context}. Your answer:'
          - 'Taking into account the provided context: {context}, answer this question:
            "{question}" like a medical professional.'
          info: Input here your prompt with the words {chat_history}, {context} and
            {question} in brackets where you want those fields to be placed, in case
            you want them in your prompt.
      type: object
      required:
      - prompt
      title: TextGenerationUserPrompt
    TrainingTaskDatasetSource:
      type: string
      enum:
      - nucliadb
      - dataset
      title: TrainingTaskDatasetSource
    Trigger:
      properties:
        url:
          type: string
          title: Url
          default: ''
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
        params:
          additionalProperties:
            type: string
          type: object
          title: Params
      type: object
      title: Trigger
    UserLearningKeys-Input:
      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/learning_protos__config_p2p__HFEmbeddingKey'
          - type: 'null'
        azure_aii:
          anyOf:
          - $ref: '#/components/schemas/AzureAIIKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
    UserLearningKeys-Output:
      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/learning_protos__config_p2p__HFEmbeddingKey'
          - type: 'null'
        azure_aii:
          anyOf:
          - $ref: '#/components/schemas/AzureAIIKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
    UserPrompts:
      properties:
        openai:
          anyOf:
          - $ref: '#/components/schemas/OpenAIUserPrompt'
          - type: 'null'
        azure_openai:
          anyOf:
          - $ref: '#/components/schemas/AzureUserPrompt'
          - type: 'null'
        palm:
          anyOf:
          - $ref: '#/components/schemas/PalmUserPrompt'
          - type: 'null'
        anthropic:
          anyOf:
          - $ref: '#/components/schemas/AnthropicUserPrompt'
          - type: 'null'
        claude3:
          anyOf:
          - $ref: '#/components/schemas/Claude3UserPrompt'
          - type: 'null'
        text_generation:
          anyOf:
          - $ref: '#/components/schemas/TextGenerationUserPrompt'
          - type: 'null'
        mistral:
          anyOf:
          - $ref: '#/components/schemas/MistralUserPrompt'
          - type: 'null'
        azure_mistral:
          anyOf:
          - $ref: '#/components/schemas/AzureMistralUserPrompt'
          - type: 'null'
        hf_llm:
          anyOf:
          - $ref: '#/components/schemas/HFUserPrompt'
          - type: 'null'
        openai_url:
          anyOf:
          - $ref: '#/components/schemas/OpenAIUserPrompt'
          - type: 'null'
        vertex_llama:
          anyOf:
          - $ref: '#/components/schemas/OpenAIUserPrompt'
          - type: 'null'
        deepseek:
          anyOf:
          - $ref: '#/components/schemas/DeepSeekUserPrompt'
          - type: 'null'
      type: object
      title: UserPrompts
    learning_protos__config_p2p__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\nFor example Snowflake's Arctic-embed requires\
        \ a specific prefix to work correctly.\nIn that case, the query prompt will\
        \ be \n```\npassage_prompt: \"\"\nquery_prompt: \"Represent this sentence\
        \ for searching relevant passages: {}\"\n````\nwhere {} will be replaced by\
        \ the actual sentence.\n`passage_prompt` is empty because the model does not\
        \ require alterations to the sentence to embed is as a passage.\n    "
    workers_api__models__HFEmbeddingKey:
      properties:
        url:
          type: string
          title: Url
        key:
          type: string
          title: Key
        matryoshka:
          items:
            type: integer
          type: array
          title: Matryoshka
          default: []
        similarity:
          type: string
          title: Similarity
        size:
          type: integer
          title: Size
        threshold:
          type: number
          title: Threshold
        passage_prompt:
          type: string
          title: Passage Prompt
        query_prompt:
          type: string
          title: Query Prompt
      type: object
      required:
      - url
      - key
      - similarity
      - size
      - threshold
      - passage_prompt
      - query_prompt
      title: HFEmbeddingKey
    AccountTypes:
      type: string
      enum:
      - stash-trial
      - stash-starter
      - stash-growth
      - stash-startup
      - stash-enterprise
      - stash-developer
      - stash-business
      - v3starter
      - v3fly
      - v3growth
      - v3enterprise
      title: AccountTypes
    AnswerRelevance:
      properties:
        score:
          type: integer
          title: The score of the answer relevance
        reason:
          type: string
          title: The reasoning for the score
      type: object
      required:
      - score
      - reason
      title: AnswerRelevance
    Author:
      type: string
      enum:
      - NUCLIA
      - USER
      title: Author
    ChatModel:
      properties:
        question:
          type: string
          title: Question
        retrieval:
          type: boolean
          title: Retrieval
          default: true
        user_id:
          type: string
          title: User Id
        system:
          anyOf:
          - type: string
          - type: 'null'
          title: System
        chat_history:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Chat History
          default: []
        context:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Context
          default: []
        query_context:
          anyOf:
          - items:
              type: string
            type: array
          - additionalProperties:
              type: string
            type: object
          title: Query Context
          default: {}
        query_context_order:
          additionalProperties:
            type: integer
          type: object
          title: Query Context Order
          default: {}
        truncate:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Truncate
          default: true
        user_prompt:
          anyOf:
          - $ref: '#/components/schemas/UserPrompt'
          - type: 'null'
        citations:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Citations
          default: false
        citation_threshold:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Citation Threshold
          description: If citations is set to True, this will be the similarity threshold.
            Value between 0 and 1, lower values will produce more citations. If not
            set, it will be set to the optimized threshold found by Nuclia.
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative Model
        max_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Tokens
        query_context_images:
          anyOf:
          - items:
              $ref: '#/components/schemas/Image'
            type: array
          - additionalProperties:
              $ref: '#/components/schemas/Image'
            type: object
          title: Query Context Images
          default: {}
        prefer_markdown:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Prefer Markdown
        json_schema:
          anyOf:
          - type: object
          - type: 'null'
          title: Json Schema
        format_prompt:
          type: boolean
          title: Format Prompt
          default: true
        rerank_context:
          type: boolean
          title: Rerank Context
          description: Whether to reorder the query context based on a reranker. This
            option will also make it so the first response will contain the scores
            given for each context piece.
          default: false
      type: object
      required:
      - question
      - user_id
      title: ChatModel
    Image:
      properties:
        content_type:
          type: string
          title: Content Type
        b64encoded:
          type: string
          title: B64Encoded
      type: object
      required:
      - content_type
      - b64encoded
      title: Image
    Message:
      properties:
        author:
          $ref: '#/components/schemas/Author'
        text:
          type: string
          title: Text
      type: object
      required:
      - author
      - text
      title: Message
    Ner:
      properties:
        text:
          type: string
          title: Text
        ner:
          type: string
          title: Ner
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
      type: object
      required:
      - text
      - ner
      - start
      - end
      title: Ner
    QueryInfo:
      properties:
        language:
          type: string
          title: Language
        stop_words:
          items:
            type: string
          type: array
          title: Stop Words
        semantic_threshold:
          type: number
          title: Semantic Threshold
          deprecated: true
        semantic_thresholds:
          additionalProperties:
            type: number
          type: object
          title: Semantic Thresholds
          description: Semantic threshold for each semantic model
        visual_llm:
          type: boolean
          title: Visual Llm
        max_context:
          type: integer
          title: Max Context
        entities:
          anyOf:
          - $ref: '#/components/schemas/TokenSearch'
          - type: 'null'
        sentence:
          anyOf:
          - $ref: '#/components/schemas/SentenceSearch'
          - type: 'null'
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        rephrased_query:
          anyOf:
          - type: string
          - type: 'null'
          title: Rephrased Query
          default: ''
      type: object
      required:
      - language
      - stop_words
      - semantic_threshold
      - semantic_thresholds
      - visual_llm
      - max_context
      - entities
      - sentence
      - query
      title: QueryInfo
    RemiRequest:
      properties:
        user_id:
          type: string
          title: The user ID of the user making the request
        question:
          anyOf:
          - type: string
          - type: 'null'
          title: The question or query that the user asked
        answer:
          anyOf:
          - type: string
          - type: 'null'
          title: The answer that the model provided
        contexts:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: The contexts that the model used to generate the answer
      type: object
      required:
      - user_id
      title: RemiRequest
      description: 'Model to represent a request for the REMi model


        Metrics will be computed accordingly to the inputs given


        - Answer relevance will be computed if `answer` and `question` are provided

        - Context relevance will be computed if `question` and `contexts` are provided

        - Groundedness will be computed if `answer` and `contexts` are provided'
    RemiResponse:
      properties:
        time:
          type: number
          title: The time taken to compute the response
        answer_relevance:
          anyOf:
          - $ref: '#/components/schemas/AnswerRelevance'
          - type: 'null'
          title: The relevance score of the answer to the question.
          description: Answer Relevance measures the relevance of the generated answer
            to the user query,             in a scale of 0 to 5.
        context_relevance:
          anyOf:
          - items:
              anyOf:
              - type: integer
              - type: 'null'
            type: array
          - type: 'null'
          title: The relevance score of each context to the question.
          description: Context Relevance measures the relevance of the retrieved context
            to the user query,         in a scale of 0 to 5. The score will be None
            if there was an error computing the score for a specific         context.
        groundedness:
          anyOf:
          - items:
              anyOf:
              - type: integer
              - type: 'null'
            type: array
          - type: 'null'
          title: The groundedness score of the answer on each context.
          description: Groundedness measures the degree to which the generated answer
            is grounded in the         retrieved context, in a scale of 0 to 5.         The
            score will be None if there was an error computing the score for a specific
            context.
      type: object
      required:
      - time
      title: RemiResponse
    RephraseModel:
      properties:
        question:
          type: string
          title: Question
        chat_history:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Chat History
        context:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Context
        user_context:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: User Context
        user_id:
          type: string
          title: User Id
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative Model
        prompt:
          anyOf:
          - type: string
          - type: 'null'
          title: Prompt
          description: Prompt to send the model to rephrase the sentence, if not provided,
            the default prompt will be used. It must include the {question} placeholder.
            The placeholder will be replaced with the original question. It will only
            be used if no user_context is provided.
          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 commas.

            QUESTION: {question}

            Please return ONLY the question without any explanation.'
          - 'Keeping the following context in mind,

            <context>

            {context}

            </context>

            Rephrase my question taking into account our previous conversation to
            transform it into standalone question that is suited for retrieval.

            QUESTION: "{question}"

            Return only the rephrased question without any explanation or formatting.'
      type: object
      required:
      - question
      - user_id
      title: RephraseModel
    RerankModel:
      properties:
        question:
          type: string
          title: Question
        user_id:
          type: string
          title: User Id
        context:
          additionalProperties:
            type: string
          type: object
          title: Context
          default: {}
      type: object
      required:
      - question
      - user_id
      title: RerankModel
    RerankResponse:
      properties:
        context_scores:
          additionalProperties:
            type: number
          type: object
          title: Context Scores
          description: Scores for each context given by the reranker
      type: object
      required:
      - context_scores
      title: RerankResponse
    SentenceSearch:
      properties:
        data:
          items:
            type: number
          type: array
          title: Data
          deprecated: true
        vectors:
          additionalProperties:
            items:
              type: number
            type: array
          type: object
          title: Vectors
          description: Sentence vectors for each semantic model
        time:
          type: number
          title: Time
          deprecated: true
        timings:
          additionalProperties:
            type: number
          type: object
          title: Timings
          description: Time taken to compute the sentence vector for each semantic
            model
      type: object
      required:
      - vectors
      - time
      - timings
      title: SentenceSearch
    SummarizeModel:
      properties:
        resources:
          additionalProperties:
            $ref: '#/components/schemas/SummarizeResource'
          type: object
          title: Resources
        summary_kind:
          $ref: '#/components/schemas/SummaryKind'
          default: simple
        user_prompt:
          anyOf:
          - type: string
          - type: 'null'
          title: User Prompt
          default: ''
        generative_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Generative Model
      type: object
      required:
      - resources
      title: SummarizeModel
    SummarizeResource:
      properties:
        fields:
          additionalProperties:
            type: string
          type: object
          title: Fields
      type: object
      required:
      - fields
      title: SummarizeResource
    SummaryKind:
      type: string
      enum:
      - simple
      - extended
      title: SummaryKind
    TokenSearch:
      properties:
        tokens:
          items:
            $ref: '#/components/schemas/Ner'
          type: array
          title: Tokens
          default: []
        time:
          type: number
          title: Time
        input_tokens:
          type: integer
          title: Input Tokens
          default: 0
      type: object
      required:
      - time
      title: TokenSearch
    UserPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
      type: object
      required:
      - prompt
      title: UserPrompt
    AITables-Input:
      properties:
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig-Input'
          - type: 'null'
        rules:
          items:
            type: string
          type: array
          title: Rules
        merge_pages:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Merge Pages
          default: false
        max_pages_to_merge:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Pages To Merge
          default: 0
      type: object
      title: AITables
    AITables-Output:
      properties:
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig-Output'
          - type: 'null'
        rules:
          items:
            type: string
          type: array
          title: Rules
        merge_pages:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Merge Pages
          default: false
        max_pages_to_merge:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Pages To Merge
          default: 0
      type: object
      title: AITables
    AnonymizationModel:
      type: string
      enum:
      - disabled
      - multilingual
      title: AnonymizationModel
    ConfigSchema:
      properties:
        semantic_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
          deprecated: true
        semantic_models:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        default_semantic_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        anonymization_model:
          $ref: '#/components/schemas/ConfigSchemaOptions'
        visual_labeling:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        generative_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        ner_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        relation_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        summary_model:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        summary:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaOptions'
          - type: 'null'
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaElements'
          - type: 'null'
        user_prompts:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaElements'
          - type: 'null'
        summary_prompt:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaElements'
          - type: 'null'
        prefer_markdown_generative_response:
          anyOf:
          - $ref: '#/components/schemas/ConfigSchemaElements'
          - type: 'null'
      type: object
      required:
      - anonymization_model
      title: ConfigSchema
    ConfigSchemaElements:
      properties:
        schemas:
          type: object
          title: Schemas
        create:
          type: boolean
          title: Create
          default: false
        update:
          type: boolean
          title: Update
          default: false
      type: object
      required:
      - schemas
      title: ConfigSchemaElements
    ConfigSchemaOptions:
      properties:
        options:
          anyOf:
          - items:
              $ref: '#/components/schemas/GenerativeOption'
            type: array
          - items:
              $ref: '#/components/schemas/Option'
            type: array
          title: Options
        default:
          anyOf:
          - type: string
          - type: 'null'
          title: Default
        create:
          type: boolean
          title: Create
          default: false
        update:
          type: boolean
          title: Update
          default: false
        multiple:
          type: boolean
          title: Multiple
          default: false
      type: object
      required:
      - options
      title: ConfigSchemaOptions
    ExtractConfig-Input:
      properties:
        name:
          type: string
          title: Name
          default: ''
        vllm_config:
          anyOf:
          - $ref: '#/components/schemas/VLLMExtractionConfig-Input'
          - type: 'null'
        ai_tables:
          anyOf:
          - $ref: '#/components/schemas/AITables-Input'
          - 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
    ExtractConfig-Output:
      properties:
        name:
          type: string
          title: Name
          default: ''
        vllm_config:
          anyOf:
          - $ref: '#/components/schemas/VLLMExtractionConfig-Output'
          - type: 'null'
        ai_tables:
          anyOf:
          - $ref: '#/components/schemas/AITables-Output'
          - 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
    GenerativeOption:
      properties:
        name:
          type: string
          title: Name
        value:
          type: string
          title: Value
        provider:
          type: string
          title: Provider
        user_prompt:
          anyOf:
          - type: string
          - type: 'null'
          title: User Prompt
        user_key:
          anyOf:
          - type: string
          - type: 'null'
          title: User Key
      type: object
      required:
      - name
      - value
      - provider
      title: GenerativeOption
    HFUserPrompt:
      properties:
        system:
          type: string
          title: System
          examples: []
          info: Input here the behaviour you want the model to have
        prompt:
          type: string
          title: Prompt
          examples: []
          info: "Input here your prompt with the words {context} and {question} in\
            \ brackets where you want those fields to be placed, in case you want\
            \ them in your prompt.\n For this generative model {chat_history} is not\
            \ available to modify in the prompt"
      type: object
      required:
      - system
      - prompt
      title: HFUserPrompt
    LearningConfiguration:
      properties:
        resource_labelers_models:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Resource Labelers Models
        paragraph_labelers_models:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Paragraph Labelers Models
        intent_models:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Intent Models
        visual_labeling:
          anyOf:
          - type: string
          - type: 'null'
          title: Visual Labeling
          default: disabled
        ner_model:
          type: string
          title: Ner Model
          default: multilingual
        relation_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Relation Model
          default: base
        anonymization_model:
          type: string
          title: Anonymization Model
          default: disabled
        semantic_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Semantic Model
          deprecated: true
        semantic_models:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Semantic Models
        default_semantic_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Default Semantic Model
        semantic_vector_similarity:
          anyOf:
          - type: string
          - type: 'null'
          title: Semantic Vector Similarity
          default: DOT
          deprecated: true
        semantic_vector_size:
          anyOf:
          - type: integer
          - type: 'null'
          title: Semantic Vector Size
          default: 1024
          deprecated: true
        semantic_matryoshka_dims:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Semantic Matryoshka Dims
          default: []
          deprecated: true
        semantic_threshold:
          anyOf:
          - type: number
          - type: 'null'
          title: Semantic Threshold
          default: 0.4
          deprecated: true
        generative_model:
          type: string
          title: Generative Model
          default: chatgpt-azure-4o
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__UserLearningKeys'
          - type: 'null'
        user_prompts:
          anyOf:
          - $ref: '#/components/schemas/UserPrompts'
          - type: 'null'
        summary:
          $ref: '#/components/schemas/Summary'
          default: simple
        summary_model:
          type: string
          title: Summary Model
          default: claude-3-fast
        summary_prompt:
          anyOf:
          - $ref: '#/components/schemas/SummaryPrompt'
          - type: 'null'
        prefer_markdown_generative_response:
          type: boolean
          title: Prefer Markdown Generative Response
          default: false
        semantic_model_configs:
          additionalProperties:
            $ref: '#/components/schemas/SemanticConfig'
          type: object
          title: Semantic Model Configs
          default: {}
      type: object
      title: LearningConfiguration
      description: 'This model is to add the fields that are computed dynamically
        and not stored in the db, it also serves as a bridge

        between the stored config and what we want to send through the APIs'
    LearningConfigurationCreation:
      properties:
        anonymization_model:
          anyOf:
          - $ref: '#/components/schemas/AnonymizationModel'
          - type: string
          title: Anonymization Model
          default: disabled
        visual_labeling:
          anyOf:
          - $ref: '#/components/schemas/VisualLabeling'
          - type: string
          title: Visual Labeling
          default: disabled
        generative_model:
          type: string
          title: Generative Model
          default: chatgpt-azure-4o
        ner_model:
          anyOf:
          - $ref: '#/components/schemas/NERModel'
          - type: string
          title: Ner Model
          default: multilingual
        relation_model:
          anyOf:
          - $ref: '#/components/schemas/RelationModel'
          - type: string
          title: Relation Model
          default: base
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__UserLearningKeys'
          - type: 'null'
        user_prompts:
          anyOf:
          - $ref: '#/components/schemas/UserPrompts'
          - type: 'null'
        summary:
          anyOf:
          - $ref: '#/components/schemas/Summary'
          - type: 'null'
          default: simple
        summary_model:
          type: string
          title: Summary Model
          default: claude-3-fast
        summary_prompt:
          anyOf:
          - $ref: '#/components/schemas/SummaryPrompt'
          - type: 'null'
        prefer_markdown_generative_response:
          type: boolean
          title: Prefer Markdown Generative Response
          default: false
        default_semantic_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Default Semantic Model
          description: The default vector set / semantic model to use. Must be one
            of the models defined in the `semantic_models` field. If not provided,
            the first model in the list will be used.
        semantic_model:
          anyOf:
          - $ref: '#/components/schemas/SemanticModel'
          - type: 'null'
          deprecated: true
        semantic_models:
          anyOf:
          - items:
              $ref: '#/components/schemas/SemanticModel'
            type: array
          - type: 'null'
          title: Semantic Models
      type: object
      title: LearningConfigurationCreation
    LearningConfigurationUpdate:
      properties:
        anonymization_model:
          anyOf:
          - $ref: '#/components/schemas/AnonymizationModel'
          - type: string
          title: Anonymization Model
          default: disabled
        visual_labeling:
          anyOf:
          - $ref: '#/components/schemas/VisualLabeling'
          - type: string
          title: Visual Labeling
          default: disabled
        generative_model:
          type: string
          title: Generative Model
          default: chatgpt-azure-4o
        ner_model:
          anyOf:
          - $ref: '#/components/schemas/NERModel'
          - type: string
          title: Ner Model
          default: multilingual
        relation_model:
          anyOf:
          - $ref: '#/components/schemas/RelationModel'
          - type: string
          title: Relation Model
          default: base
        user_keys:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__UserLearningKeys'
          - type: 'null'
        user_prompts:
          anyOf:
          - $ref: '#/components/schemas/UserPrompts'
          - type: 'null'
        summary:
          anyOf:
          - $ref: '#/components/schemas/Summary'
          - type: 'null'
          default: simple
        summary_model:
          type: string
          title: Summary Model
          default: claude-3-fast
        summary_prompt:
          anyOf:
          - $ref: '#/components/schemas/SummaryPrompt'
          - type: 'null'
        prefer_markdown_generative_response:
          type: boolean
          title: Prefer Markdown Generative Response
          default: false
        default_semantic_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Default Semantic Model
          description: The default vector set / semantic model to use. Must be one
            of the models defined in the `semantic_models` field. If not provided,
            the first model in the list will be used.
      additionalProperties: false
      type: object
      title: LearningConfigurationUpdate
    ModelID:
      properties:
        id:
          type: string
          title: Id
      type: object
      required:
      - id
      title: ModelID
    NERModel:
      type: string
      enum:
      - multilingual
      const: multilingual
      title: NERModel
    Option:
      properties:
        name:
          type: string
          title: Name
        value:
          type: string
          title: Value
      type: object
      required:
      - name
      - value
      title: Option
    RelationModel:
      type: string
      enum:
      - base
      const: base
      title: RelationModel
    SemanticConfig:
      properties:
        similarity:
          $ref: '#/components/schemas/SimilarityFunction'
        size:
          type: integer
          title: Size
        threshold:
          type: number
          title: Threshold
        max_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Tokens
        matryoshka_dims:
          items:
            type: integer
          type: array
          title: Matryoshka Dims
          default: []
        external:
          type: boolean
          title: External
          default: false
      type: object
      required:
      - similarity
      - size
      - threshold
      title: SemanticConfig
    SemanticModel:
      type: string
      enum:
      - en-2024-04-24
      - multilingual-2024-05-06
      - multilingual-2023-08-16
      - multilingual-2024-10-07
      - text-embedding-3-small
      - text-embedding-3-large
      - gecko-embeddings-multi
      - hf_embedding
      title: SemanticModel
    SimilarityFunction:
      type: integer
      enum:
      - 0
      - 1
      title: SimilarityFunction
    SplitConfig:
      properties:
        max_paragraph:
          type: integer
          title: Max Paragraph
          default: 0
      type: object
      title: SplitConfig
    Summary:
      type: string
      enum:
      - extended
      - simple
      title: Summary
    SummaryPrompt:
      properties:
        prompt:
          type: string
          title: Prompt
          examples:
          - 'Make a bullet point summary of the following content: {text}'
          - 'Make a thorough summary of the following news article: {text}'
          info: Input here your prompt with the word {text} in brackets where you
            want the content to summarize to be placed
      type: object
      required:
      - prompt
      title: SummaryPrompt
    VLLMExtractionConfig-Input:
      properties:
        rules:
          items:
            type: string
          type: array
          title: Rules
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig-Input'
          - type: 'null'
      type: object
      title: VLLMExtractionConfig
    VLLMExtractionConfig-Output:
      properties:
        rules:
          items:
            type: string
          type: array
          title: Rules
        llm:
          anyOf:
          - $ref: '#/components/schemas/LLMConfig-Output'
          - type: 'null'
      type: object
      title: VLLMExtractionConfig
    VisualLabeling:
      type: string
      enum:
      - disabled
      - enabled
      title: VisualLabeling
    learning_config__models__AnthropicKey:
      properties:
        key:
          type: string
          title: Key
      type: object
      required:
      - key
      title: AnthropicKey
    learning_config__models__AzureOpenAIKey:
      properties:
        key:
          type: string
          title: Key
        url:
          type: string
          title: Url
        deployment:
          type: string
          title: Deployment
        model:
          type: string
          title: Model
      type: object
      required:
      - key
      - url
      - deployment
      - model
      title: AzureOpenAIKey
    learning_config__models__HFEmbeddingKey:
      properties:
        url:
          type: string
          title: Huggingface Endpoint URL
          description: URL of the Huggingface embedding model endpoint
        key:
          type: string
          title: Huggingface API Key
          description: API Key with access the desired Huggingface endpoint
        matryoshka:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Matryoshka Dimensions
          description: List of matryoshka dimensions to use for the embedding, in
            descending order. If unknown, leave it empty
          examples:
          - - 768
            - 512
            - 256
        similarity:
          type: string
          title: Similarity Function
          description: Similarity function to use. It can be DOT or COSINE, leave
            it as DOT if unknown
          default: DOT
          examples:
          - DOT
          - COSINE
        size:
          type: integer
          title: Embedding Vector Size
          description: Size of the embeddings generated by the model. Must be set
            to the correct value for the specific model hosted in the endpoint
        threshold:
          type: number
          title: Semantic Threshold
          description: Threshold to use for semantic similarity
          default: 0.4
        passage_prompt:
          type: string
          title: Passage Prompt
          description: Prompt to use for passage embedding, only set this value if
            your embedding model requires it
          default: '{}'
          examples:
          - 'Passage: {}'
        query_prompt:
          type: string
          title: Query Prompt
          description: Prompt to use for query embedding, only set this value if your
            embedding model requires it
          default: '{}'
          examples:
          - 'Represent this sentence for searching relevant passages: {}'
      type: object
      required:
      - url
      - key
      - size
      title: HFEmbeddingKey
    learning_config__models__HFLLMKey:
      properties:
        url:
          type: string
          title: Url
        key:
          type: string
          title: Key
      type: object
      required:
      - url
      - key
      title: HFLLMKey
    learning_config__models__MistralKey:
      properties:
        key:
          type: string
          title: Key
      type: object
      required:
      - key
      title: MistralKey
    learning_config__models__OpenAIKey:
      properties:
        key:
          type: string
          title: Key
        org:
          type: string
          title: Org
      type: object
      required:
      - key
      - org
      title: OpenAIKey
    learning_config__models__PalmKey:
      properties:
        credentials:
          type: string
          title: Credentials
          widget: textarea
        location:
          type: string
          title: Location
      type: object
      required:
      - credentials
      - location
      title: PalmKey
    learning_config__models__UserLearningKeys:
      properties:
        openai:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__OpenAIKey'
          - type: 'null'
        azure_openai:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__AzureOpenAIKey'
          - type: 'null'
        mistral:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__MistralKey'
          - type: 'null'
        palm:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__PalmKey'
          - type: 'null'
        anthropic:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__AnthropicKey'
          - type: 'null'
        claude3:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__AnthropicKey'
          - type: 'null'
        azure_mistral:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__MistralKey'
          - type: 'null'
        hf_llm:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__HFLLMKey'
          - type: 'null'
        hf_embedding:
          anyOf:
          - $ref: '#/components/schemas/learning_config__models__HFEmbeddingKey'
          - type: 'null'
        azure_aii:
          anyOf:
          - $ref: '#/components/schemas/AzureAIIKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
    learning_protos__config_p2p__AnthropicKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: AnthropicKey
    learning_protos__config_p2p__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
    learning_protos__config_p2p__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
    learning_protos__config_p2p__MistralKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
      type: object
      title: MistralKey
    learning_protos__config_p2p__OpenAIKey:
      properties:
        key:
          type: string
          title: Key
          default: ''
        org:
          type: string
          title: Org
          default: ''
      type: object
      title: OpenAIKey
    learning_protos__config_p2p__PalmKey:
      properties:
        credentials:
          type: string
          title: Credentials
        location:
          type: string
          title: Location
          default: ''
      type: object
      required:
      - credentials
      title: PalmKey
    learning_protos__config_p2p__UserLearningKeys-Input:
      properties:
        openai:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__OpenAIKey'
          - type: 'null'
        azure_openai:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AzureOpenAIKey'
          - type: 'null'
        palm:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__PalmKey'
          - type: 'null'
        anthropic:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AnthropicKey'
          - type: 'null'
        claude3:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AnthropicKey'
          - type: 'null'
        text_generation:
          anyOf:
          - $ref: '#/components/schemas/TextGenerationKey'
          - type: 'null'
        mistral:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__MistralKey'
          - type: 'null'
        azure_mistral:
          anyOf:
          - $ref: '#/components/schemas/AzureMistralKey'
          - type: 'null'
        hf_llm:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__HFLLMKey'
          - type: 'null'
        hf_embedding:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__HFEmbeddingKey'
          - type: 'null'
        azure_aii:
          anyOf:
          - $ref: '#/components/schemas/AzureAIIKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
    learning_protos__config_p2p__UserLearningKeys-Output:
      properties:
        openai:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__OpenAIKey'
          - type: 'null'
        azure_openai:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AzureOpenAIKey'
          - type: 'null'
        palm:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__PalmKey'
          - type: 'null'
        anthropic:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AnthropicKey'
          - type: 'null'
        claude3:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__AnthropicKey'
          - type: 'null'
        text_generation:
          anyOf:
          - $ref: '#/components/schemas/TextGenerationKey'
          - type: 'null'
        mistral:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__MistralKey'
          - type: 'null'
        azure_mistral:
          anyOf:
          - $ref: '#/components/schemas/AzureMistralKey'
          - type: 'null'
        hf_llm:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__HFLLMKey'
          - type: 'null'
        hf_embedding:
          anyOf:
          - $ref: '#/components/schemas/learning_protos__config_p2p__HFEmbeddingKey'
          - type: 'null'
        azure_aii:
          anyOf:
          - $ref: '#/components/schemas/AzureAIIKey'
          - type: 'null'
      type: object
      title: UserLearningKeys
