gopidesupavan commented on PR #70087:
URL: https://github.com/apache/airflow/pull/70087#issuecomment-5013931749
a more complex scenario:
```
from __future__ import annotations
from airflow.providers.common.ai.operators.agent import AgentOperator
from airflow.providers.common.compat.sdk import dag
try:
from airflow.providers.common.ai.toolsets.aws import AWSToolset
except Exception:
AWSToolset = None # type: ignore[assignment,misc]
if AWSToolset is not None:
ATHENA_DATABASE = "airflow_ai_toolset_demo_v2"
@dag(tags=["example", "common-ai", "aws"])
def example_aws_toolset_glue_demo():
AgentOperator(
task_id="inspect_glue_demo_tables",
prompt=(
f"Inspect Glue database {ATHENA_DATABASE!r}. "
"List its tables and summarize the schema and storage
descriptor for each table."
),
llm_conn_id="pydanticai_default",
system_prompt=(
"Use list_aws_operations first. Use describe_aws_operation
before each new AWS operation. "
"Only inspect the specified Glue database. Do not create,
update, or delete anything."
),
toolsets=[
AWSToolset(
aws_conn_id="aws_default",
allowed_actions=[
"glue:GetDatabase",
"glue:GetTable",
"glue:GetTables",
],
region_name="us-east-1",
max_items=100,
max_output_bytes=131072,
)
],
)
example_aws_toolset_glue_demo()
```
<img width="1866" height="991" alt="image"
src="https://github.com/user-attachments/assets/dd10bb83-4183-4fd5-824c-377506df4201"
/>
--
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]