openapi: 3.1.0
info:
  title: PaddleOCR
  description: PaddleOCR
  version: 0.2.0-rc3
paths:
  /v1/infer:
    post:
      summary: Post Infer
      operationId: post_infer_v1_infer_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaddleOCRRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaddleOCRResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/health/live:
    get:
      summary: Health Live
      description: Return service liveness status
      operationId: health_live_v1_health_live_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthLiveResponse'
  /v1/health/ready:
    get:
      summary: Health Ready
      description: Return service readiness status
      operationId: health_ready_v1_health_ready_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthReadyResponse'
  /v1/metrics:
    get:
      summary: Metrics
      description: Handler for metrics endpoint.
      operationId: metrics_v1_metrics_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Metrics V1 Metrics Get
  /v1/license:
    get:
      summary: License
      description: Handler for license endpoint.
      operationId: license_v1_license_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseEndpointModel'
  /v1/metadata:
    get:
      summary: Metadata
      description: Handler for metadata endpoint.
      operationId: metadata_v1_metadata_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataEndpointModel'
  /v1/manifest:
    get:
      summary: Manifest
      description: Handler for the manifest endpoint.
      operationId: manifest_v1_manifest_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManifestEndpointModel'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HealthLiveResponse:
      properties:
        live:
          type: boolean
          title: Live
      type: object
      required:
      - live
      title: HealthLiveResponse
    HealthReadyResponse:
      properties:
        ready:
          type: boolean
          title: Ready
      type: object
      required:
      - ready
      title: HealthReadyResponse
    Image:
      properties:
        type:
          type: string
          enum:
          - image_url
          const: image_url
          title: Type
          default: image_url
        image_url:
          $ref: '#/components/schemas/ImageUrl'
      type: object
      required:
      - image_url
      title: Image
    ImageUrl:
      properties:
        url:
          type: string
          title: Url
          description: The URL of the image to be processed.
      type: object
      required:
      - url
      title: ImageUrl
    LicenseEndpointModel:
      properties:
        name:
          type: string
          title: Name
          description: The name of the license for the NIM container.
        path:
          type: string
          title: Path
          description: The filepath within the container containing the license content.
        sha:
          type: string
          title: Sha
          description: A SHA1 hash of the license contents.
        size:
          type: integer
          title: Size
          description: The number of characters in the license content.
        url:
          type: string
          title: Url
          description: The url where this license is hosted externally.
        type:
          type: string
          enum:
          - file
          const: file
          title: Type
          description: The format of the license content.
        content:
          type: string
          title: Content
          description: The license text.
      type: object
      required:
      - name
      - path
      - sha
      - size
      - url
      - type
      - content
      title: LicenseEndpointModel
      description: A model representing the license response.
    ManifestEndpointModel:
      properties:
        manifest_file:
          type: string
          title: Manifest File
          description: The content of the manifest file describing the required model
            artifacts.
      type: object
      required:
      - manifest_file
      title: ManifestEndpointModel
      description: A model representing the manifest response.
    Message:
      properties:
        role:
          anyOf:
          - type: string
          - type: 'null'
          title: Role
          default: ''
        content:
          items:
            $ref: '#/components/schemas/Image'
          type: array
          minItems: 1
          title: Content
      type: object
      required:
      - content
      title: Message
    MetadataEndpointModel:
      properties:
        assetInfo:
          items:
            type: string
          type: array
          title: Assetinfo
          description: A list of required container assets excluding model artifacts
        licenseInfo:
          $ref: '#/components/schemas/LicenseEndpointModel'
          description: The license info.
        modelInfo:
          items:
            $ref: '#/components/schemas/ModelInfo'
          type: array
          title: Modelinfo
          description: A list of models being served by the NIM.
        version:
          type: string
          title: Version
          description: The version of the NIM service.
      type: object
      required:
      - assetInfo
      - licenseInfo
      - modelInfo
      - version
      title: MetadataEndpointModel
      description: A model representing the metadata response.
    ModelInfo:
      properties:
        modelUrl:
          type: string
          title: Modelurl
        shortName:
          type: string
          title: Shortname
      type: object
      required:
      - modelUrl
      - shortName
      title: ModelInfo
      description: A model representing the model response.
    PaddleOCRRequest:
      properties:
        model:
          type: string
          enum:
          - baidu/paddleocr
          const: baidu/paddleocr
          title: Model Name
          default: baidu/paddleocr
        messages:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          maxItems: 1
          minItems: 1
          title: Messages
      type: object
      required:
      - messages
      title: PaddleOCRRequest
    PaddleOCRResponse:
      properties:
        object:
          type: string
          enum:
          - list
          const: list
          title: Object
          default: list
        data:
          items:
            $ref: '#/components/schemas/PaddleOCRResponseItem'
          type: array
          title: Data
        model:
          type: string
          title: Model
        usage:
          anyOf:
          - type: object
          - type: 'null'
          title: Usage
      type: object
      required:
      - data
      - model
      title: PaddleOCRResponse
    PaddleOCRResponseItem:
      properties:
        index:
          type: integer
          title: Index
        content:
          type: string
          title: Content
        object:
          type: string
          enum:
          - string
          const: string
          title: Object
          default: string
      type: object
      required:
      - index
      - content
      title: PaddleOCRResponseItem
    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
