VectorSearchRetrieverTool Openai integration#39
Merged
leonbi-db merged 15 commits intodatabricks:mainfrom Jan 14, 2025
Merged
Conversation
annzhang-db
approved these changes
Jan 10, 2025
| @@ -0,0 +1,6 @@ | |||
| from databricks_openai.vector_search_retriever_tool import VectorSearchRetrieverTool | |||
|
|
|||
| # Expose all integrations to users under databricks-langchain | |||
Contributor
There was a problem hiding this comment.
I'm assuming this is supposed to be databricks-openai?
| None, | ||
| description="The name of the text column to use for the embeddings. " | ||
| "Required for direct-access index or delta-sync index with " | ||
| "self-managed embeddings. Used for direct access indexes or " |
Contributor
There was a problem hiding this comment.
nit: do we need the description to be duplicated (required for ... used for ...)?
| ) -> List[Dict[str, Any]]: | ||
| """ | ||
| Execute the VectorSearchIndex tool calls from the ChatCompletions response that correspond to the | ||
| self.tool VectorSearchRetrieverToolInput and attach the retrieved documents into toll call messages. |
Contributor
There was a problem hiding this comment.
nit: typo
Suggested change
| self.tool VectorSearchRetrieverToolInput and attach the retrieved documents into toll call messages. | |
| self.tool VectorSearchRetrieverToolInput and attach the retrieved documents into tool call messages. |
| embedding_model_name=self_managed_embeddings_test.embedding_model_name, | ||
| openai_client=self_managed_embeddings_test.open_ai_client, | ||
| ) | ||
| assert response is not None |
Contributor
There was a problem hiding this comment.
Could we add a little more validation on the response?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR introduces the databricks-openai python package with the VectorSearchRetrieverTool. The VectorSearchRetrieverTool allows for easy integration between OpenAI chat completions tool calling and Databricks VectorSearch. This tool supports the 3 types of VectorSearch Indexes. See testing below for usage details.
Delta Sync Index with Databricks managed embeddings:
Delta Sync Index with self managed embeddings:
Direct Access Index: