Waldiez
Waldiez
A Waldiez class contains all the information that is needed to generate and run an autogen workflow. It has the model/LLM configurations, the agent definitions and their optional additional skills to be used.
Waldiez(flow: WaldiezFlow)
dataclass
¶
Waldiez data class.
It contains all the information to generate and run an autogen workflow.
agents: Iterator[WaldiezAgent]
property
¶
cache_seed: Optional[int]
property
¶
Get the cache seed.
chats: List[Tuple[WaldiezChat, WaldiezAgent, WaldiezAgent]]
property
¶
Get the chats.
description: str
property
¶
Get the flow description.
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
classmethod
¶
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() -> List[Tuple[str, str]]
¶
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(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_swarm_members(initial_agent: WaldiezAgent) -> Tuple[List[WaldiezAgent], Optional[WaldiezAgent]]
¶
Get the chat members that connect to a swarm agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_agent | WaldiezAgent | The initial agent. | required |
Returns:
Type | Description |
---|---|
Tuple[List[WaldiezAgent], Optional[WaldiezAgent]] | The swarm agents and the user agent. |
Source code in waldiez/models/waldiez.py
has_captain_agents: bool
property
¶
Check if the flow has captain agents.
has_multimodal_agents: bool
property
¶
Check if the flow has multimodal agents.
has_rag_agents: bool
property
¶
Check if the flow has RAG agents.
is_async: bool
property
¶
Check if the flow is asynchronous.
is_single_agent_mode: bool
property
¶
Check if the flow is single agent mode.
load(waldiez_file: Union[str, Path], name: Optional[str] = None, description: Optional[str] = None, tags: Optional[List[str]] = None, requirements: Optional[List[str]] = None) -> Waldiez
classmethod
¶
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(by_alias: bool = True, indent: Optional[int] = None) -> str
¶
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: Iterator[WaldiezModel]
property
¶
name: str
property
¶
Get the flow name.
requirements: List[str]
property
¶
Get the flow requirements.
skills: Iterator[WaldiezSkill]
property
¶
tags: List[str]
property
¶
Get the flow tags.