Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mcobzarenco/5461cb705a77c56f957652e0310e7bee to your computer and use it in GitHub Desktop.
Save mcobzarenco/5461cb705a77c56f957652e0310e7bee to your computer and use it in GitHub Desktop.
Re:infer OpenAPI V2
swagger: '2.0'
info:
title: Re:infer API
description: Re:infer v1 API
contact:
name: Reinfer Ltd.
email: eng@reinfer.io
url: https://reinfer.io
version: 1.0.0
externalDocs:
description: Find out more at developers.reinfer.io
url: https://developers.reinfer.io
host: reinfer.io
basePath: /api
schemes:
- https
consumes:
- application/json
produces:
- application/json
paths:
/v1/sources/{owner}/{source_name}:
put:
operationId: CreateSource
summary: Create a source
description: Create a source
tags:
- sources
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/source_name'
- in: body
name: CreateSourceRequest
schema:
$ref: '#/definitions/CreateSourceRequest'
responses:
'200':
description: Created new resource
schema:
$ref: '#/definitions/CreateSourceResponse'
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
get:
operationId: GetSource
summary: Get a source by project and name
description: Get a source by project and name
tags:
- sources
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/source_name'
responses:
'200':
description: Created new resource
schema:
$ref: '#/definitions/GetSourceResponse'
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
post:
operationId: UpdateSource
summary: Update a source
description: Update a source
tags:
- sources
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/source_name'
- in: body
name: UpdateSourceRequest
schema:
$ref: '#/definitions/UpdateSourceRequest'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
/v1/sources/id:{source_id}:
get:
operationId: GetSourceById
summary: Get a source by id
description: Get a source by id
tags:
- sources
parameters:
- $ref: '#/parameters/source_id'
responses:
'200':
description: Created new resource
schema:
$ref: '#/definitions/GetSourceByIdResponse'
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
delete:
operationId: DeleteSource
summary: Delete a source
description: Delete a source
tags:
- sources
parameters:
- $ref: '#/parameters/source_id'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/sources:
get:
operationId: GetAllSources
summary: Get all sources
description: Get all sources
tags:
- sources
parameters: []
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/sources/{owner}:
get:
operationId: GetAllSourcesInProject
summary: Get all sources in a project
description: Get all sources in a project
tags:
- sources
parameters:
- $ref: '#/parameters/owner'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/datasets/{owner}/{dataset_name}:
put:
operationId: CreateDataset
summary: Create a dataset
description: Create a dataset
tags:
- datasets
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/dataset_name'
- in: body
name: CreateDatasetRequest
schema:
$ref: '#/definitions/CreateDatasetRequest'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
get:
operationId: GetDataset
summary: Get a dataset by project and name
description: Get a dataset by project and name
tags:
- datasets
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/dataset_name'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
post:
operationId: UpdateDataset
summary: Update a dataset
description: Update a dataset
tags:
- datasets
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/dataset_name'
- in: body
name: UpdateDatasetRequest
schema:
$ref: '#/definitions/UpdateDatasetRequest'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
delete:
operationId: DeleteDataset
summary: Delete a dataset
description: Delete a dataset
tags:
- datasets
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/dataset_name'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/datasets:
get:
operationId: GetAllDatasets
summary: Get all datasets
description: Get all datasets
tags:
- datasets
parameters: []
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/datasets/{owner}:
get:
operationId: GetAllDatasetsInProject
summary: Get all datasets in a project
description: Get all datasets in a project
tags:
- datasets
parameters:
- $ref: '#/parameters/owner'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/v1/sources/{owner}/{source_name}/sync:
post:
operationId: SyncComments
summary: Sync a batch of comments
description: Sync a batch of comments
tags:
- comments
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/source_name'
- in: body
name: SyncCommentsRequest
schema:
$ref: '#/definitions/SyncCommentsRequest'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
/v1/sources/{owner}/{source_name}/comments/{comment_id}:
get:
operationId: GetComment
summary: Get a comment by id
description: Get a comment by id
tags:
- comments
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/source_name'
- $ref: '#/parameters/comment_id'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
/_private/datasets/{owner}/{dataset_name}/labellers/predict:
post:
operationId: Predict
summary: Get predictions from the latest model
description: Get predictions from the latest model
tags:
- models
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/dataset_name'
- in: body
name: PredictRequest
schema:
$ref: '#/definitions/PredictRequest'
responses:
'201':
description: Created new resource
'400':
description: Invalid client request
'404':
description: No such resource
produces:
- application/json
consumes:
- application/json
definitions:
CreateSourceRequest:
type: object
additionalProperties: false
required:
- source
properties:
source: &id003
type: object
additionalProperties: false
properties:
language:
type: string
enum:
- en
- de
- xlm
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
should_translate:
type: boolean
sensitive_properties:
type: array
maxItems: 4096
items:
type: string
pattern: .*
bucket_id:
type: string
pattern: .*
CreateSourceResponse:
type: object
additionalProperties: true
required:
- status
properties:
status:
type: string
enum:
- ok
- error
message:
type: string
source: &id001
type: object
additionalProperties: false
properties:
id:
type: string
pattern: .*
language:
type: string
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
should_translate:
type: boolean
sensitive_properties:
type: array
maxItems: 4096
items:
type: string
pattern: .*
bucket_id:
type: string
pattern: .*
GetSourceResponse: &id002
type: object
additionalProperties: true
required:
- status
properties:
status:
type: string
enum:
- ok
- error
message:
type: string
source: *id001
GetSourceByIdResponse: *id002
UpdateSourceRequest:
type: object
additionalProperties: false
required:
- source
properties:
source: *id003
CreateDatasetRequest:
type: object
additionalProperties: false
required:
- dataset
properties:
dataset:
type: object
additionalProperties: false
properties:
model_family:
type: string
enum:
- english
- english-dev
- random
- german
- german-dev
- transformer-english
- transformer-xlm
has_sentiment:
type: boolean
copy_annotations_from:
type: string
pattern: .*
title: &id004
type: string
maxLength: 128
description: &id005
type: string
maxLength: 16384
source_ids: &id006
type: array
maxItems: 1024
items:
type: string
pattern: .*
entity_kinds: &id007
type: array
maxItems: 1024
items:
type: string
maxLength: 256
uniqueItems: true
entity_defs:
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
name: &id008
type: string
pattern: .*
title: &id009
type: string
maxLength: 64
inherits_from: &id010
type: array
maxItems: 1
minItems: 0
items: {}
uniqueItems: true
trainable: &id011
type: boolean
rules: &id012
type: object
additionalProperties: false
properties:
suppressors:
type: array
minItems: 0
maxItems: 128
items:
type: string
maxLength: 128
required:
- name
- title
- inherits_from
- trainable
uniqueItems: true
label_defs: &id013
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
name:
type: string
maxLength: 64
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
external_id:
type: string
maxLength: 128
pretrained:
type: object
additionalProperties: false
properties:
name:
type: string
maxLength: 64
id:
type: string
pattern: .*
required:
- id
required:
- name
uniqueItems: true
UpdateDatasetRequest:
type: object
additionalProperties: false
required:
- dataset
properties:
dataset:
type: object
additionalProperties: false
properties:
title: *id004
description: *id005
source_ids: *id006
entity_kinds: *id007
entity_defs:
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
id:
type: string
pattern: .*
name: *id008
title: *id009
inherits_from: *id010
trainable: *id011
rules: *id012
required:
- name
- title
- inherits_from
- trainable
uniqueItems: true
label_defs: *id013
SyncCommentsRequest:
type: object
additionalProperties: false
required:
- comments
properties:
comments:
type: array
maxItems: 16384
items:
type: object
additionalProperties: false
required:
- id
- timestamp
- messages
properties:
id:
type: string
pattern: .*
timestamp: &id015
type: string
pattern: .*
thread_id:
type: string
pattern: .*
user_properties: &id016
type: object
additionalProperties: false
messages: &id017
type: array
maxItems: 2048
items:
type: object
required:
- body
additionalProperties: false
properties:
from:
type: string
minLength: 1
maxLength: 512
to:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
cc:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
bcc:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
sent_at:
type: string
pattern: .*
language:
type: string
minLength: 1
maxLength: 8
subject: &id014
type: object
required:
- text
additionalProperties: false
properties:
text:
type: string
minLength: 0
maxLength: 65536
translated_from:
type: string
minLength: 0
maxLength: 65536
body: *id014
signature: *id014
PredictRequest:
type: object
required:
- documents
additionalProperties: false
properties:
documents:
type: array
items:
type: object
required:
- messages
additionalProperties: false
properties:
timestamp: *id015
user_properties: *id016
messages: *id017
maxItems: 4096
threshold: {}
labels:
type: array
items:
type: object
required:
- name
additionalProperties: false
properties:
name:
type: array
items:
type: string
minLength: 1
maxLength: 64
pattern: .*
maxItems: 64
threshold:
type: number
minimum: 0
maximum: 1
maxItems: 4096
parameters:
owner:
in: path
name: owner
description: Owner / Project
required: true
type: string
pattern: ^[A-Za-z0-9-_.]{1,1024}$
source_id:
in: path
name: source_id
description: Source ID
required: true
type: string
pattern: ^[0-9a-f]{16}$
source_name:
in: path
name: source_name
description: Source name
required: true
type: string
pattern: ^[A-Za-z0-9-_]{1,256}$
comment_id:
in: path
name: comment_id
description: Comment ID
required: true
type: string
pattern: ^[\w\x21-\x2e\x3a-\x40\x5b-\x60\x7b-\x7e]{1,1024}$
dataset_name:
in: path
name: dataset_name
description: Dataset name
required: true
type: string
pattern: ^[A-Za-z0-9-_]{1,256}$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment