This commit is contained in:
Jonas Braus
2024-12-10 23:34:44 +01:00
parent 68e699f38f
commit cda757029e
7 changed files with 31 additions and 128 deletions
+3 -1
View File
@@ -55,7 +55,9 @@ def prompt_embedding(prompt):
)
cur = conn.cursor()
cur.execute(f"select id, filepath, embedding, embedding <-> {embedding} as distance from dbtable order by distance limit 1;")
cur.execute(f"select id, filepath, embedding <-> %s::vector as distance from dbtable order by distance limit 10;", (embedding["embedding"],))
result = cur.fetchall()
conn.close()
print(result)