Repository navigation
Add Cortex Agent management methods to SnowflakeCortexAgentHook - #70101
Conversation
ebdbed1 to
1b8cab7
Compare
1b8cab7 to
25b776e
Compare
25b776e to
22bfa6a
Compare
784409d to
652bd4c
Compare
|
Requesting review for this. |
9dc3357 to
5663c69
Compare
2a75bae to
8d4802f
Compare
|
cc: @kaxil |
8d4802f to
e1033c6
Compare
|
Please don't merge this just yet - we are looking at unifying this in to common.ai |
I appreciate the heads up. But would it not take a substantial amount of time for the maintainers to align on the final abstraction? There is also a possibility we may decide against it. I wonder if we could let these PRs merge whilst that discussion continues. |
e5fe3b1 to
0d5d47e
Compare
|
I believe this should be okay to merge without adding support for the additional interface ( |
I think @ashb's 'don't merge' comment is a bit outdated now that PR #71946 has landed. My understanding is that the |
|
Yes, most likely you are correct, |
0d5d47e to
f9720eb
Compare
f9720eb to
215f8e3
Compare
|
Requesting review for this. |
This change extends SnowflakeCortexAgentHook with support for managing Cortex Agent Objects through the Snowflake REST API. The hook now supports describing, listing and deleting Cortex Agents in addition to executing them via run_agent(). The internal request helper has also been enhanced to support query parameters, enabling endpoints such as list_agents() and delete_agent() to pass optional REST query parameters while reusing the existing request implementation.
…lper validate the expected top-level response shape. Remove endpoint-level casts and handle successful empty responses as empty dictionaries for dict-shaped endpoints.
response fallback, improve list response validation, and document manual pagination through from_name and show_limit.
215f8e3 to
f421269
Compare
Description
This change extends
SnowflakeCortexAgentHookwith support for managing Snowflake Cortex Agent Objects.The hook now exposes methods to describe, list and delete Cortex Agents using the Snowflake Cortex Agent REST API. To support these endpoints, the internal request helper has been updated to accept optional query parameters while continuing to centralize authentication, request execution and error handling.
Rationale
The existing hook supports executing Cortex Agents through
run_agent(), but the Snowflake Cortex Agent REST API also provides endpoints for managing Cortex Agent Objects. Exposing these operations through the hook allows users to inspect and manage agents without needing to invoke the REST API directly.Adding query parameter support to the shared request helper also provides a reusable foundation for additional Cortex Agent management operations in future enhancements.
Tests
Added unit tests verifying that:
describe_agent()sends the expected request and returns the API response.list_agents()correctly forwards optional query parameters and returns the list of agents.delete_agent()issues the expected DELETE request, including both values of theif_existsparameter._request()returns{}for successful empty dict responses.