Customize AI Template
This guide will help you learn to customize AI Chat with PDF feature in Next.js Supabase AI template. Adjust file types and sizes to fit your product requirement.
Overview
The Next.js Supabase AI Template include advanced AI feature, such as AI Chat with PDF, enabling users to upload PDFs, parse the content, and obtain insights and answers through text-based queries. This feature transforms uploaded PDFs into a dynamic knowledge base, similar to the functionality of ChatGPT.
This feature leverages the OpenAI API and Vercel SDK to process user queries and deliver accurate responses.
Configuration Options
The AI feature can be tailored to meet specific requirements by modifying configuration settings in the client.config.ts
file.
1. Customizing Accepted File Types
You can define the types of files the system accepts using the FILE_TYPE_ACCEPT
property. By default, the template supports PDF files only.
To allow additional file types (e.g., CSV or TXT files):
2. Customizing Maximum File Size
The FILE_MAX_SIZE_IN_BYTES
property allows you to set the maximum file size for uploads. The default limit is 2MB.