-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调用应用 API 接口请求传输 base64 图片时出错,Body exceeded 1mb limit。 #1241
Comments
该问题是因为 next.js 默认将 body size limit 设置成了 1mb ,next.js 13 加个 配置即可,只有在通过调用外部 API 时 以 base64 格式传输图片超过 1mb 时才会出现, 考虑到各模型对图片大小和数量的限制不同,可根据具体情况修改。 src/pages/api/v1/chat/completions.ts export const config = {
api: {
responseLimit: '20mb',
bodyParser: {
sizeLimit: '50mb'
}
}
}; |
可以提个pr。 |
我改掉把 |
劳模颁给你 |
例行检查
你的版本
问题描述
调用应用 API 接口请求传输大于 1mb 的 base64 图片时出错,Body exceeded 1mb limit。
复现步骤
在 body 中传入一个 大于 1mb 的 base 64 图片
预期结果
正常请求成功,并返回。
相关截图
The text was updated successfully, but these errors were encountered: