4bb50ae9c1
Extract images from PDFs using pymupdf, generate descriptions via Qwen3-VL-8B, store in ChromaDB alongside text chunks, and render images in chat answers. Includes image proxy rewrite, force re-process endpoint, and VLM API timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
||
const nextConfig = {
|
||
// 启用 standalone 输出模式(用于 Docker)
|
||
output: 'standalone',
|
||
experimental: {
|
||
turbo: {
|
||
rules: {
|
||
'*.svg': {
|
||
loaders: ['@svgr/webpack'],
|
||
as: '*.js',
|
||
},
|
||
},
|
||
},
|
||
},
|
||
images: {
|
||
remotePatterns: [
|
||
{
|
||
protocol: 'https',
|
||
hostname: '**',
|
||
},
|
||
],
|
||
},
|
||
async rewrites() {
|
||
// 在容器环境中,前端和后端在同一容器内,可以直接访问
|
||
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000';
|
||
return [
|
||
{
|
||
source: '/api/:path*',
|
||
destination: `${backendUrl}/:path*`,
|
||
},
|
||
{
|
||
source: '/generated_images/:path*',
|
||
destination: `${backendUrl}/generated_images/:path*`,
|
||
},
|
||
{
|
||
source: '/images/:path*',
|
||
destination: `${backendUrl}/images/:path*`,
|
||
},
|
||
];
|
||
},
|
||
// 禁用静态生成,避免 SSR 时使用浏览器 API 的错误
|
||
generateBuildId: async () => {
|
||
return 'build-' + Date.now();
|
||
},
|
||
};
|
||
|
||
export default nextConfig;
|