mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
fix(zh-hans): establish strong dependency between transfer_method and file parameters
- Replace loose `oneOf` validation with strict conditional dependencies using `anyOf` - `transfer_method: "remote_url"` now requires `url` and prohibits `upload_file_id` - `transfer_method: "local_file"` now requires `upload_file_id` and prohibits `url` - Applied same fix pattern as English version to all Chinese OpenAPI files - Prevents invalid combinations like remote_url + upload_file_id Fixed files: - zh-hans/openapi_workflow.json (InputFileObjectWorkflowCn) - zh-hans/openapi_chatflow.json (InputFileObjectCn) - zh-hans/openapi_chat.json (BasicInputFileObjectCn) - zh-hans/openapi_completion.json (InputFileObject)
This commit is contained in:
@@ -482,11 +482,28 @@
|
||||
"required": ["type", "transfer_method"],
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": ["image"], "description": "文件类型,目前仅支持 'image'。" },
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式。" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址 (当 transfer_method 为 remote_url 时)。" },
|
||||
"upload_file_id": { "type": "string", "format":"uuid", "description": "上传文件 ID (当 transfer_method 为 local_file 时)。" }
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式,remote_url 用于图片 URL / local_file 用于文件上传" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址(当传递方式为 remote_url 时)" },
|
||||
"upload_file_id": { "type": "string", "format":"uuid", "description": "上传文件 ID,必须通过事先上传文件接口获得(当传递方式为 local_file 时)" }
|
||||
},
|
||||
"oneOf": [ {"required": ["url"]}, {"required": ["upload_file_id"]} ]
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["remote_url"] },
|
||||
"url": { "type": "string", "format": "url" }
|
||||
},
|
||||
"required": ["url"],
|
||||
"not": { "required": ["upload_file_id"] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["local_file"] },
|
||||
"upload_file_id": { "type": "string", "format":"uuid" }
|
||||
},
|
||||
"required": ["upload_file_id"],
|
||||
"not": { "required": ["url"] }
|
||||
}
|
||||
]
|
||||
},
|
||||
"ChatCompletionResponseCn": {
|
||||
"type": "object", "description": "阻塞模式下的完整 App 结果。",
|
||||
|
||||
@@ -544,11 +544,28 @@
|
||||
"required": ["type", "transfer_method"],
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": ["document", "image", "audio", "video", "custom"], "description": "文件类型。document: TXT,MD,PDF等; image: JPG,PNG等; audio: MP3,WAV等; video: MP4,MOV等; custom: 其他。" },
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式。" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址 (当 transfer_method 为 remote_url 时)。" },
|
||||
"upload_file_id": { "type": "string", "format":"uuid", "description": "上传文件 ID (当 transfer_method 为 local_file 时)。" }
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式,remote_url 用于图片 URL / local_file 用于文件上传" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址(当传递方式为 remote_url 时)" },
|
||||
"upload_file_id": { "type": "string", "format":"uuid", "description": "上传文件 ID,必须通过事先上传文件接口获得(当传递方式为 local_file 时)" }
|
||||
},
|
||||
"oneOf": [ {"required": ["url"]}, {"required": ["upload_file_id"]} ]
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["remote_url"] },
|
||||
"url": { "type": "string", "format": "url" }
|
||||
},
|
||||
"required": ["url"],
|
||||
"not": { "required": ["upload_file_id"] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["local_file"] },
|
||||
"upload_file_id": { "type": "string", "format":"uuid" }
|
||||
},
|
||||
"required": ["upload_file_id"],
|
||||
"not": { "required": ["url"] }
|
||||
}
|
||||
]
|
||||
},
|
||||
"ChatCompletionResponseCn": {
|
||||
"type": "object", "description": "阻塞模式下的完整 App 结果。",
|
||||
|
||||
@@ -447,11 +447,28 @@
|
||||
"required": ["type", "transfer_method"],
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": ["image"], "description": "支持类型:图片 `image`。" },
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式:`remote_url` (图片地址) 或 `local_file` (上传文件)。" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址(当传递方式为 `remote_url` 时)。" },
|
||||
"upload_file_id": { "type": "string", "description": "上传文件 ID(当传递方式为 `local_file` 时,需通过文件上传 API 预先获取)。" }
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式,remote_url 用于图片 URL / local_file 用于文件上传" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址(当传递方式为 remote_url 时)" },
|
||||
"upload_file_id": { "type": "string", "description": "上传文件 ID,必须通过事先上传文件接口获得(当传递方式为 local_file 时)" }
|
||||
},
|
||||
"oneOf": [ {"required": ["url"]}, {"required": ["upload_file_id"]} ]
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["remote_url"] },
|
||||
"url": { "type": "string", "format": "url" }
|
||||
},
|
||||
"required": ["url"],
|
||||
"not": { "required": ["upload_file_id"] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["local_file"] },
|
||||
"upload_file_id": { "type": "string" }
|
||||
},
|
||||
"required": ["upload_file_id"],
|
||||
"not": { "required": ["url"] }
|
||||
}
|
||||
]
|
||||
},
|
||||
"ChatCompletionResponse": {
|
||||
"type": "object",
|
||||
|
||||
@@ -265,11 +265,28 @@
|
||||
"required": ["type", "transfer_method"],
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": ["document", "image", "audio", "video", "custom"], "description": "文件类型。document: TXT,MD,PDF等; image: JPG,PNG等; audio: MP3,WAV等; video: MP4,MOV等; custom: 其他。" },
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式。" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址 (当 transfer_method 为 remote_url 时)。" },
|
||||
"upload_file_id": { "type": "string", "format": "uuid", "description": "上传文件 ID (当 transfer_method 为 local_file 时)。" }
|
||||
"transfer_method": { "type": "string", "enum": ["remote_url", "local_file"], "description": "传递方式,remote_url 用于图片 URL / local_file 用于文件上传" },
|
||||
"url": { "type": "string", "format": "url", "description": "图片地址(当传递方式为 remote_url 时)" },
|
||||
"upload_file_id": { "type": "string", "description": "上传文件 ID,必须通过事先上传文件接口获得(当传递方式为 local_file 时)" }
|
||||
},
|
||||
"oneOf": [ {"required": ["url"]}, {"required": ["upload_file_id"]} ]
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["remote_url"] },
|
||||
"url": { "type": "string", "format": "url" }
|
||||
},
|
||||
"required": ["url"],
|
||||
"not": { "required": ["upload_file_id"] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"transfer_method": { "enum": ["local_file"] },
|
||||
"upload_file_id": { "type": "string" }
|
||||
},
|
||||
"required": ["upload_file_id"],
|
||||
"not": { "required": ["url"] }
|
||||
}
|
||||
]
|
||||
},
|
||||
"WorkflowCompletionResponseCn": {
|
||||
"type": "object", "description": "阻塞模式下的 workflow 执行结果。",
|
||||
|
||||
Reference in New Issue
Block a user