shahar1 commented on code in PR #69939: URL: https://github.com/apache/airflow/pull/69939#discussion_r3632855928
########## providers/snowflake/src/airflow/providers/snowflake/operators/snowflake_cortex_agent.py: ########## @@ -0,0 +1,135 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from __future__ import annotations + +from collections.abc import Sequence +from functools import cached_property +from typing import TYPE_CHECKING, Any + +from airflow.models import BaseOperator +from airflow.providers.snowflake.hooks.snowflake_cortex_agent import SnowflakeCortexAgentHook + +if TYPE_CHECKING: + from airflow.providers.common.compat.sdk import Context + + +class SnowflakeCortexAgentOperator(BaseOperator): + """ + Execute a Snowflake Cortex Agent. + + :param database: Database containing the Cortex Agent. + :param schema: Schema containing the Cortex Agent. + :param agent_name: Name of the Cortex Agent. + :param messages: Conversation messages to send to the agent. + :param thread_id: Existing conversation thread identifier. Optional. + Defaults to ``None``. + :param parent_message_id: Parent message identifier within the specified + thread. Required when ``thread_id`` is provided. Defaults to ``None``. + :param tool_choice: Tool selection configuration. Optional. Defaults to + ``None``. + :param models: Model configuration. Optional. Defaults to ``None``. + :param instructions: Agent instruction overrides. Optional. Defaults to + ``None``. + :param orchestration: Orchestration configuration. Optional. Defaults to + ``None``. + :param tools: Additional tools available to the agent. Optional. Defaults + to ``None``. + :param tool_resources: Configuration for tools specified in ``tools``. + Optional. Defaults to ``None``. + :param timeout: Maximum time in seconds to wait for the request to + complete. Defaults to ``600``. + :param snowflake_conn_id: Snowflake connection ID. Defaults to + ``snowflake_default``. + """ + + template_fields: Sequence[str] = ("messages",) Review Comment: Please consider adding database/schema/agent_name to `template_fields` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
