airflow.providers.common.ai.utils.validation¶
Validation helpers for common.ai decorators.
Functions¶
|
Validate the prompt returned by a decorator's python_callable. |
Module Contents¶
- airflow.providers.common.ai.utils.validation.validate_prompt(value, *, decorator_name)[source]¶
Validate the prompt returned by a decorator’s python_callable.
- Accepted (mirrors pydantic-ai’s
Agent.run_syncuser_prompt): non-empty, non-whitespace
strnon-empty
Sequence(other thanstr/bytes/bytearray) of pydantic-aiUserContentitems; item-level validation is delegated to pydantic-ai atAgent.run_synctime.
Raises
TypeErrorwith an actionable message on any other shape.- Accepted (mirrors pydantic-ai’s