Chats
Chats exporter.
ChatsExporter(get_swarm_members: Callable[[WaldiezAgent], Tuple[List[WaldiezAgent], Optional[WaldiezAgent]]], all_agents: List[WaldiezAgent], agent_names: Dict[str, str], all_chats: List[WaldiezChat], chat_names: Dict[str, str], main_chats: List[Tuple[WaldiezChat, WaldiezAgent, WaldiezAgent]], for_notebook: bool, is_async: bool)
¶
Bases: BaseExporter
, ExporterMixin
Chats exporter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
get_swarm_members | Callable[ |
] The function to use to resolve the swarm members. | required |
all_agents | List[WaldiezAgent] | All the agents in the flow. | required |
agent_names | Dict[str, str] | A mapping of agent id to agent name. | required |
all_chats | List[WaldiezChat] | All the chats in the flow. | required |
chat_names | Dict[str, str] | A mapping of chat id to chat name. | required |
main_chats | List[Tuple[WaldiezChat, WaldiezAgent, WaldiezAgent]] | The main chats in the flow. | required |
for_notebook | bool | Whether the export is for a notebook. | required |
is_async | bool | Whether the chat is asynchronous. | required |
Source code in waldiez/exporting/chats/chats_exporter.py
export() -> ExporterReturnType
¶
Export the chats.
Returns:
Type | Description |
---|---|
ExporterReturnType | The exported chats, the imports, the before export strings, the after export strings, and the environment variables. |
Source code in waldiez/exporting/chats/chats_exporter.py
generate() -> str
¶
Generate the chats content.
Returns:
Type | Description |
---|---|
str | The chats content. |
Source code in waldiez/exporting/chats/chats_exporter.py
get_after_export() -> Optional[List[Tuple[str, Union[ExportPosition, AgentPosition]]]]
¶
Generate the content after the main export.
Returns:
Type | Description |
---|---|
Optional[List[Tuple[str, Union[ExportPosition, AgentPosition]]]] | The exported content after the main export and its position. |
Source code in waldiez/exporting/chats/chats_exporter.py
get_before_export() -> Optional[List[Tuple[str, Union[ExportPosition, AgentPosition]]]]
¶
Generate the content before the main export.
Returns:
Type | Description |
---|---|
Optional[List[Tuple[str, Union[ExportPosition, AgentPosition]]]] | The exported content before the main export and its position. |
Source code in waldiez/exporting/chats/chats_exporter.py
get_imports() -> Optional[List[Tuple[str, ImportPosition]]]
¶
Get the imports string.
Returns:
Type | Description |
---|---|
str | The imports string. |