F5 AI Gateway Python SDK common patterns¶
This document outlines common implementation details and patterns.
Parameter validation¶
The SDK uses Pydantic as a base class for Parameters
, so you can leverage field or model validators
in order to enforce specific parameter rules beyond types.
class MyParameters(Parameters):
@model_validator(mode="after")
def params_validation(self) -> Self:
if not self.modify:
raise ValueError("my processor requires modify to be set to true")
return self