更新时间:2025-05-14 GMT+08:00
apis定义
解释说明
提供模型对外Restfull api数据定义,用于定义模型的输入、输出格式。apis为结构体数据,填写规范请参见模型配置文件编写说明中的apis参数说明。
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
url |
否 |
String |
请求路径。默认值为“/”。自定义镜像的模型需要根据镜像内实际暴露的请求路径填写“url”。非自定义镜像模型,“url”只能为“/”。 |
method |
否 |
String |
请求方法。默认值为“POST”。 |
request |
否 |
Object |
请求体。包含两个参数:
|
response |
否 |
Object |
响应体。包含两个参数:
|
apis参数代码示例如下:
[{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "applicaton/json", "data": { "type": "object", "properties": { "mnist_result": { "type": "array", "item": [ { "type": "string" } ] } } } } }]