airflow.providers.common.ai.utils.validation

Validation helpers for common.ai decorators.

Functions

validate_prompt(value, *, decorator_name)

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_sync user_prompt):
  • non-empty, non-whitespace str

  • non-empty Sequence (other than str/bytes/bytearray) of pydantic-ai UserContent items; item-level validation is delegated to pydantic-ai at Agent.run_sync time.

Raises TypeError with an actionable message on any other shape.

Was this entry helpful?