class_docstr: Handles CRUD operations at the database level for Chatbots
class_docstr_tok: ["Handles","CRUD","operations","at","the","database","level","for","Chatbots"]
docstr: Gets all chatbots in a project.
  
  Parameters:
      project_name (str): The name of the containing project
  
  Returns:
      all_bots (List[db.ChatBots]): List of database chatbot object
docstr_tok: ["Gets","all","chatbots","in","a","project",".","Parameters",":","project_name","(","str",")",":","The","name","of","the","containing","project","Returns",":","all_bots","(","List","[","db.ChatBots","]",")",":","List","of","database","chatbot","object"]
code: def get_chatbots(self, project_name: str = "mindsdb") -> List[dict]:
      """
      Gets all chatbots in a project.
  
      Parameters:
          project_name (str): The name of the containing project
  
      Returns:
          all_bots (List[db.ChatBots]): List of database chatbot object
      """
  
      project = self.project_controller.get(name=project_name)
  
      query = (
          db.session.query(db.ChatBots, db.Tasks)
          .join(db.Tasks, db.ChatBots.id == db.Tasks.object_id)
          .filter(
              db.ChatBots.project_id == project.id,
              db.Tasks.object_type == self.OBJECT_TYPE,
              db.Tasks.company_id == ctx.company_id,
          )
      )
  
      session = SessionController()
      database_names = {
          i["id"]: i["name"]
          for i in session.database_controller.get_list()
      }
  
      bots = []
      for bot, task in query.all():
          agent = self.agents_controller.get_agent_by_id(bot.agent_id)
          agent_obj = agent.as_dict() if agent is not None else None
          bots.append(
              {
                  "id": bot.id,
                  "name": bot.name,
                  "project": project_name,
                  "agent": agent_obj,
                  "database_id": bot.database_id,  # TODO remove in future
                  "database": database_names.get(bot.database_id, "?"),
                  "model_name": bot.model_name,
                  "params": bot.params,
                  "created_at": bot.created_at,
                  "is_running": task.active,
                  "last_error": task.last_error,
              }
          )
  
      return bots
  
file_path: mindsdb/mindsdb/interfaces/chatbot/chatbot_controller.py
imports: from typing import Dict, List
  from mindsdb.interfaces.agents.agents_controller import AgentsController
  from mindsdb.interfaces.database.projects import ProjectController
  from mindsdb.interfaces.storage import db
  from mindsdb.utilities.context import context
  from mindsdb.api.executor.controllers.session_controller import SessionController
  from mindsdb.utilities.config import Config
label_desc: Use image node_id 3 for calling the ChatBotController obj's underlying member method code with example usage: obj.get_chatbots(project_name) and returns: bots