From ddff537e486789b088bb42afb34f36bfaf27ffeb Mon Sep 17 00:00:00 2001 From: Ahmad Haidar Date: Tue, 28 Jan 2025 09:38:44 +0300 Subject: [PATCH] fix(agents-api): fix docs embedding fixture --- agents-api/tests/fixtures.py | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/agents-api/tests/fixtures.py b/agents-api/tests/fixtures.py index 69075ad52..5d2d94024 100644 --- a/agents-api/tests/fixtures.py +++ b/agents-api/tests/fixtures.py @@ -185,7 +185,7 @@ async def test_doc_with_embedding(dsn=pg_dsn, developer=test_developer, doc=test await pool.execute( """ INSERT INTO docs_embeddings_store (developer_id, doc_id, index, chunk_seq, chunk, embedding) - VALUES ($1, $2, 0, 1, $3, $4) + VALUES ($1, $2, 1, 1, $3, $4) """, developer.id, doc.id, @@ -193,39 +193,16 @@ async def test_doc_with_embedding(dsn=pg_dsn, developer=test_developer, doc=test f"[{', '.join([str(x) for x in embedding_with_confidence_0])}]", ) - # Insert embedding with confidence 0.5 with respect to unit vector - await pool.execute( - """ - INSERT INTO docs_embeddings_store (developer_id, doc_id, index, chunk_seq, chunk, embedding) - VALUES ($1, $2, 0, 2, $3, $4) - """, - developer.id, - doc.id, - "Test content 2", - f"[{', '.join([str(x) for x in embedding_with_confidence_05])}]", - ) - - # Insert embedding with confidence -0.5 with respect to unit vector - await pool.execute( - """ - INSERT INTO docs_embeddings_store (developer_id, doc_id, index, chunk_seq, chunk, embedding) - VALUES ($1, $2, 0, 3, $3, $4) - """, - developer.id, - doc.id, - "Test content 3", - f"[{', '.join([str(x) for x in embedding_with_confidence_05_neg])}]", - ) # Insert embedding with confidence -1 with respect to unit vector await pool.execute( """ INSERT INTO docs_embeddings_store (developer_id, doc_id, index, chunk_seq, chunk, embedding) - VALUES ($1, $2, 0, 4, $3, $4) + VALUES ($1, $2, 2, 2, $3, $4) """, developer.id, doc.id, - "Test content 4", + "Test content 2", f"[{', '.join([str(x) for x in embedding_with_confidence_1_neg])}]", )