Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.snowflake.hooks.snowflake_cortex_agent

Classes

SnowflakeCortexAgentHook

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.SnowflakeHook

Hook 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_id and parent_message_id are provided, this should contain only the current user message.

  • thread_id (int | None) – Existing conversation thread identifier. Optional. When provided, parent_message_id must also be supplied. Defaults to None.

  • parent_message_id (int | None) – Parent message identifier within the specified thread. Required when thread_id is provided. Defaults to None.

  • 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 to None.

  • 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:

dict[str, Any]

static get_text_response(response)[source]

Extract text blocks from a Cortex Agent response.

Was this entry helpful?