generator¶
Generator for Pydantic models based on function signatures.
generate_model_code ¶
Generate Python code for a Pydantic model based on a function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function_info
|
FunctionInfo
|
Information about the function |
required |
Returns:
| Type | Description |
|---|---|
str
|
Generated Python code as a string |
Source code in src/mcpup/generator.py
generate_models ¶
Generate Pydantic models for all functions and save them to files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
functions
|
list[FunctionInfo]
|
List of functions to generate models for |
required |
output_dir
|
Path
|
Directory to save generated models |
required |
Returns:
| Type | Description |
|---|---|
list[Path]
|
List of paths to generated model files |