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