kaxil opened a new pull request, #74721:
URL: https://github.com/apache/airflow/pull/74721
`LLMOperator` and the operators built on it (`LLMBranchOperator`,
`LLMSQLQueryOperator`, `LLMFileAnalysisOperator`, `LLMSchemaCompareOperator`)
are documented as one prompt in, one output back, with `AgentOperator` as the
operator for a tool-call loop. Nothing enforced that. `agent_params` went
straight to pydantic-ai's `Agent(...)`, and both the `LLMOperator` docstring
and `operators/llm.rst` listed `tools` as something to pass there. On main,
`LLMOperator(..., agent_params={"tools": [lookup_order]})` calls the tool and
makes a second model request. That is an agent without what `AgentOperator`
gives one: per-tool approval, `durable` replay, tool call logging, and
connection templating for toolsets.
This removes `agent_params` from the LLM operators and their `@task.llm*`
decorators, and adds two typed arguments for what a single call needs:
- `model_settings`: pydantic-ai `ModelSettings` such as `temperature` or
`max_tokens`, templated as `agent_params` was.
- `output_retries`: how many times the model is asked again when its output
fails validation. It is passed as pydantic-ai's integer `retries`, so it
behaves like the old `agent_params={"retries": n}`.
Every LLM operator now builds its agent through `LLMOperator._create_agent`,
which forwards only those two, so no function tool, toolset or capability can
be registered. `AgentOperator` and `@task.agent` keep `agent_params`.
**`model_settings` cannot add your tools, but one provider setting turns on
a provider-hosted tool.** The generic tool keys (`tool_choice`,
`parallel_tool_calls`) only choose among tools the agent already has. OpenAI's
`openai_native_tools` enables web search or file search, which OpenAI runs on
its side; nothing executes in the task. The docs say this rather than the
operator rejecting the key, because a list of rejected provider keys would go
stale as providers add settings.
This is a Common AI 1.0 change, so there is no deprecation period: passing
`agent_params` to an LLM operator now fails when the Dag is parsed. The
changelog and `operators/llm.rst` carry the mapping:
| Before | After |
|---|---|
| `agent_params={"model_settings": {...}}` | `model_settings={...}` |
| `agent_params={"retries": n}` | `output_retries=n` |
| `tools`, `toolsets`, `capabilities` or `spec_file` in `agent_params` |
`AgentOperator` or `@task.agent` |
--
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]