agentMapper
const
agentMapper:object
Defined in: src/waldiez/models/mappers/agent/agentMapper.ts:62
Agent Mapper This module provides functions to import and export agents, as well as to convert agents to and from node format. It handles the conversion of agent data to a format suitable for storage or transmission, and ensures that all necessary fields are included.
Type declarationΒΆ
asNode()ΒΆ
asNode: (
agent
,position?
,skipLinks?
) =>WaldiezNodeAgent
Converts a WaldiezAgent instance to a WaldiezNodeAgent format.
ParametersΒΆ
agentΒΆ
position?ΒΆ
xΒΆ
number
yΒΆ
number
skipLinks?ΒΆ
boolean
ReturnsΒΆ
A WaldiezNodeAgent instance representing the agent.
exportAgent()ΒΆ
exportAgent: (
agentNode
,skipLinks?
) =>any
Exports an agent to a format suitable for storage or transmission.
ParametersΒΆ
agentNodeΒΆ
skipLinks?ΒΆ
boolean
ReturnsΒΆ
any
An object representing the exported agent.
importAgent()ΒΆ
importAgent: (
thing
,agentId?
) =>WaldiezAgent
Imports an agent from a JSON object or similar structure.
ParametersΒΆ
thingΒΆ
unknown
agentId?ΒΆ
string
ReturnsΒΆ
A WaldiezAgent instance representing the imported agent.
ThrowsΒΆ
Error if the input is invalid or missing required fields.