AgentWorkflowConfig.fromMap constructor

AgentWorkflowConfig.fromMap(
  1. Map<String, dynamic> map
)

Builds agent config from a map.

Implementation

factory AgentWorkflowConfig.fromMap(Map<String, dynamic> map) {
  return AgentWorkflowConfig(
    maxConcurrentAgents: _intValue(map, 'max_concurrent_agents') ?? 2,
    maxTurns: _intValue(map, 'max_turns') ?? 10,
    maxRetryBackoff: Duration(
      milliseconds: _intValue(map, 'max_retry_backoff_ms') ?? 300000,
    ),
    maxConcurrentAgentsByState: _intMapValue(
      map,
      'max_concurrent_agents_by_state',
    ),
    runner: _stringValue(map, 'runner') ?? 'llm',
    llm: LlmRunnerWorkflowConfig.fromMap(_mapValue(map, 'llm')),
  );
}