Skip to content

Commit

Permalink
Merge pull request #1099 from julep-ai/x/embeddings-fixture
Browse files Browse the repository at this point in the history
fix(agents-api): fix docs embedding fixture
  • Loading branch information
Ahmad-mtos authored Jan 28, 2025
2 parents 1575f87 + 282520d commit 137e21c
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions agents-api/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,47 +185,24 @@ 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,
"Test content 1",
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])}]",
)

Expand Down

0 comments on commit 137e21c

Please sign in to comment.