@@ -486,19 +486,26 @@ def add_database(self, name: str, database: str, tables: List[str], description:
486486 self .update (agent .name , agent )
487487
488488 def create (
489- self ,
490- name : str ,
491- model : Union [Model , dict , str ] = None ,
492- provider : str = None ,
493- skills : List [Union [Skill , str ]] = None ,
494- params : dict = None ,
495- ** kwargs ) -> Agent :
489+ self ,
490+ name : str ,
491+ model_name : Union [Model , str ] = None ,
492+ provider : str = None ,
493+ skills : List [Union [Skill , str ]] = None ,
494+ data : dict = None ,
495+ model : dict = None ,
496+ prompt_template : str = None ,
497+ params : dict = None ,
498+ ** kwargs
499+ ) -> Agent :
496500 """
497501 Create new agent and return it
498502
499503 :param name: Name of the agent to be created
500- :param model: Model to be used by the agent
504+ :param model_name: MindsDB model to be used by the agent
501505 :param skills: List of skills to be used by the agent. Currently only 'sql' is supported.
506+ :param provider: Provider of the model, e.g. 'mindsdb', 'openai', etc.
507+ :param data: Data to be used by the agent. This is usually a dictionary with 'tables' and/or 'knowledge_base' keys.
508+ :param model: Model parameters to be used by the agent. This is usually a dictionary
502509 :param params: Parameters for the agent
503510
504511 :return: created agent object
@@ -519,18 +526,23 @@ def create(
519526 if params is None :
520527 params = {}
521528 params .update (kwargs )
522-
523- if 'prompt_template' not in params :
524- params ['prompt_template' ] = _DEFAULT_LLM_PROMPT
525-
526- if model is None :
527- model = _DEFAULT_LLM_MODEL
528- elif isinstance (model , Model ):
529- model = model .name
529+
530+ if isinstance (model_name , Model ):
531+ model_name = model_name .name
530532 provider = 'mindsdb'
531533
532- data = self .api .create_agent (self .project .name , name , model , provider , skill_names , params )
533- return Agent .from_json (data , self )
534+ agent = self .api .create_agent (
535+ self .project .name ,
536+ name ,
537+ model_name ,
538+ provider ,
539+ skill_names ,
540+ data ,
541+ model ,
542+ prompt_template ,
543+ params
544+ )
545+ return Agent .from_json (agent , self )
534546
535547 def update (self , name : str , updated_agent : Agent ):
536548 """
0 commit comments