Skip to content

Commit d16a19a

Browse files
authored
[Inference API] update path arguments (#2430)
* update path arguments for inference API * prettify json spec files
1 parent 9c437e5 commit d16a19a

File tree

8 files changed

+75
-33
lines changed

8 files changed

+75
-33
lines changed

specification/_json_spec/inference.delete_model.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,24 @@
1212
"url": {
1313
"paths": [
1414
{
15-
"path": "/_inference/{task_type}/{model_id}",
15+
"path": "/_inference/{inference_id}",
16+
"methods": ["DELETE"],
17+
"parts": {
18+
"inference_id": {
19+
"type": "string",
20+
"description": "The inference Id"
21+
}
22+
}
23+
},
24+
{
25+
"path": "/_inference/{task_type}/{inference_id}",
1626
"methods": ["DELETE"],
1727
"parts": {
1828
"task_type": {
1929
"type": "string",
20-
"description": "The model task type"
30+
"description": "The task type"
2131
},
22-
"model_id": {
32+
"inference_id": {
2333
"type": "string",
2434
"description": "The model Id"
2535
}

specification/_json_spec/inference.get_model.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,26 @@
1212
"url": {
1313
"paths": [
1414
{
15-
"path": "/_inference/{task_type}/{model_id}",
15+
"path": "/_inference/{inference_id}",
16+
"methods": ["GET"],
17+
"parts": {
18+
"inference_id": {
19+
"type": "string",
20+
"description": "The inference Id"
21+
}
22+
}
23+
},
24+
{
25+
"path": "/_inference/{task_type}/{inference_id}",
1626
"methods": ["GET"],
1727
"parts": {
1828
"task_type": {
1929
"type": "string",
20-
"description": "The model task type"
30+
"description": "The task type"
2131
},
22-
"model_id": {
32+
"inference_id": {
2333
"type": "string",
24-
"description": "The model Id"
34+
"description": "The inference Id"
2535
}
2636
}
2737
}

specification/_json_spec/inference.inference.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@
77
"stability": "experimental",
88
"visibility": "public",
99
"headers": {
10-
"accept": ["application/json"]
10+
"accept": ["application/json"],
11+
"content_type": ["application/json"]
1112
},
1213
"url": {
1314
"paths": [
1415
{
15-
"path": "/_inference/{task_type}/{model_id}",
16+
"path": "/_inference/{inference_id}",
17+
"methods": ["POST"],
18+
"parts": {
19+
"inference_id": {
20+
"type": "string",
21+
"description": "The inference Id"
22+
}
23+
}
24+
},
25+
{
26+
"path": "/_inference/{task_type}/{inference_id}",
1627
"methods": ["POST"],
1728
"parts": {
1829
"task_type": {
1930
"type": "string",
20-
"description": "The model task type"
31+
"description": "The task type"
2132
},
22-
"model_id": {
33+
"inference_id": {
2334
"type": "string",
24-
"description": "The model Id"
35+
"description": "The inference Id"
2536
}
2637
}
2738
}

specification/_json_spec/inference.put_model.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@
77
"stability": "experimental",
88
"visibility": "public",
99
"headers": {
10-
"accept": ["application/json"]
10+
"accept": ["application/json"],
11+
"content_type": ["application/json"]
1112
},
1213
"url": {
1314
"paths": [
1415
{
15-
"path": "/_inference/{task_type}/{model_id}",
16+
"path": "/_inference/{inference_id}",
17+
"methods": ["PUT"],
18+
"parts": {
19+
"inference_id": {
20+
"type": "string",
21+
"description": "The inference Id"
22+
}
23+
}
24+
},
25+
{
26+
"path": "/_inference/{task_type}/{inference_id}",
1627
"methods": ["PUT"],
1728
"parts": {
1829
"task_type": {
1930
"type": "string",
20-
"description": "The model task type"
31+
"description": "The task type"
2132
},
22-
"model_id": {
33+
"inference_id": {
2334
"type": "string",
24-
"description": "The model Id"
35+
"description": "The inference Id"
2536
}
2637
}
2738
}

specification/inference/delete_model/DeleteModelRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ import { TaskType } from '@inference/_types/TaskType'
3030
export interface Request extends RequestBase {
3131
path_parts: {
3232
/**
33-
* The model task type
33+
* The task type
3434
*/
35-
task_type: TaskType
35+
task_type?: TaskType
3636
/**
37-
* The unique identifier of the inference model.
37+
* The inference Id
3838
*/
39-
model_id: Id
39+
inference_id: Id
4040
}
4141
}

specification/inference/get_model/GetModelRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ import { TaskType } from '@inference/_types/TaskType'
3030
export interface Request extends RequestBase {
3131
path_parts: {
3232
/**
33-
* The model task type
33+
* The task type
3434
*/
35-
task_type: TaskType
35+
task_type?: TaskType
3636
/**
37-
* The unique identifier of the inference model.
37+
* The inference Id
3838
*/
39-
model_id: Id
39+
inference_id: Id
4040
}
4141
}

specification/inference/inference/InferenceRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ import { TaskSettings } from '@inference/_types/Services'
3131
export interface Request extends RequestBase {
3232
path_parts: {
3333
/**
34-
* The model task type
34+
* The task type
3535
*/
36-
task_type: TaskType
36+
task_type?: TaskType
3737
/**
38-
* The unique identifier of the inference model.
38+
* The inference Id
3939
*/
40-
model_id: Id
40+
inference_id: Id
4141
}
4242
body: {
4343
/**

specification/inference/put_model/PutModelRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ import { TaskType } from '@inference/_types/TaskType'
3131
export interface Request extends RequestBase {
3232
path_parts: {
3333
/**
34-
* The model task type
34+
* The task type
3535
*/
36-
task_type: TaskType
36+
task_type?: TaskType
3737
/**
38-
* The unique identifier of the inference model.
38+
* The inference Id
3939
*/
40-
model_id: Id
40+
inference_id: Id
4141
}
4242
/** @codegen_name model_config */
4343
body: ModelConfig

0 commit comments

Comments
 (0)