Create a Pydantic schema from a function's signature.
create_schema_from_function(
model_name: str,
func: Callable,
*,
filter_args: Sequence[str] | None = None,
parse_docstring: bool = False,
error_on_invalid_docstring: bool = False,
include_injected: bool = True
) -> type[BaseModel]| Name | Type | Description |
|---|---|---|
model_name* | str | Name to assign to the generated Pydantic schema. |
func* | Callable | Function to generate the schema from. |
filter_args | Sequence[str] | None | Default: NoneOptional list of arguments to exclude from the schema. Defaults to |
parse_docstring | bool | Default: FalseWhether to parse the function's docstring for descriptions for each argument. |
error_on_invalid_docstring | bool | Default: FalseIf |
include_injected | bool | Default: TrueWhether to include injected arguments in the schema. Defaults to |