Skip to content

Commit

Permalink
[Inference API] update path arguments (#2430)
Browse files Browse the repository at this point in the history
* update path arguments for inference API

* prettify json spec files
  • Loading branch information
Anaethelion authored Feb 22, 2024
1 parent 9c437e5 commit d16a19a
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 33 deletions.
16 changes: 13 additions & 3 deletions specification/_json_spec/inference.delete_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@
"url": {
"paths": [
{
"path": "/_inference/{task_type}/{model_id}",
"path": "/_inference/{inference_id}",
"methods": ["DELETE"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
"methods": ["DELETE"],
"parts": {
"task_type": {
"type": "string",
"description": "The model task type"
"description": "The task type"
},
"model_id": {
"inference_id": {
"type": "string",
"description": "The model Id"
}
Expand Down
18 changes: 14 additions & 4 deletions specification/_json_spec/inference.get_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,26 @@
"url": {
"paths": [
{
"path": "/_inference/{task_type}/{model_id}",
"path": "/_inference/{inference_id}",
"methods": ["GET"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
"methods": ["GET"],
"parts": {
"task_type": {
"type": "string",
"description": "The model task type"
"description": "The task type"
},
"model_id": {
"inference_id": {
"type": "string",
"description": "The model Id"
"description": "The inference Id"
}
}
}
Expand Down
21 changes: 16 additions & 5 deletions specification/_json_spec/inference.inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,32 @@
"stability": "experimental",
"visibility": "public",
"headers": {
"accept": ["application/json"]
"accept": ["application/json"],
"content_type": ["application/json"]
},
"url": {
"paths": [
{
"path": "/_inference/{task_type}/{model_id}",
"path": "/_inference/{inference_id}",
"methods": ["POST"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
"methods": ["POST"],
"parts": {
"task_type": {
"type": "string",
"description": "The model task type"
"description": "The task type"
},
"model_id": {
"inference_id": {
"type": "string",
"description": "The model Id"
"description": "The inference Id"
}
}
}
Expand Down
21 changes: 16 additions & 5 deletions specification/_json_spec/inference.put_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,32 @@
"stability": "experimental",
"visibility": "public",
"headers": {
"accept": ["application/json"]
"accept": ["application/json"],
"content_type": ["application/json"]
},
"url": {
"paths": [
{
"path": "/_inference/{task_type}/{model_id}",
"path": "/_inference/{inference_id}",
"methods": ["PUT"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
"methods": ["PUT"],
"parts": {
"task_type": {
"type": "string",
"description": "The model task type"
"description": "The task type"
},
"model_id": {
"inference_id": {
"type": "string",
"description": "The model Id"
"description": "The inference Id"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions specification/inference/delete_model/DeleteModelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import { TaskType } from '@inference/_types/TaskType'
export interface Request extends RequestBase {
path_parts: {
/**
* The model task type
* The task type
*/
task_type: TaskType
task_type?: TaskType
/**
* The unique identifier of the inference model.
* The inference Id
*/
model_id: Id
inference_id: Id
}
}
8 changes: 4 additions & 4 deletions specification/inference/get_model/GetModelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import { TaskType } from '@inference/_types/TaskType'
export interface Request extends RequestBase {
path_parts: {
/**
* The model task type
* The task type
*/
task_type: TaskType
task_type?: TaskType
/**
* The unique identifier of the inference model.
* The inference Id
*/
model_id: Id
inference_id: Id
}
}
8 changes: 4 additions & 4 deletions specification/inference/inference/InferenceRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import { TaskSettings } from '@inference/_types/Services'
export interface Request extends RequestBase {
path_parts: {
/**
* The model task type
* The task type
*/
task_type: TaskType
task_type?: TaskType
/**
* The unique identifier of the inference model.
* The inference Id
*/
model_id: Id
inference_id: Id
}
body: {
/**
Expand Down
8 changes: 4 additions & 4 deletions specification/inference/put_model/PutModelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import { TaskType } from '@inference/_types/TaskType'
export interface Request extends RequestBase {
path_parts: {
/**
* The model task type
* The task type
*/
task_type: TaskType
task_type?: TaskType
/**
* The unique identifier of the inference model.
* The inference Id
*/
model_id: Id
inference_id: Id
}
/** @codegen_name model_config */
body: ModelConfig
Expand Down

0 comments on commit d16a19a

Please sign in to comment.