Skip to content

Commit e3b42aa

Browse files
committed
fix(cli): Apply pyink formatting to agent_loader.py
Reformatted code to comply with pyink style guide: - Line length limits enforced - Multi-line conditional formatting improved - String concatenation formatting optimized Addresses lint check failure in PR google#3196.
1 parent 579c1ad commit e3b42aa

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

src/google/adk/cli/utils/agent_loader.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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\nHINT: 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\nHINT: 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\nExpected 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\nThen run: adk web <agents_dir>"
251-
f"\n\nEnsure '{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\nExpected directory"
246+
f" structure:\n <agents_dir>/\n {actual_agent_name}/\n "
247+
" agent.py (with root_agent) OR\n root_agent.yaml\n\nThen run:"
248+
f" adk web <agents_dir>\n\nEnsure '{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

Comments
 (0)