airflow.providers.snowflake.hooks.snowflake_cortex_agent¶
Classes¶
Hook for interacting with Snowflake Cortex Agents. |
Module Contents¶
- class airflow.providers.snowflake.hooks.snowflake_cortex_agent.SnowflakeCortexAgentHook(*args, **kwargs)[source]¶
Bases:
airflow.providers.snowflake.hooks.snowflake.SnowflakeHookHook for interacting with Snowflake Cortex Agents.
- run_agent(*, database, schema, agent_name, messages, thread_id=None, parent_message_id=None, tool_choice=None, models=None, instructions=None, orchestration=None, tools=None, tool_resources=None, timeout=600)[source]¶
Execute a Snowflake Cortex Agent and return the response payload.
- Parameters:
database (str) – Database containing the Cortex Agent.
schema (str) – Schema containing the Cortex Agent.
agent_name (str) – Name of the Cortex Agent to execute.
messages (list[dict[str, Any]]) – Conversation messages to send to the agent. For a new conversation, this should contain the conversation history and the current user message. When
thread_idandparent_message_idare provided, this should contain only the current user message.thread_id (int | None) – Existing conversation thread identifier. Optional. When provided,
parent_message_idmust also be supplied. Defaults toNone.parent_message_id (int | None) – Parent message identifier within the specified thread. Required when
thread_idis provided. Defaults toNone.tool_choice (dict[str, Any] | None) – Tool selection configuration for the agent. Optional. Defaults to
None.models (dict[str, Any] | None) – Model configuration for the agent. Optional. Defaults to
None.instructions (dict[str, Any] | None) – Agent instruction overrides. Optional. Defaults to
None.orchestration (dict[str, Any] | None) – Orchestration configuration for the agent. Optional. Defaults to
None.tools (list[dict[str, Any]] | None) – Additional tools available to the agent. Optional. Defaults to
None.tool_resources (dict[str, Any] | None) – Configuration for tools specified in
tools. Optional. Defaults toNone.timeout (int | None) – Maximum time in seconds to wait for the Cortex Agent request to complete. Defaults to
600.
- Returns:
JSON response returned by the Cortex Agent.
- Return type: