remove not ready updates

This commit is contained in:
shaun 2023-05-21 21:21:27 -07:00
parent d7b2837518
commit c1345561ab
2 changed files with 0 additions and 40 deletions

View File

@ -95,8 +95,6 @@ cp .frontend_env.example frontend/.env
[Migration Script 2](scripts/supabase_usage_table.sql)
[Migration Script 3](scripts/supabase_vector_store_document.sql)
- **Step 5**: Launch the app
```bash

View File

@ -1,38 +0,0 @@
-- Create a table to store your summaries
create table if not exists summaries (
id bigserial primary key,
document_id bigint references documents(id),
content text, -- corresponds to the summarized content
metadata jsonb, -- corresponds to Document.metadata
embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed
);
CREATE OR REPLACE FUNCTION match_summaries(query_embedding vector(1536), match_count int, match_threshold float)
RETURNS TABLE(
id bigint,
document_id bigint,
content text,
metadata jsonb,
-- we return matched vectors to enable maximal marginal relevance searches
embedding vector(1536),
similarity float)
LANGUAGE plpgsql
AS $$
# variable_conflict use_column
BEGIN
RETURN query
SELECT
id,
document_id,
content,
metadata,
embedding,
1 -(summaries.embedding <=> query_embedding) AS similarity
FROM
summaries
WHERE 1 - (summaries.embedding <=> query_embedding) > match_threshold
ORDER BY
summaries.embedding <=> query_embedding
LIMIT match_count;
END;
$$;