Skip to content

Commit

Permalink
InitialApiDefinitions: Add initial SDG API to platform
Browse files Browse the repository at this point in the history
Signed-off-by: Gabe Goodhart <[email protected]>
  • Loading branch information
gabe-l-hart committed Jun 6, 2024
1 parent 4a652e0 commit f2a42ea
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 3 deletions.
21 changes: 18 additions & 3 deletions api-definitions/platform.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
openapi: '3.0.2'
info:
title: AI Platform (We need a name for the IL-agnostic platform!)
title: InstructLab Backend Platform
version: '0.1.0'
# TODO
paths: {}

paths:
## Inference #################################################################

## Customization #############################################################

## Data Jobs #################################################################

#########
## SDG ##
#########
/synthetic-data-generations:
$ref: './platform/synthetic-data-generations.yaml#/paths/~1synthetic-data-generations'
/synthetic-data-generations/{job_id}:
$ref: './platform/synthetic-data-generations.yaml#/paths/~1synthetic-data-generations~1{job_id}'
/synthetic-data-generations/tasks:
$ref: './platform/synthetic-data-generations.yaml#/paths/~1synthetic-data-generations~1tasks'
104 changes: 104 additions & 0 deletions api-definitions/platform/synthetic-data-generations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
openapi: '3.0.2'
info:
title: Synthetic Data Generation
version: '0.1.0'

paths:
/synthetic-data-generations:
post:
summary: Initialize a Synthetic Data Generation job
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SDGJobBody'
responses:
"200":
description: A successfully submitted job
content:
application/json:
schema:
$ref: '../common/job-status.yaml#/schemas/JobStatus'
/synthetic-data-generations/{job_id}:
get:
summary: Retrieve the status of a Synthetic Data Generation job
responses:
"200":
description: The status for the job
content:
application/json:
schema:
$ref: '../common/job-status.yaml#/schemas/JobStatus'

delete:
summary: Cancel a running Synthetic Data Generation job
responses:
"200":
description: The status for the job after cancellation
content:
application/json:
schema:
$ref: '../common/job-status.yaml#/schemas/JobStatus'

/synthetic-data-generations/tasks:
get:
summary: List the currently supported SDG tasks
responses:
"200":
description: The set of currently supported SDG tasks
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SDGTaskDefinition'

components:
schemas:
SDGJobBody:
type: object
required: ['output_directory', 'tasks', 'seed_data']
properties:
output_directory:
description: Location to place the output in
$ref: '../common/file-pointer.yaml#/schemas/DirectoryPointer'

tasks:
description: Mapping from task name to task config. The config will be validated against the task's config schema.
type: object
additionalProperties:
type: object
description: Config for the given task. This will be deep-merged over the default values.

seed_data:
description: The file or directory containing the seed data
oneOf:
- $ref: '../common/file-pointer.yaml#/schemas/FilePointer'
- $ref: '../common/file-pointer.yaml#/schemas/DirectoryPointer'

SDGTaskDefinition:
type: object
required: ['name', 'data_json_schema', 'config_json_schema']
properties:
name:
type: string
description: The name of the task
data_json_schema:
type: object
description: The json schema for input data files for this task
# TODO: This doesn't render cleanly for some reason, but the body here
# must be a valid JSON Schema
# $ref: 'https://json-schema.org/draft-04/schema#'
data_example:
type: string
description: Example of an input data file for this task
config_json_schema:
type: object
description: The json schema for the config of this task
# TODO: This doesn't render cleanly for some reason, but the body here
# must be a valid JSON Schema
# $ref: 'https://json-schema.org/draft-04/schema#'
config_defaults:
type: object
description: Default values for all config values

0 comments on commit f2a42ea

Please sign in to comment.