Experimental
Experimental pipeline API functionality. Be careful with this API, it’s subject to change.
Experimental module exposing a function to generate a core schema that validates callable arguments.
def generate_arguments_schema(
func: Callable[..., Any],
schema_type: Literal['arguments', 'arguments-v3'] = 'arguments-v3',
parameters_callback: Callable[[int, str, Any], Literal['skip'] | None] | None = None,
config: ConfigDict | None = None,
) -> CoreSchema
Generate the schema for the arguments of a function.
CoreSchema — The generated schema.
The function to generate the schema for.
The type of schema to generate.
A callable that will be invoked for each parameter. The callback
should take three required arguments: the index, the name and the type annotation
(or Parameter.empty if not annotated) of the parameter.
The callback can optionally return 'skip', so that the parameter gets excluded
from the resulting schema.
The configuration to use.