Slide 28
Slide 28 text
31 // Store the vector in Postgres
32 const supabase = supabaseClient()
33 const { data: documents } = await supabase.rpc('match_documents', {
34 query_embedding: embedding, // Pass the embedding you want to compare
35 match_threshold: 0.78, // Choose an appropriate threshold for your data
36 match_count: 3, // Choose the number of matches
37 })
38 console.log({documents})
39 documents.map((doc) => {
40 messages.push({
41 "type": "text",
42 "text": `Matched: ${doc.body}`
43 })
44 })
45 const { data, error } = await supabase.from('documents').insert({
46 body: events[0].message.text,
47 embedding,
48 })
49 replyMessage(events, messages)
50 }
Ұக͢ΔυΩϡϝϯτΛݕࡧ