Skip to content

Conversation

@fanzeyi
Copy link
Member

@fanzeyi fanzeyi commented Nov 11, 2025

Add reranker parameter to various vector search tools in our integration libraries to make it more obvious this is supported.

Test Plan:

$ uv run ipython
...
In [1]: from databricks_langchain import VectorSearchRetrieverTool, ChatDatabricks

In [2]: help(VectorSearchRetrieverTool)

class VectorSearchRetrieverTool(langchain_core.tools.base.BaseTool, databricks_ai_bridge.vector_search_retriever_tool.VectorSearchRetrieverToolMixin)
 |  VectorSearchRetrieverTool(
 |      *,
 ...
 |      reranker: databricks.vector_search.reranker.DatabricksReranker | None = None,

reranker now appears in the parameter list.

Tests:

$ uv run pytest integrations/langchain/tests/unit_tests
...
=============================================== 4 failed, 194 passed, 2 skipped, 588 warnings in 2.27s ===============================================
# Pre-existing issues

$ uv run pytest integrations/llamaindex/tests/unit_tests
...
========================================================== 112 passed, 88 warnings in 1.60s ==========================================================

$ uv run pytest integrations/openai/tests/unit_tests
...
========================================================== 50 passed, 923 warnings in 1.76s ==========================================================

filters=filter,
num_results=k,
query_type=query_type,
reranker=self._reranker,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we previously recommended that people pass reranker through kwargs, can we make sure that adding this won't accidentally break this function (duplicate keyword arg) for those who are passing reranker that way?

filters=filter,
num_results=fetch_k,
query_type=query_type,
reranker=self._reranker,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here

@fanzeyi
Copy link
Member Author

fanzeyi commented Nov 11, 2025

@annzhang-db updated :)

Test Plan:

```
$ uv run ipython
...
In [1]: from databricks_langchain import VectorSearchRetrieverTool, ChatDatabricks

In [2]: help(VectorSearchRetrieverTool)

class VectorSearchRetrieverTool(langchain_core.tools.base.BaseTool, databricks_ai_bridge.vector_search_retriever_tool.VectorSearchRetrieverToolMixin)
 |  VectorSearchRetrieverTool(
 |      *,
 ...
 |      reranker: databricks.vector_search.reranker.DatabricksReranker | None = None,
 ```

`reranker` now appears in the parameter list.

Tests:

```
$ uv run pytest integrations/langchain/tests/unit_tests
...
=============================================== 4 failed, 194 passed, 2 skipped, 588 warnings in 2.27s ===============================================
# Pre-existing issues

$ uv run pytest integrations/llamaindex/tests/unit_tests
...
========================================================== 112 passed, 88 warnings in 1.60s ==========================================================

$ uv run pytest integrations/openai/tests/unit_tests
...
========================================================== 50 passed, 923 warnings in 1.76s ==========================================================
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants