Skip to content

Commit

Permalink
Add new test checking tool descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
leonbi100 committed Dec 20, 2024
1 parent ef765b1 commit 8798989
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,20 @@ def test_vector_search_retriever_tool_combinations(
assert isinstance(vector_search_tool, BaseTool)
result = vector_search_tool.invoke("Databricks Agent Framework")
assert result is not None


@pytest.mark.parametrize("index_name", ALL_INDEX_NAMES)
def test_vector_search_retriever_tool_description_generation(index_name: str) -> None:
vector_search_tool = init_vector_search_tool(index_name)
assert vector_search_tool.name != ""
assert vector_search_tool.description != ""
assert vector_search_tool.name == index_name
assert (
"A vector search-based retrieval tool for querying indexed embeddings."
in vector_search_tool.description
)
assert vector_search_tool.args_schema.model_fields["query"] is not None
assert vector_search_tool.args_schema.model_fields["query"].description == (
"The string used to query the index with and identify the most similar "
"vectors and return the associated documents."
)

0 comments on commit 8798989

Please sign in to comment.