class_docstr: AutoGenWorkFlowManager class to load agents from a provided configuration and run a chat between them
docstr: Loads an agent based on the provided agent specification.
  
  Args:
      agent_spec: The specification of the agent to be loaded.
  
  Returns:
      An instance of the loaded agent.
docstr_tok: ["Loads","an","agent","based","on","the","provided","agent","specification",".","Args",":","agent_spec",":","The","specification","of","the","agent","to","be","loaded",".","Returns",":","An","instance","of","the","loaded","agent","."]
code: def load(self, agent_spec: AgentFlowSpec) -> autogen.Agent:
      """
      Loads an agent based on the provided agent specification.
  
      Args:
          agent_spec: The specification of the agent to be loaded.
  
      Returns:
          An instance of the loaded agent.
      """
      agent: autogen.Agent
      agent_spec = self.sanitize_agent_spec(agent_spec)
      if agent_spec.type == "assistant":
          agent = autogen.AssistantAgent(**asdict(agent_spec.config))
          agent.register_reply(
              [autogen.Agent, None],
              reply_func=self.process_reply,
              config={"callback": None},
          )
      elif agent_spec.type == "userproxy":
          agent = autogen.UserProxyAgent(**asdict(agent_spec.config))
          agent.register_reply(
              [autogen.Agent, None],
              reply_func=self.process_reply,
              config={"callback": None},
          )
      else:
          raise ValueError(f"Unknown agent type: {agent_spec.type}")
      return agent
  
file_path: autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py
imports: from typing import List, Optional
  from dataclasses import asdict
  import autogen
  from .datamodel import AgentFlowSpec, AgentWorkFlowConfig, Message
  from .utils import get_skills_from_prompt, clear_folder
  from datetime import datetime
label_desc: Use image node_id 6 for calling the AutoGenWorkFlowManager obj's underlying member method code with example usage: obj.load(agent_spec) and returns: agent