model
Kind: Function
Domain: Graph, serialization, and replay
Canonical import: from cadflow import model
Signature
def model(func: 'Optional[Callable[_P, _R]]' = None, *, graph_id: 'Optional[str]' = None, export_dir: 'str | Path | None' = None) -> 'Union[Callable[[Callable[_P, _R]], Callable[_P, ModelResult]], Callable[_P, ModelResult]]'
Description
Decorate a top-level model function with one owned GraphSession.
Parameters
| Name | Type | Required | Default | Source description |
|---|---|---|---|---|
func | 'Optional[Callable[_P, _R]]' | no | None | Not explicitly described in the source docstring. |
graph_id | 'Optional[str]' | no | None | Not explicitly described in the source docstring. |
export_dir | 'str | Path | None' | no | None | Not explicitly described in the source docstring. |
Returns
Type: 'Union[Callable[[Callable[_P, _R]], Callable[_P, ModelResult]], Callable[_P, ModelResult]]'
The source docstring does not declare additional return semantics.
Errors
The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.
Behavior and constraints
- The contract below is generated from the current public runtime signature. Check domain notes for ownership and workflow constraints.
Import check
from cadflow import model