fastgpt版本: v4.12.2
场景: 通过fastgpt api传递文件(阿里云oss签名链接)到fastgpt,fastgpt调用大模型识别
过程:使用以下接口,上传阿里云oss(私有读)经过签名后的文件链接,报错 "method": "head" ,403(大模型直接识别是没问题的,过了fastgpt才会有问题)
接口/请求参数
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions'
--header 'Authorization: Bearer fastgpt-xxxxxx' \
--header 'Content-Type: application/json'
--data-raw '{
"chatId": "abcd",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "导演是谁"
},
{
"type": "image_url",
"image_url": {
"url": "图片链接"
}
},
{
"type": "file_url",
"name": "文件名",
"url": "文档链接,支持 txt md html word pdf ppt csv excel"
}
]
}
]
}'
报错日志:
{
"error": {
"message": "Request failed with status code 403",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 403\n at settle (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async /app/projects/app/.next/server/chunks/67833.js:30:7783\n at async Promise.all (index 0)\n at async o (/app/projects/app/.next/server/chunks/67833.js:30:8691)\n at async /app/projects/app/.next/server/chunks/67833.js:30:10136\n at async Promise.all (index 1)\n at async m (/app/projects/app/.next/server/chunks/67833.js:30:9993)\n at async _ (/app/projects/app/.next/server/chunks/67833.js:30:854)\n at async Object.A [as chatNode] (/app/projects/app/.next/server/chunks/22464.js:324:166)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http",
"fetch"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 10000,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, /",
"User-Agent": "axios/1.8.4",
"Accept-Encoding": "gzip, compress, deflate, br"
},
"method": "head",
"url": "oss的带签名链接",
"allowAbsoluteUrls": true
},
"code": "ERR_BAD_REQUEST",
"status": 403
}
}
oss侧使用get签名,就是上面的问题
如果使用head签名,上一步能过,但是模型那边读的又是get的签名,又会报
{"log":"{\n","stream":"stderr","time":"2026-08-26T05:47:07.524735759Z"}
{"log":" message: '400 \u003c400\u003e InternalError.Algo.InvalidParameter: Failed to download multimodal content (request id: 2026082613470651344680640674520)',\n","stream":"stderr","time":"2026-08-26T05:47:07.524758041Z"}
{"log":" stack: 'Error: 400 \u003c400\u003e InternalError.Algo.InvalidParameter: Failed to download multimodal content (request id: 2026082613470651344680640674520)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524767716Z"}
{"log":" ' at t8.generate (/app/projects/app/.next/server/chunks/50751.js:154:422108)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524776655Z"}
{"log":" ' at nD.makeStatusError (/app/projects/app/.next/server/chunks/50751.js:154:413756)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524784813Z"}
{"log":" ' at nD.makeRequest (/app/projects/app/.next/server/chunks/50751.js:154:414679)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524793093Z"}
{"log":" ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524801588Z"}
{"log":" ' at async T (/app/projects/app/.next/server/chunks/67833.js:30:5902)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524809744Z"}
{"log":" ' at async _ (/app/projects/app/.next/server/chunks/67833.js:30:1027)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524817964Z"}
{"log":" ' at async Object.A [as chatNode] (/app/projects/app/.next/server/chunks/22464.js:324:166)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524826115Z"}
{"log":" ' at async /app/projects/app/.next/server/chunks/22464.js:325:3623\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524834432Z"}
{"log":" ' at async q.nodeRunWithActive (/app/projects/app/.next/server/chunks/22464.js:325:3533)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524863984Z"}
{"log":" ' at async q.checkNodeCanRun (/app/projects/app/.next/server/chunks/22464.js:325:6100)'\n","stream":"stderr","time":"2026-08-26T05:47:07.524873016Z"}
{"log":"}\n","stream":"stderr","time":"2026-08-26T05:47:07.524881181Z"}
能不能让fastgpt始终只用get请求,或者这种场景做法不应该这样?
fastgpt版本: v4.12.2
场景: 通过fastgpt api传递文件(阿里云oss签名链接)到fastgpt,fastgpt调用大模型识别
过程:使用以下接口,上传阿里云oss(私有读)经过签名后的文件链接,报错 "method": "head" ,403(大模型直接识别是没问题的,过了fastgpt才会有问题)
接口/请求参数
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions'
--header 'Authorization: Bearer fastgpt-xxxxxx' \
--header 'Content-Type: application/json'
--data-raw '{
"chatId": "abcd",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "导演是谁"
},
{
"type": "image_url",
"image_url": {
"url": "图片链接"
}
},
{
"type": "file_url",
"name": "文件名",
"url": "文档链接,支持 txt md html word pdf ppt csv excel"
}
]
}
]
}'
报错日志:
{
"error": {
"message": "Request failed with status code 403",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 403\n at settle (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (file:///app/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async /app/projects/app/.next/server/chunks/67833.js:30:7783\n at async Promise.all (index 0)\n at async o (/app/projects/app/.next/server/chunks/67833.js:30:8691)\n at async /app/projects/app/.next/server/chunks/67833.js:30:10136\n at async Promise.all (index 1)\n at async m (/app/projects/app/.next/server/chunks/67833.js:30:9993)\n at async _ (/app/projects/app/.next/server/chunks/67833.js:30:854)\n at async Object.A [as chatNode] (/app/projects/app/.next/server/chunks/22464.js:324:166)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http",
"fetch"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 10000,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, /",
"User-Agent": "axios/1.8.4",
"Accept-Encoding": "gzip, compress, deflate, br"
},
"method": "head",
"url": "oss的带签名链接",
"allowAbsoluteUrls": true
},
"code": "ERR_BAD_REQUEST",
"status": 403
}
}
oss侧使用get签名,就是上面的问题
如果使用head签名,上一步能过,但是模型那边读的又是get的签名,又会报
{"log":"{\n","stream":"stderr","time":"2026-08-26T05:47:07.524735759Z"}
{"log":" message: '400 \u003c400\u003e InternalError.Algo.InvalidParameter: Failed to download multimodal content (request id: 2026082613470651344680640674520)',\n","stream":"stderr","time":"2026-08-26T05:47:07.524758041Z"}
{"log":" stack: 'Error: 400 \u003c400\u003e InternalError.Algo.InvalidParameter: Failed to download multimodal content (request id: 2026082613470651344680640674520)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524767716Z"}
{"log":" ' at t8.generate (/app/projects/app/.next/server/chunks/50751.js:154:422108)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524776655Z"}
{"log":" ' at nD.makeStatusError (/app/projects/app/.next/server/chunks/50751.js:154:413756)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524784813Z"}
{"log":" ' at nD.makeRequest (/app/projects/app/.next/server/chunks/50751.js:154:414679)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524793093Z"}
{"log":" ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524801588Z"}
{"log":" ' at async T (/app/projects/app/.next/server/chunks/67833.js:30:5902)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524809744Z"}
{"log":" ' at async _ (/app/projects/app/.next/server/chunks/67833.js:30:1027)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524817964Z"}
{"log":" ' at async Object.A [as chatNode] (/app/projects/app/.next/server/chunks/22464.js:324:166)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524826115Z"}
{"log":" ' at async /app/projects/app/.next/server/chunks/22464.js:325:3623\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524834432Z"}
{"log":" ' at async q.nodeRunWithActive (/app/projects/app/.next/server/chunks/22464.js:325:3533)\n' +\n","stream":"stderr","time":"2026-08-26T05:47:07.524863984Z"}
{"log":" ' at async q.checkNodeCanRun (/app/projects/app/.next/server/chunks/22464.js:325:6100)'\n","stream":"stderr","time":"2026-08-26T05:47:07.524873016Z"}
{"log":"}\n","stream":"stderr","time":"2026-08-26T05:47:07.524881181Z"}
能不能让fastgpt始终只用get请求,或者这种场景做法不应该这样?