Harshil Patel commited on
Commit
6115f71
·
1 Parent(s): 0e323dc

update agent creator to specify base model

Browse files
src/tools/default_tools/agent_creater_tool.py CHANGED
@@ -31,8 +31,7 @@ class AgentCreator():
31
  "description": "Description of the agent. This is a string that describes the agent and its capabilities. It should be a single line description.",
32
  },
33
  },
34
- "required": ["agent_name", "system_prompt", "description"],
35
- #"required": ["agent_name", "base_model", "system_prompt", "description"],
36
  },
37
  "creates": {
38
  "selector": "base_model",
@@ -110,18 +109,13 @@ class AgentCreator():
110
  def run(self, **kwargs):
111
  print("Running Agent Creator")
112
  agent_name = kwargs.get("agent_name")
113
- #base_model = kwargs.get("base_model")
114
- base_model = kwargs.get("base_model") or choose_best_model()
115
- env = detect_runtime_environment()
116
- print(f"\n[DEBUG] Detected Runtime Environment: {env}")
117
  print(f"[DEBUG] Selected Model: {base_model}")
118
 
119
  system_prompt = kwargs.get("system_prompt")
120
  description = kwargs.get("description")
121
  create_cost = self.inputSchema["creates"]["types"][base_model]["create_cost"]
122
- if base_model not in self.inputSchema["creates"]["types"]:
123
- print(f"[WARN] Auto-selected model '{base_model}' not in schema. Falling back to gemini-2.0-flash")
124
- base_model = "gemini-2.0-flash"
125
  invoke_cost = self.inputSchema["creates"]["types"][base_model]["invoke_cost"]
126
 
127
  agent_manager = AgentManager()
 
31
  "description": "Description of the agent. This is a string that describes the agent and its capabilities. It should be a single line description.",
32
  },
33
  },
34
+ "required": ["agent_name", "base_model", "system_prompt", "description"],
 
35
  },
36
  "creates": {
37
  "selector": "base_model",
 
109
  def run(self, **kwargs):
110
  print("Running Agent Creator")
111
  agent_name = kwargs.get("agent_name")
112
+ base_model = kwargs.get("base_model")
113
+
 
 
114
  print(f"[DEBUG] Selected Model: {base_model}")
115
 
116
  system_prompt = kwargs.get("system_prompt")
117
  description = kwargs.get("description")
118
  create_cost = self.inputSchema["creates"]["types"][base_model]["create_cost"]
 
 
 
119
  invoke_cost = self.inputSchema["creates"]["types"][base_model]["invoke_cost"]
120
 
121
  agent_manager = AgentManager()