fix(openapi): 补回图片异步响应契约
通过 PR #26 修复 Images 异步 202 OpenAPI 契约回归。
This commit was merged in pull request #26.
This commit is contained in:
@@ -5938,6 +5938,7 @@
|
|||||||
"BearerAuth": []
|
"BearerAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"description": "默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -5957,6 +5958,12 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/httpapi.TaskRequest"
|
"$ref": "#/definitions/httpapi.TaskRequest"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "true 时异步创建任务并返回 202",
|
||||||
|
"name": "X-Async",
|
||||||
|
"in": "header"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -5966,6 +5973,12 @@
|
|||||||
"$ref": "#/definitions/httpapi.CompatibleResponse"
|
"$ref": "#/definitions/httpapi.CompatibleResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"202": {
|
||||||
|
"description": "Accepted",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/httpapi.TaskAcceptedResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
@@ -6000,6 +6013,7 @@
|
|||||||
"BearerAuth": []
|
"BearerAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"description": "默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -6019,6 +6033,12 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/httpapi.TaskRequest"
|
"$ref": "#/definitions/httpapi.TaskRequest"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "true 时异步创建任务并返回 202",
|
||||||
|
"name": "X-Async",
|
||||||
|
"in": "header"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -6028,6 +6048,12 @@
|
|||||||
"$ref": "#/definitions/httpapi.CompatibleResponse"
|
"$ref": "#/definitions/httpapi.CompatibleResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"202": {
|
||||||
|
"description": "Accepted",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/httpapi.TaskAcceptedResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|||||||
@@ -7400,6 +7400,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
description: 默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。
|
||||||
parameters:
|
parameters:
|
||||||
- description: OpenAI Images 请求
|
- description: OpenAI Images 请求
|
||||||
in: body
|
in: body
|
||||||
@@ -7407,6 +7408,10 @@ paths:
|
|||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/httpapi.TaskRequest'
|
$ref: '#/definitions/httpapi.TaskRequest'
|
||||||
|
- description: true 时异步创建任务并返回 202
|
||||||
|
in: header
|
||||||
|
name: X-Async
|
||||||
|
type: boolean
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
@@ -7414,6 +7419,10 @@ paths:
|
|||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/httpapi.CompatibleResponse'
|
$ref: '#/definitions/httpapi.CompatibleResponse'
|
||||||
|
"202":
|
||||||
|
description: Accepted
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/httpapi.TaskAcceptedResponse'
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
@@ -7439,6 +7448,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
description: 默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。
|
||||||
parameters:
|
parameters:
|
||||||
- description: OpenAI Images 请求
|
- description: OpenAI Images 请求
|
||||||
in: body
|
in: body
|
||||||
@@ -7446,6 +7456,10 @@ paths:
|
|||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/httpapi.TaskRequest'
|
$ref: '#/definitions/httpapi.TaskRequest'
|
||||||
|
- description: true 时异步创建任务并返回 202
|
||||||
|
in: header
|
||||||
|
name: X-Async
|
||||||
|
type: boolean
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
@@ -7453,6 +7467,10 @@ paths:
|
|||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/httpapi.CompatibleResponse'
|
$ref: '#/definitions/httpapi.CompatibleResponse'
|
||||||
|
"202":
|
||||||
|
description: Accepted
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/httpapi.TaskAcceptedResponse'
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
|
|||||||
@@ -1267,12 +1267,15 @@ func openAIEmbeddingsDoc() {}
|
|||||||
|
|
||||||
// openAIImagesDoc godoc
|
// openAIImagesDoc godoc
|
||||||
// @Summary 创建或编辑 OpenAI Images
|
// @Summary 创建或编辑 OpenAI Images
|
||||||
|
// @Description 默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。
|
||||||
// @Tags images
|
// @Tags images
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Param input body TaskRequest true "OpenAI Images 请求"
|
// @Param input body TaskRequest true "OpenAI Images 请求"
|
||||||
|
// @Param X-Async header bool false "true 时异步创建任务并返回 202"
|
||||||
// @Success 200 {object} CompatibleResponse
|
// @Success 200 {object} CompatibleResponse
|
||||||
|
// @Success 202 {object} TaskAcceptedResponse
|
||||||
// @Failure 400 {object} OpenAIErrorEnvelope
|
// @Failure 400 {object} OpenAIErrorEnvelope
|
||||||
// @Failure 401 {object} OpenAIErrorEnvelope
|
// @Failure 401 {object} OpenAIErrorEnvelope
|
||||||
// @Failure 429 {object} OpenAIErrorEnvelope
|
// @Failure 429 {object} OpenAIErrorEnvelope
|
||||||
|
|||||||
Reference in New Issue
Block a user