diff --git a/poller/main.py b/poller/main.py index 835916a..2e93aec 100644 --- a/poller/main.py +++ b/poller/main.py @@ -76,6 +76,7 @@ def create_tables(): """ CREATE TABLE IF NOT EXISTS embeddings ( id SERIAL PRIMARY KEY, + role TEXT, bucket TEXT, key TEXT, content TEXT, @@ -144,7 +145,7 @@ def split_files(): Key=f'{key}/page-{i + 1}.pdf', Body=bs.getvalue() ) - cur.execute('INSERT INTO embeddings (bucket, key) VALUES (%s, %s);', (BUCKET_PAGES, f'{key}/page-{i + 1}.pdf')) + cur.execute('INSERT INTO embeddings (bucket, key, role) VALUES (%s, %s, %s);', (BUCKET_PAGES, f'{key}/page-{i + 1}.pdf', key.split('/')[0])) cur.execute('UPDATE metadata SET SPLIT = true WHERE id = %s', (row['id'],)); conn.commit() diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index 300de31..0d7d76c 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -8,10 +8,29 @@ import LoginButton from "@/components/LoginButton"; import LogoutButton from "@/components/LogoutButton"; import Profile from "@/components/Profile"; +// Separate component to safely use useCopilotChat hook +function ThinkingIndicator() { + try { + const { isLoading } = useCopilotChat(); + if (!isLoading) return null; + return ( +