Skip to content

Update Genie to optionally take in a workspace client#73

Merged
aravind-segu merged 3 commits intomainfrom
workspaceClientWithGenie
Mar 3, 2025
Merged

Update Genie to optionally take in a workspace client#73
aravind-segu merged 3 commits intomainfrom
workspaceClientWithGenie

Conversation

@aravind-segu
Copy link
Copy Markdown
Contributor

Updating Genie Integration to optionally take in a Workspace Client. This will be used in invokers rights in order for users to pass in an optional Workspace Client.

Test Notebook: https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/490640693269456?o=6051921418418893

genie_space_id,
genie_agent_name: str = "Genie",
description: str = "",
client: Optional["WorkspaceClient"] = None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QQ - is this the same argument name for VectorSearchRetrieverTool and UCToolkit? Actually, I guess VectorSearchRetrieverTool doesn't support a client yet right? https://api-docs.databricks.com/python/databricks-ai-bridge/latest/databricks_langchain.html#databricks_langchain.VectorSearchRetrieverTool

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

VectorSearch is different. Does not take in a workspace client. I Have a different PR for it coming up, just need to finish tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Got it, I see the param name matches https://docs.unitycatalog.io/ai/quickstart/#create-a-langchain-tool, looks good then

Copy link
Copy Markdown
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

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

Had a QQ (sorry in customer call so multitasking rn) otherwise looks good!

# Test the case when genie_response is empty
mock_genie.ask_question.return_value = GenieResponse(result=None)
result = _query_genie_as_agent(input_data, "space-id", "Genie")
result = _query_genie_as_agent(input_data, "space-id", "Genie", None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a quick test that if the GenieAgent was initialized with the workspaceClient, is Genie also initialized with the same one?

@aravind-segu aravind-segu merged commit 5902380 into main Mar 3, 2025
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.

3 participants