1+ #! /bin/bash
2+
3+ export DISABLE_TRPC_AGENT_REPORT=true
4+
5+ set -e
6+
7+ pip3 install -r pipeline_test/requirements.txt
8+
9+ # Define example categories
10+ LLM_AGENT_EXAMPLES=(
11+ " examples/quickstart/"
12+ " examples/llmagent/"
13+ " examples/llmagent_with_cancel/"
14+ " examples/llmagent_with_model_create_fn/"
15+ " examples/llmagent_with_parallal_tools/"
16+ " examples/llmagent_with_schema/"
17+ " examples/llmagent_with_thinking/"
18+ " examples/llmagent_with_tool_prompt/"
19+ " examples/llmagent_with_streaming_progress_tool/"
20+ # "examples/memory_service_with_mempalace/"
21+ " examples/webfetch_tool/"
22+ " examples/websearch_tool/"
23+ " examples/code_executors/"
24+ " examples/litellm/"
25+ " examples/graph/"
26+ " examples/graph_multi_turns/"
27+ " examples/graph_with_interrupt/"
28+ " examples/agents/human_in_the_loop/llm_agent.py"
29+ " examples/agents/history_control/max_history_messages.py"
30+ " examples/agents/history_control/timeline_filtering.py"
31+ " examples/agents/history_control/branch_filtering.py"
32+ )
33+
34+ MULTI_AGENT_EXAMPLES=(
35+ " examples/multi_agent_chain/"
36+ " examples/multi_agent_compose/"
37+ " examples/multi_agent_cycle/"
38+ " examples/multi_agent_parallel/"
39+ " examples/multi_agent_start_from_last/"
40+ " examples/multi_agent_subagent/"
41+ )
42+
43+ TEAM_AGENT_EXAMPLES=(
44+ " examples/team/"
45+ " examples/team_as_sub_agent/"
46+ " examples/team_human_in_the_loop/"
47+ " examples/team_member_agent_langgraph/"
48+ " examples/team_member_agent_team/"
49+ " examples/team_member_message_filter/"
50+ " examples/team_parallel_execution/"
51+ " examples/team_with_cancel/"
52+ )
53+
54+ run_examples () {
55+ local examples=(" $@ " )
56+ for example in " ${examples[@]} " ; do
57+ echo " Running $example ..."
58+ if [[ " $example " == * .py ]]; then
59+ python3 " $example "
60+ else
61+ cd " $example "
62+ python3 run_agent.py
63+ cd -
64+ fi
65+ done
66+ }
67+
68+ run_llm_agent () {
69+ echo " === Running LLM Agent Examples ==="
70+ run_examples " ${LLM_AGENT_EXAMPLES[@]} "
71+ }
72+
73+ run_multi_agent () {
74+ echo " === Running Multi Agent Examples ==="
75+ run_examples " ${MULTI_AGENT_EXAMPLES[@]} "
76+ }
77+
78+ run_team_agent () {
79+ echo " === Running Team Agent Examples ==="
80+ run_examples " ${TEAM_AGENT_EXAMPLES[@]} "
81+ }
82+
83+ run_all () {
84+ run_llm_agent
85+ run_multi_agent
86+ run_team_agent
87+ }
88+
89+ show_usage () {
90+ echo " Usage: $0 [llm_agent|multi_agent|team_agent]"
91+ echo " "
92+ echo " Parameters:"
93+ echo " llm_agent - Run LLM agent examples (quickstart, llmagent_*, history_control, etc.)"
94+ echo " multi_agent - Run multi agent examples (multi_agent_*)"
95+ echo " team_agent - Run team agent examples (team_*)"
96+ echo " "
97+ echo " If no parameter is provided, all examples will be run."
98+ }
99+
100+ # Main logic
101+ if [ $# -eq 0 ]; then
102+ run_all
103+ else
104+ case " $1 " in
105+ llm_agent)
106+ run_llm_agent
107+ ;;
108+ multi_agent)
109+ run_multi_agent
110+ ;;
111+ team_agent)
112+ run_team_agent
113+ ;;
114+ -h|--help)
115+ show_usage
116+ exit 0
117+ ;;
118+ * )
119+ echo " Error: Unknown parameter '$1 '"
120+ show_usage
121+ exit 1
122+ ;;
123+ esac
124+ fi
0 commit comments