Exporter
Waldiez exporter class.
The role of the exporter is to export the model's data to an autogen's flow with one or more chats.
The resulting file(s): a flow.py
file with one main()
function to trigger the chat(s).
WaldiezExporter ¶
WaldiezExporter(waldiez: Waldiez)
Waldiez exporter.
Attributes:
Name | Type | Description |
---|---|---|
waldiez (Waldiez) | The Waldiez instance. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
waldiez | Waldiez | The Waldiez instance. | required |
Source code in waldiez/exporter.py
export ¶
Export the Waldiez instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Union[str, Path] | The path to export to. | required |
force | (bool, optional) | Override the output file if it already exists, by default False. | False |
debug | (bool, optional) | Whether to enable debug mode, by default False. | False |
Raises:
Type | Description |
---|---|
FileExistsError | If the file already exists, and force is False. |
IsADirectoryError | If the output is a directory. |
ValueError | If the file extension is invalid. |
Source code in waldiez/exporter.py
load classmethod
¶
load(file_path: Path) -> WaldiezExporter
Load the Waldiez instance from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | Path | The file path. | required |
Returns:
Type | Description |
---|---|
WaldiezExporter | The Waldiez exporter. |
Source code in waldiez/exporter.py
to_ipynb ¶
Export flow to jupyter notebook.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | The path to export to. | required |
debug | bool | Whether to enable debug mode, by default False. | False |
Raises:
Type | Description |
---|---|
RuntimeError | If the notebook could not be generated. |
Source code in waldiez/exporter.py
to_py ¶
Export waldiez flow to a python script.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | The path to export to. | required |
debug | bool | Whether to enable debug mode, by default False. | False |
Raises:
Type | Description |
---|---|
RuntimeError | If the python script could not be generated. |
Source code in waldiez/exporter.py
to_waldiez ¶
Export the Waldiez instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | Path | The file path. | required |
debug | bool | Whether to enable debug mode, by default False. | False |