Biolevate Question Answering API

Question Answering resource management

OpenAPI Specification

biolevate-question-answering-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Biolevate Agent Question Answering API
  version: 1.0.0
  description: Conversational agent jobs
servers:
- url: /
  description: Biolevate Server
security:
- TOKEN: []
tags:
- name: Question Answering
  description: Question Answering resource management
paths:
  /api/core/qa/jobs:
    get:
      tags:
      - Question Answering
      summary: List QA jobs
      description: Returns a paginated list of question answering jobs for the current user
      operationId: listQAJobs
      parameters:
      - name: pageSize
        in: query
        description: Page size
        required: true
        schema:
          type: integer
          format: int32
      - name: page
        in: query
        description: Page number
        required: true
        schema:
          type: integer
          format: int32
      - name: sortProperty
        in: query
        description: Sort property
        required: false
        schema:
          type: string
      - name: sortOrder
        in: query
        description: Sort order
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successfully retrieved jobs
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PageDataJob'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PageDataJob'
    post:
      tags:
      - Question Answering
      summary: Create QA job
      description: Creates a new question answering job on the specified files
      operationId: createQAJob
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQARequest'
        required: true
      responses:
        '403':
          description: Access denied
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '200':
          description: Job created successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '400':
          description: Invalid request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
  /api/core/qa/jobs/{jobId}:
    get:
      tags:
      - Question Answering
      summary: Get QA job
      description: Returns a single question answering job by its ID
      operationId: getQAJob
      parameters:
      - name: jobId
        in: path
        description: The job Id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successfully retrieved job
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '403':
          description: Access denied - not the job owner
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          description: Job not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Job'
  /api/core/qa/jobs/{jobId}/results:
    get:
      tags:
      - Question Answering
      summary: Get QA job outputs
      description: Returns the answers and results from the QA job
      operationId: getQAJobOutputs
      parameters:
      - name: jobId
        in: path
        description: The job Id
        required: true
        schema:
          type: string
      responses:
        '403':
          description: Access denied - not the job owner
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobOutputs'
        '200':
          description: Successfully retrieved outputs
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobOutputs'
        '404':
          description: Job not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobOutputs'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobOutputs'
  /api/core/qa/jobs/{jobId}/inputs:
    get:
      tags:
      - Question Answering
      summary: Get QA job inputs
      description: Returns the input files and questions used for the QA job
      operationId: getQAJobInputs
      parameters:
      - name: jobId
        in: path
        description: The job Id
        required: true
        schema:
          type: string
      responses:
        '403':
          description: Access denied - not the job owner
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobInputs'
        '200':
          description: Successfully retrieved inputs
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobInputs'
        '404':
          description: Job not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobInputs'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QAJobInputs'
  /api/core/qa/jobs/{jobId}/annotations:
    get:
      tags:
      - Question Answering
      summary: Get QA job annotations
      description: Returns the document annotations generated by the QA job
      operationId: getQAJobAnnotations
      parameters:
      - name: jobId
        in: path
        description: The job Id
        required: true
        schema:
          type: string
      responses:
        '403':
          description: Access denied - not the job owner
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EliseAnnotation'
        '200':
          description: Successfully retrieved annotations
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EliseAnnotation'
        '404':
          description: Job not found
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EliseAnnotation'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EliseAnnotation'
components:
  schemas:
    EntityId:
      type: object
      properties:
        id:
          type: string
          format: uuid
        entityType:
          type: string
          enum:
          - POLICY
          - PROJECT
          - COLLECTION
          - PROVIDER
          - FILE
          - PROCESSOR
          - JOB
          - PRESET
          - EDITABLE_DOCUMENT
          - REVIEW
          - COLLECTION_DERIVATION
          - REVIEW_REQUEST
          - MILESTONE
          - INSIGHT
          - CONCEPT_NOTE
          - ANNOTATION
          - BIBLIO_SEARCH
          - SEARCH_DOWNLOAD
          - INSIGHT_CELL_FILTER
          - INSIGHT_CELL_SORTING
          - INSIGHT_CELL_FORMAT
          - INSIGHT_GROUP
          - INSIGHTS_TABLE_CONFIG
          - INSIGHTS_TABLE_TEMPLATE
          - SEARCH_REMOVAL
          - COMMENT_THREAD
          - COMMENT
          - SMART_REVIEW
          - RIS_IMPORT_JOB
          - FORGE_WORKFLOW
          - COLLECTION_VIEW
          - SUB_COLLECTION_JOB
          - PROJECT_LABEL
          - PROJECT_GROUP
    CreateQARequest:
      type: object
      properties:
        files:
          $ref: '#/components/schemas/FilesInput'
        questions:
          type: array
          items:
            $ref: '#/components/schemas/EliseQuestionInput'
        config:
          $ref: '#/components/schemas/JobLaunchConfig'
    Job:
      type: object
      properties:
        jobId:
          type: string
        status:
          type: string
          enum:
          - SUCCESS
          - FAILED
          - ABORTED
          - RUNNING
          - PENDING
        taskType:
          type: string
        createdTime:
          type: integer
          format: int64
        executionTime:
          type: number
          format: double
        errorMessage:
          type: string
        name:
          type: string
        archived:
          type: boolean
    QAJobOutputs:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/EliseQAResult'
    JobLaunchConfig:
      type: object
      description: Optional job launch behaviour for input files
      properties:
        skip_unindexed_files:
          type: boolean
          description: 'When false or omitted, the request is rejected if any input file is not indexed. When true, unindexed files are excluded and the job runs on indexed files only.

            '
          example: false
    EliseAnnotation:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AnnotationId'
        createdTime:
          type: integer
          format: int64
        owner:
          $ref: '#/components/schemas/UserId'
        space:
          $ref: '#/components/schemas/EntityId'
        data:
          $ref: '#/components/schemas/EliseAnnotationConfig'
        type:
          type: string
          enum:
          - DOCUMENT_STATEMENT
          - WEB_STATEMENT
          - ENTIRE_DOCUMENT_STATEMENT
          - EXTERNAL_DOCUMENT_STATEMENT
          - KNOWLEDGE_STATEMENT
          - REVIEW_STATEMENT
        modifiedTime:
          type: integer
          format: int64
        lastModifier:
          $ref: '#/components/schemas/UserId'
        status:
          type: string
          enum:
          - VALID
          - NOTVALID
    UserId:
      type: object
      properties:
        id:
          type: string
    QAJobInputs:
      type: object
      properties:
        files:
          $ref: '#/components/schemas/FilesInput'
        questions:
          type: array
          items:
            $ref: '#/components/schemas/EliseQuestionInput'
    FilesInput:
      type: object
      properties:
        fileIds:
          type: array
          items:
            type: string
        collectionIds:
          type: array
          items:
            type: string
    ExpectedAnswerTypeDto:
      type: object
      properties:
        dataType:
          type: string
          enum:
          - STRING
          - INT
          - FLOAT
          - BOOL
          - DATE
          - ENUM
        multiValued:
          type: boolean
        enumValues:
          type: array
          description: List of possible values for enum types
          items:
            type: string
        enumColors:
          type: object
          additionalProperties:
            type: string
          description: Map of enum values to their associated colors
        enumSuggestionsEnabled:
          type: boolean
        rejectedEnumValues:
          type: array
          items:
            type: string
        dateFormat:
          type: string
          enum:
          - ISO
          - EUR
          - US
        decimalPrecision:
          type: string
          enum:
          - ZERO_DECIMALS
          - ONE_DECIMAL
          - TWO_DECIMALS
          - THREE_DECIMALS
          - FOUR_DECIMALS
          - FIVE_DECIMALS
    EliseAnnotationConfig:
      type: object
      discriminator:
        propertyName: type
        mapping:
          DOCUMENT_STATEMENT: '#/components/schemas/EliseDocumentStatement'
          EXTERNAL_DOCUMENT_STATEMENT: '#/components/schemas/EliseExternalDocumentStatement'
          WEB_STATEMENT: '#/components/schemas/EliseWebStatement'
          KNOWLEDGE_STATEMENT: '#/components/schemas/EliseKnowledgeStatement'
          ENTIRE_DOCUMENT_STATEMENT: '#/components/schemas/EliseFullDocumentStatement'
          REVIEW_STATEMENT: '#/components/schemas/EliseReviewComment'
      properties:
        type:
          type: string
          enum:
          - DOCUMENT_STATEMENT
          - WEB_STATEMENT
          - ENTIRE_DOCUMENT_STATEMENT
          - EXTERNAL_DOCUMENT_STATEMENT
          - KNOWLEDGE_STATEMENT
          - REVIEW_STATEMENT
    AnnotationId:
      type: object
      properties:
        id:
          type: string
          format: uuid
        entityType:
          type: string
          enum:
          - POLICY
          - PROJECT
          - COLLECTION
          - PROVIDER
          - FILE
          - PROCESSOR
          - JOB
          - PRESET
          - EDITABLE_DOCUMENT
          - REVIEW
          - COLLECTION_DERIVATION
          - REVIEW_REQUEST
          - MILESTONE
          - INSIGHT
          - CONCEPT_NOTE
          - ANNOTATION
          - BIBLIO_SEARCH
          - SEARCH_DOWNLOAD
          - INSIGHT_CELL_FILTER
          - INSIGHT_CELL_SORTING
          - INSIGHT_CELL_FORMAT
          - INSIGHT_GROUP
          - INSIGHTS_TABLE_CONFIG
          - INSIGHTS_TABLE_TEMPLATE
          - SEARCH_REMOVAL
          - COMMENT_THREAD
          - COMMENT
          - SMART_REVIEW
          - RIS_IMPORT_JOB
          - FORGE_WORKFLOW
          - COLLECTION_VIEW
          - SUB_COLLECTION_JOB
          - PROJECT_LABEL
          - PROJECT_GROUP
    EliseQAResult:
      type: object
      properties:
        explanation:
          type: string
        sourcedContent:
          type: string
        referenceIds:
          type: array
          items:
            $ref: '#/components/schemas/AnnotationId'
        question:
          type: string
        expectedAnswer:
          type: string
        validityExplaination:
          type: string
        inputQuestionIds:
          type: array
          items:
            type: string
        answerValidity:
          type: number
          format: float
        rawValue:
          type: string
    EliseQuestionInput:
      type: object
      properties:
        id:
          type: string
        question:
          type: string
        answerType:
          $ref: '#/components/schemas/ExpectedAnswerTypeDto'
        guidelines:
          type: string
        expectedAnswer:
          type: string
        inputQuestionIds:
          type: array
          items:
            type: string
    PageDataJob:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Job'
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int64
        hasNext:
          type: boolean
  securitySchemes:
    TOKEN:
      type: http
      scheme: bearer
      bearerFormat: JWT