airflow.providers.snowflake.operators.cortex_agent¶
Classes¶
Execute a Snowflake Cortex Agent. |
|
Create a Snowflake Cortex Agent. |
|
Update a Snowflake Cortex Agent. |
|
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.BaseOperatorExecute 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_idis provided. Defaults toNone.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 toNone.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]¶
- property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]¶
Return the Snowflake Cortex Agent hook.
- 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.BaseOperatorCreate 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,orReplaceandifNotExists. Defaults toerrorIfExists.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]¶
- property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]¶
Return the Snowflake Cortex Agent hook.
- 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.BaseOperatorUpdate a Snowflake Cortex Agent.
Only fields explicitly provided are included in the update request. Fields left as
Noneretain 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]¶
- property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]¶
Return the Snowflake Cortex Agent hook.
- 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.BaseOperatorDelete 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]¶
- property hook: airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook[source]¶
Return the Snowflake Cortex Agent hook.