@@ -227,30 +227,27 @@ def _perform_load(self, agent_name: str) -> Union[BaseAgent, App]:
227227 # Check if user might be in the wrong directory
228228 hint = ""
229229 agents_path = Path (agents_dir )
230- if agents_path .joinpath ("agent.py" ).is_file () or agents_path .joinpath (
231- "root_agent.yaml"
232- ).is_file ():
230+ if (
231+ agents_path .joinpath ("agent.py" ).is_file ()
232+ or agents_path .joinpath ("root_agent.yaml" ).is_file ()
233+ ):
233234 hint = (
234- "\n \n HINT: It looks like you might be running 'adk web' from inside an "
235- " agent directory. Try running 'adk web .' from the parent directory "
236- " that contains your agent folder, not from within the agent folder "
237- " itself."
235+ "\n \n HINT: It looks like you might be running 'adk web' from inside"
236+ " an agent directory. Try running 'adk web .' from the parent"
237+ " directory that contains your agent folder, not from within the"
238+ " agent folder itself."
238239 )
239240
240241 raise ValueError (
241242 f"No root_agent found for '{ agent_name } '. Searched in"
242243 f" '{ actual_agent_name } .agent.root_agent',"
243244 f" '{ actual_agent_name } .root_agent' and"
244- f" '{ actual_agent_name } /root_agent.yaml'."
245- f"\n \n Expected directory structure:"
246- f"\n <agents_dir>/"
247- f"\n { actual_agent_name } /"
248- f"\n agent.py (with root_agent) OR"
249- f"\n root_agent.yaml"
250- f"\n \n Then run: adk web <agents_dir>"
251- f"\n \n Ensure '{ agents_dir } /{ actual_agent_name } ' is structured correctly,"
252- " an .env file can be loaded if present, and a root_agent is exposed."
253- f"{ hint } "
245+ f" '{ actual_agent_name } /root_agent.yaml'.\n \n Expected directory"
246+ f" structure:\n <agents_dir>/\n { actual_agent_name } /\n "
247+ " agent.py (with root_agent) OR\n root_agent.yaml\n \n Then run:"
248+ f" adk web <agents_dir>\n \n Ensure '{ agents_dir } /{ actual_agent_name } ' is"
249+ " structured correctly, an .env file can be loaded if present, and a"
250+ f" root_agent is exposed.{ hint } "
254251 )
255252
256253 def _ensure_app_name_matches (
0 commit comments