Skip to content

Commit

Permalink
refactor: Lint agents-api (CI)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 authored and github-actions[bot] committed Dec 24, 2024
1 parent d16a693 commit 23235f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion agents-api/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from agents_api.queries.developers.create_developer import create_developer
from agents_api.queries.developers.get_developer import get_developer
from agents_api.queries.docs.create_doc import create_doc
from agents_api.queries.tools.delete_tool import delete_tool

# from agents_api.queries.executions.create_execution import create_execution
# from agents_api.queries.executions.create_execution_transition import create_execution_transition
Expand All @@ -30,6 +29,7 @@
from agents_api.queries.sessions.create_session import create_session
from agents_api.queries.tasks.create_task import create_task
from agents_api.queries.tools.create_tools import create_tools
from agents_api.queries.tools.delete_tool import delete_tool
from agents_api.queries.users.create_user import create_user
from agents_api.web import app

Expand Down
16 changes: 7 additions & 9 deletions agents-api/tests/test_docs_queries.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ward import skip, test
import asyncio

from ward import skip, test

from agents_api.autogen.openapi_model import CreateDocRequest
from agents_api.clients.pg import create_db_pool
from agents_api.queries.docs.create_doc import create_doc
Expand All @@ -10,13 +11,7 @@
from agents_api.queries.docs.search_docs_by_embedding import search_docs_by_embedding
from agents_api.queries.docs.search_docs_by_text import search_docs_by_text
from agents_api.queries.docs.search_docs_hybrid import search_docs_hybrid
from tests.fixtures import (
pg_dsn,
test_agent,
test_developer,
test_doc,
test_user
)
from tests.fixtures import pg_dsn, test_agent, test_developer, test_doc, test_user

EMBEDDING_SIZE: int = 1024

Expand Down Expand Up @@ -219,6 +214,7 @@ async def _(dsn=pg_dsn, developer=test_developer, agent=test_agent):
)
assert not any(d.id == doc_agent.id for d in docs_list)


@skip("text search: test container not vectorizing")
@test("query: search docs by text")
async def _(dsn=pg_dsn, agent=test_agent, developer=test_developer):
Expand Down Expand Up @@ -253,12 +249,13 @@ async def _(dsn=pg_dsn, agent=test_agent, developer=test_developer):
)

print("\nSearch results:", result)

# More specific assertions
assert len(result) >= 1, "Should find at least one document"
assert any(d.id == doc.id for d in result), f"Should find document {doc.id}"
assert result[0].metadata == {"test": "test"}, "Metadata should match"


@skip("embedding search: test container not vectorizing")
@test("query: search docs by embedding")
async def _(dsn=pg_dsn, agent=test_agent, developer=test_developer):
Expand Down Expand Up @@ -291,6 +288,7 @@ async def _(dsn=pg_dsn, agent=test_agent, developer=test_developer):
assert len(result) >= 1
assert result[0].metadata is not None


@skip("hybrid search: test container not vectorizing")
@test("query: search docs by hybrid")
async def _(dsn=pg_dsn, agent=test_agent, developer=test_developer):
Expand Down

0 comments on commit 23235f4

Please sign in to comment.