website-wandb / web_app /backend /app /utils /agent_utils.py
leothesouthafrican's picture
agent working in file no memory
df03553
Raw
History Blame Contribute Delete
605 Bytes
# agent_utils.py
def choose_agent(agent_type, available_agents):
"""
Selects the appropriate agent based on the agent_type parameter.
Args:
agent_type (str): A string identifier for the agent.
Known types are 'contractor_agent' and 'home_owner_agent'.
available_agents (dict): Dictionary of available agents.
Returns:
object: The selected agent object. Defaults to contractor_agent if no match is found.
"""
return available_agents.get(agent_type, available_agents['contractor_agent']) # default to contractor_agent if no match