Waldiez
Waldiez data class.
A Waldiez class contains all the information needed to generate and run an autogen workflow. It has the model/LLM configurations, the agent definitions and their optional additional tools to be used.
Waldiez dataclass
¶
Waldiez(flow: WaldiezFlow)
Waldiez data class.
It contains all the information to generate and run an autogen workflow.
agents property
¶
agents: Iterator[WaldiezAgent]
from_dict classmethod
¶
from_dict(
data: dict[str, Any],
flow_id: Optional[str] = None,
name: Optional[str] = None,
description: Optional[str] = None,
tags: Optional[list[str]] = None,
requirements: Optional[list[str]] = None,
) -> Waldiez
Create a Waldiez from dict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, Any] | The data. | required |
flow_id | Optional[str] | The flow id, by default None (retrieved from data or generated). | None |
name | Optional[str] | The name, by default None (retrieved from data). | None |
description | Optional[str] | The description, by default None (retrieved from data). | None |
tags | Optional[list[str]] | The tags, by default None (retrieved from data). | None |
requirements | Optional[list[str]] | The requirements, by default None (retrieved from data). | None |
Returns:
Type | Description |
---|---|
Waldiez | The Waldiez. |
Source code in waldiez/models/waldiez.py
get_flow_env_vars ¶
Get the flow environment variables.
Returns:
Type | Description |
---|---|
list[tuple[str, str]] | The environment variables for the flow. |
Source code in waldiez/models/waldiez.py
get_group_chat_members ¶
get_group_chat_members(
agent: WaldiezAgent,
) -> list[WaldiezAgent]
Get the chat members that connect to a group chat manager agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent | WaldiezAgent | The agent (group chat manager). | required |
Returns:
Type | Description |
---|---|
List[WaldiezAgent] | The group chat members. |
Source code in waldiez/models/waldiez.py
get_root_group_manager ¶
Get the root group manager agent.
Returns:
Type | Description |
---|---|
WaldiezGroupManager | The root group manager agent. |
Raises:
Type | Description |
---|---|
ValueError | If the root group manager agent is not found. |
Source code in waldiez/models/waldiez.py
has_multimodal_agents property
¶
has_multimodal_agents: bool
Check if the flow has multimodal agents.
load classmethod
¶
load(
waldiez_file: str | Path,
name: Optional[str] = None,
description: Optional[str] = None,
tags: Optional[list[str]] = None,
requirements: Optional[list[str]] = None,
) -> Waldiez
Load a Waldiez from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
waldiez_file | Union[str, Path] | The Waldiez file. | required |
name | Optional[str] | The name, by default None. | None |
description | Optional[str] | The description, by default None. | None |
tags | Optional[list[str]] | The tags, by default None. | None |
requirements | Optional[list[str]] | The requirements, by default None. | None |
Returns:
Type | Description |
---|---|
Waldiez | The Waldiez. |
Raises:
Type | Description |
---|---|
ValueError | If the file is not found or invalid JSON. |
Source code in waldiez/models/waldiez.py
model_dump_json ¶
Get the model dump json.
We use by_alias=True
by default to use the alias (toCamel).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
by_alias | bool | Use alias (toCamel), by default True. | True |
indent | Optional[int] | The indent, by default None. | None |
Returns:
Type | Description |
---|---|
str | The model dump json. |
Source code in waldiez/models/waldiez.py
models property
¶
models: Iterator[WaldiezModel]
tools property
¶
tools: Iterator[WaldiezTool]