Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/postgres-new/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ export default function Chat() {

const sendCsv = useCallback(
async (file: File) => {
if (file.type !== 'text/csv') {

// List of acceptable MIME types for CSV files
const validCsvMimeTypes = [
'text/csv',
'application/vnd.ms-excel',
'application/csv',
'text/plain'
];

if (!validCsvMimeTypes.includes(file.type)) {
// Add an artificial tool call requesting the CSV
// with an error indicating the file wasn't a CSV
appendMessage({
Expand Down