code: def get_bot_worker(
      opt: Dict[str, Any], model_name: str
  ) -> PerTurnEvalTurkLikeAgent:
      """
      Return a bot agent.
  
      Agent behaves like a crowdsource worker but actually wraps around a dialogue model.
      """
      semaphore = opt["semaphore"]
      shared_bot_agents = opt["shared_bot_agents"]
      num_turns = opt["num_turns"]
      bot_agent = create_agent_from_shared(
          shared_bot_agents[model_name]
      )
      bot_worker = PerTurnEvalTurkLikeAgent(
          opt,
          model_name=model_name,
          model_agent=bot_agent,
          num_turns=num_turns,
          semaphore=semaphore,
      )
      return bot_worker
  
imports: import random
  import parlai.utils.logging
  from typing import Any, Dict, Optional
  from parlai.core.agents import create_agent_from_shared
  from parlai.core.message import Message
  from parlai.core.worlds import validate
  from parlai.crowdsourcing.tasks.model_chat.constants import ONBOARD_SUCCESS
  from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility
  from parlai.crowdsourcing.tasks.model_chat.worlds import BaseModelChatWorld, ModelChatWorld, ModelChatOnboardWorld
  from parlai.crowdsourcing.utils.acceptability import AcceptabilityChecker
  from parlai.crowdsourcing.utils.mturk import get_mturk_id_from_mephisto_wrapper
  from parlai.crowdsourcing.tasks.pairwise_per_turn_eval.bot_agent import PerTurnEvalTurkLikeAgent
label_desc: Use image node_id 3 for calling a global function with example usage: get_bot_worker(opt, model_name) and returns: bot_worker