class_docstr: Handles CRUD operations at the database level for Agents
class_docstr_tok: ["Handles","CRUD","operations","at","the","database","level","for","Agents"]
docstr: Deletes an agent by name.
  
  Parameters:
      agent_name (str): The name of the agent to delete
      project_name (str): The name of the containing project
  
  Raises:
      ValueError: Agent does not exist.
docstr_tok: ["Deletes","an","agent","by","name",".","Parameters",":","agent_name","(","str",")",":","The","name","of","the","agent","to","delete","project_name","(","str",")",":","The","name","of","the","containing","project","Raises",":","ValueError",":","Agent","does","not","exist","."]
code: def delete_agent(
      self, agent_name: str, project_name: str = "mindsdb"
  ):
      """
      Deletes an agent by name.
  
      Parameters:
          agent_name (str): The name of the agent to delete
          project_name (str): The name of the containing project
  
      Raises:
          ValueError: Agent does not exist.
      """
  
      agent = self.get_agent(agent_name, project_name)
      if agent is None:
          raise ValueError(
              f"Agent with name does not exist: {agent_name}"
          )
      db.session.delete(agent)
      db.session.commit()
  
file_path: mindsdb/mindsdb/interfaces/agents/agents_controller.py
imports: from typing import Dict, List
  from mindsdb.interfaces.model.functions import PredictorRecordNotFound
  from mindsdb.interfaces.storage.db import Predictor
  from mindsdb.interfaces.model.model_controller import ModelController
  from mindsdb.interfaces.skills.skills_controller import SkillsController
  from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.database.projects import ProjectController
  from mindsdb.utilities.context import context
  from mindsdb.utilities.config import Config
  from sqlalchemy.orm.attributes import flag_modified
label_desc: Use image node_id 7 for calling the AgentsController obj's underlying member method code with example usage: obj.delete_agent(agent_name, project_name) without return types