1313from apcore ._docstrings import parse_docstring
1414from apcore .context import Context
1515from apcore .errors import FuncMissingReturnTypeError , FuncMissingTypeHintError
16+ from apcore .module import ModuleExample
1617
1718
1819def _has_explicit_field_description (annotation : Any ) -> bool :
@@ -175,6 +176,7 @@ def __init__(
175176 version : str = "1.0.0" ,
176177 annotations : dict [str , Any ] | None = None ,
177178 metadata : dict [str , Any ] | None = None ,
179+ examples : list [ModuleExample ] | None = None ,
178180 input_schema : type [BaseModel ] | None = None ,
179181 output_schema : type [BaseModel ] | None = None ,
180182 ) -> None :
@@ -202,6 +204,7 @@ def __init__(
202204 self .version = version
203205 self .annotations = annotations
204206 self .metadata = metadata
207+ self .examples = examples
205208
206209 # Create execute closures — two separate defs required so that
207210 # inspect.iscoroutinefunction returns the correct value.
@@ -249,6 +252,7 @@ def module(
249252 tags : list [str ] | None = None ,
250253 version : str = "1.0.0" ,
251254 metadata : dict [str , Any ] | None = None ,
255+ examples : list [ModuleExample ] | None = None ,
252256 registry : Any = None ,
253257) -> Any :
254258 """Wrap a Python function as an apcore module.
@@ -267,6 +271,7 @@ def _wrap(func: Callable, *, return_module: bool = False) -> Any:
267271 tags = tags ,
268272 version = version ,
269273 metadata = metadata ,
274+ examples = examples ,
270275 )
271276 if registry is not None :
272277 registry .register (fm .module_id , fm )
0 commit comments