Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a python http_request wrapper to create external tools #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunishsheth2009
Copy link

Adding a python http_request wrapper to create external tools

@sunishsheth2009 sunishsheth2009 force-pushed the sunish-external-tools-http branch 3 times, most recently from b5e0119 to 947dc7d Compare December 11, 2024 19:11


@experimental
def http_request(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should think about the module and API name a little more, maybe something like databricks_ai_bridge.external_tools.http_request? Or even databricks_ai_bridge.external_tools.request? Just thinking about how this looks in code where you might mix this with generic requests.request calls to some public APIs

Copy link
Collaborator

Choose a reason for hiding this comment

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

Another option is databricks_ai_bridge.uc_connections.http_request - I know we wanna present our product as external tools but what we're actually using is the UC connection to make an HTTP request in the process of defining a tool, ratehr than using a tool itself

@@ -0,0 +1,65 @@
import inspect
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there tests for these annotations that we should also include + include a backlink to the OSS MLflow code (I'm guessing) that we copied from?

params: Optional[Dict[str, Any]] = None,
) -> requests.Response:
"""
Makes an HTTP request to an external function through the Databricks Workspace.
Copy link
Collaborator

@smurching smurching Dec 14, 2024

Choose a reason for hiding this comment

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

Suggested change
Makes an HTTP request to an external function through the Databricks Workspace.
Makes an HTTP request to a remote API using authentication from a Unity Catalog HTTP connection.

Copy link
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.

A few comments but mostly looks great, thanks @sunishsheth2009 !

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