Working frontend interface with supabse storage

This commit is contained in:
Harivansh Rathi 2024-12-05 17:05:20 -05:00
parent ae239a2849
commit 1eb339623c
19 changed files with 1150 additions and 422 deletions

36
src/types/supabase.ts Normal file
View file

@ -0,0 +1,36 @@
export interface ChatInstance {
id: string;
created_at: string;
user_id: string;
title: string;
last_message_at: string;
}
export interface ChatMessage {
id: string;
chat_id: string;
content: string;
role: 'user' | 'assistant';
created_at: string;
metadata?: {
make_response_id?: string;
error?: string;
};
}
export type Database = {
public: {
Tables: {
chat_instances: {
Row: ChatInstance;
Insert: Omit<ChatInstance, 'id' | 'created_at'>;
Update: Partial<Omit<ChatInstance, 'id' | 'created_at' | 'user_id'>>;
};
chat_messages: {
Row: ChatMessage;
Insert: Omit<ChatMessage, 'id' | 'created_at'>;
Update: Partial<Omit<ChatMessage, 'id' | 'created_at' | 'chat_id'>>;
};
};
};
};