airflow.providers.snowflake.operators.cortex_agent

Classes

SnowflakeCortexAgentOperator

Execute a Snowflake Cortex Agent.

SnowflakeCortexAgentCreateOperator

Create a Snowflake Cortex Agent.

SnowflakeCortexAgentUpdateOperator

Update a Snowflake Cortex Agent.

SnowflakeCortexAgentDeleteOperator

Delete a Snowflake Cortex Agent.

Module Contents

class airflow.providers.snowflake.operators.cortex_agent.SnowflakeCortexAgentOperator(*, 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, snowflake_conn_id='snowflake_default', **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

Execute a Snowflake Cortex Agent.

Parameters:
  • database (str) – Database containing the Cortex Agent.

  • schema (str) – Schema containing the Cortex Agent.

  • agent_name (str) – Name of the Cortex Agent.

  • messages (list[dict[str, Any]]) – Conversation messages to send to the agent.

  • thread_id (int | None) – Existing conversation thread identifier. Optional. 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. Optional. Defaults to None.

  • models (dict[str, Any] | None) – Model configuration. Optional. Defaults to None.

  • instructions (dict[str, Any] | None) – Agent instruction overrides. Optional. Defaults to None.

  • orchestration (dict[str, Any] | None) – Orchestration configuration. 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 request to complete. Defaults to 600.

  • snowflake_conn_id (str) – Snowflake connection ID. Defaults to snowflake_default.

template_fields: collections.abc.Sequence[str] = ('database', 'schema', 'agent_name', 'messages', 'snowflake_conn_id')[source]
template_fields_renderers[source]
ui_color = '#29B5E8'[source]
database[source]
schema[source]
agent_name[source]
messages[source]
thread_id = None[source]
parent_message_id = None[source]
tool_choice = None[source]
models = None[source]
instructions = None[source]
orchestration = None[source]
tools = None[source]
tool_resources = None[source]
timeout = 600[source]
snowflake_conn_id = 'snowflake_default'[source]
property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]

Return the Snowflake Cortex Agent hook.

execute(context)[source]

Execute the Snowflake Cortex Agent.

class airflow.providers.snowflake.operators.cortex_agent.SnowflakeCortexAgentCreateOperator(*, database, schema, agent_name, comment=None, profile=None, models=None, instructions=None, orchestration=None, tools=None, tool_resources=None, create_mode=CreateMode.ERROR_IF_EXISTS, timeout=600, snowflake_conn_id='snowflake_default', **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

Create a Snowflake Cortex Agent.

Parameters:
  • database (str) – Database in which to create the Cortex Agent.

  • schema (str) – Schema in which to create the Cortex Agent.

  • agent_name (str) – Name of the Cortex Agent.

  • comment (str | None) – Optional comment.

  • profile (dict[str, Any] | None) – Agent profile configuration. Optional.

  • models (dict[str, Any] | None) – Model configuration. Optional.

  • instructions (dict[str, Any] | None) – Agent instructions. Optional.

  • orchestration (dict[str, Any] | None) – Orchestration configuration. Optional.

  • tools (list[dict[str, Any]] | None) – Agent tools. Optional.

  • tool_resources (dict[str, Any] | None) – Tool resource configuration. Optional.

  • create_mode (airflow.providers.snowflake.hooks.cortex_agent.CreateMode | str) – Resource creation mode. Accepted values are errorIfExists, orReplace and ifNotExists. Defaults to errorIfExists.

  • timeout (int | None) – Maximum time in seconds to wait for the request to complete. Defaults to 600.

  • snowflake_conn_id (str) – Snowflake connection ID. Defaults to snowflake_default.

template_fields: collections.abc.Sequence[str] = ('database', 'schema', 'agent_name', 'comment', 'profile', 'models', 'instructions',...[source]
ui_color = '#29B5E8'[source]
database[source]
schema[source]
agent_name[source]
comment = None[source]
profile = None[source]
models = None[source]
instructions = None[source]
orchestration = None[source]
tools = None[source]
tool_resources = None[source]
create_mode[source]
timeout = 600[source]
snowflake_conn_id = 'snowflake_default'[source]
property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]

Return the Snowflake Cortex Agent hook.

execute(context)[source]

Create the Snowflake Cortex Agent.

class airflow.providers.snowflake.operators.cortex_agent.SnowflakeCortexAgentUpdateOperator(*, database, schema, agent_name, comment=None, profile=None, models=None, instructions=None, orchestration=None, tools=None, tool_resources=None, timeout=600, snowflake_conn_id='snowflake_default', **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

Update a Snowflake Cortex Agent.

Only fields explicitly provided are included in the update request. Fields left as None retain their current values in Snowflake.

Parameters:
  • database (str) – Database containing the Cortex Agent.

  • schema (str) – Schema containing the Cortex Agent.

  • agent_name (str) – Name of the Cortex Agent.

  • comment (str | None) – Optional comment.

  • profile (dict[str, Any] | None) – Agent profile configuration. Optional.

  • models (dict[str, Any] | None) – Model configuration. Optional.

  • instructions (dict[str, Any] | None) – Agent instructions. Optional.

  • orchestration (dict[str, Any] | None) – Orchestration configuration. Optional.

  • tools (list[dict[str, Any]] | None) – Agent tools. Optional.

  • tool_resources (dict[str, Any] | None) – Tool resource configuration. Optional.

  • timeout (int | None) – Maximum time in seconds to wait for the request to complete. Defaults to 600.

  • snowflake_conn_id (str) – Snowflake connection ID. Defaults to snowflake_default.

template_fields: collections.abc.Sequence[str] = ('database', 'schema', 'agent_name', 'comment', 'profile', 'models', 'instructions',...[source]
ui_color = '#29B5E8'[source]
database[source]
schema[source]
agent_name[source]
comment = None[source]
profile = None[source]
models = None[source]
instructions = None[source]
orchestration = None[source]
tools = None[source]
tool_resources = None[source]
timeout = 600[source]
snowflake_conn_id = 'snowflake_default'[source]
property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]

Return the Snowflake Cortex Agent hook.

execute(context)[source]

Update the Snowflake Cortex Agent.

class airflow.providers.snowflake.operators.cortex_agent.SnowflakeCortexAgentDeleteOperator(*, database, schema, agent_name, if_exists=False, timeout=600, snowflake_conn_id='snowflake_default', **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

Delete a Snowflake Cortex Agent.

Parameters:
  • database (str) – Database containing the Cortex Agent.

  • schema (str) – Schema containing the Cortex Agent.

  • agent_name (str) – Name of the Cortex Agent.

  • if_exists (bool) – Ignore the request if the agent does not exist. Defaults to False.

  • timeout (int | None) – Maximum time in seconds to wait for the request to complete. Defaults to 600.

  • snowflake_conn_id (str) – Snowflake connection ID. Defaults to snowflake_default.

template_fields: collections.abc.Sequence[str] = ('database', 'schema', 'agent_name', 'snowflake_conn_id')[source]
ui_color = '#29B5E8'[source]
database[source]
schema[source]
agent_name[source]
if_exists = False[source]
timeout = 600[source]
snowflake_conn_id = 'snowflake_default'[source]
property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]

Return the Snowflake Cortex Agent hook.

execute(context)[source]

Delete the Snowflake Cortex Agent.

Was this entry helpful?