Upload agents.py
Browse files- tests/agents.py +97 -0
tests/agents.py
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pytest
|
2 |
+
|
3 |
+
|
4 |
+
AGENT_DICTS = {
|
5 |
+
"v1.9": {
|
6 |
+
"tools": [],
|
7 |
+
"model": {
|
8 |
+
"class": "InferenceClientModel",
|
9 |
+
"data": {
|
10 |
+
"last_input_token_count": None,
|
11 |
+
"last_output_token_count": None,
|
12 |
+
"model_id": "Qwen/Qwen2.5-Coder-32B-Instruct",
|
13 |
+
"provider": None,
|
14 |
+
},
|
15 |
+
},
|
16 |
+
"managed_agents": {},
|
17 |
+
"prompt_templates": {
|
18 |
+
"system_prompt": "dummy system prompt",
|
19 |
+
"planning": {
|
20 |
+
"initial_facts": "dummy planning initial facts",
|
21 |
+
"initial_plan": "dummy planning initial plan",
|
22 |
+
"update_facts_pre_messages": "dummy planning update facts pre messages",
|
23 |
+
"update_facts_post_messages": "dummy planning update facts post messages",
|
24 |
+
"update_plan_pre_messages": "dummy planning update plan pre messages",
|
25 |
+
"update_plan_post_messages": "dummy planning update plan post messages",
|
26 |
+
},
|
27 |
+
"managed_agent": {
|
28 |
+
"task": "dummy managed agent task",
|
29 |
+
"report": "dummy managed agent report",
|
30 |
+
},
|
31 |
+
"final_answer": {
|
32 |
+
"pre_messages": "dummy final answer pre messages",
|
33 |
+
"post_messages": "dummy final answer post messages",
|
34 |
+
},
|
35 |
+
},
|
36 |
+
"max_steps": 10,
|
37 |
+
"verbosity_level": 2,
|
38 |
+
"grammar": None,
|
39 |
+
"planning_interval": 2,
|
40 |
+
"name": "test_agent",
|
41 |
+
"description": "dummy description",
|
42 |
+
"requirements": ["smolagents"],
|
43 |
+
"authorized_imports": ["pandas"],
|
44 |
+
},
|
45 |
+
# Added: executor_type, executor_kwargs, max_print_outputs_length
|
46 |
+
"v1.10": {
|
47 |
+
"tools": [],
|
48 |
+
"model": {
|
49 |
+
"class": "InferenceClientModel",
|
50 |
+
"data": {
|
51 |
+
"last_input_token_count": None,
|
52 |
+
"last_output_token_count": None,
|
53 |
+
"model_id": "Qwen/Qwen2.5-Coder-32B-Instruct",
|
54 |
+
"provider": None,
|
55 |
+
},
|
56 |
+
},
|
57 |
+
"managed_agents": {},
|
58 |
+
"prompt_templates": {
|
59 |
+
"system_prompt": "dummy system prompt",
|
60 |
+
"planning": {
|
61 |
+
"initial_facts": "dummy planning initial facts",
|
62 |
+
"initial_plan": "dummy planning initial plan",
|
63 |
+
"update_facts_pre_messages": "dummy planning update facts pre messages",
|
64 |
+
"update_facts_post_messages": "dummy planning update facts post messages",
|
65 |
+
"update_plan_pre_messages": "dummy planning update plan pre messages",
|
66 |
+
"update_plan_post_messages": "dummy planning update plan post messages",
|
67 |
+
},
|
68 |
+
"managed_agent": {
|
69 |
+
"task": "dummy managed agent task",
|
70 |
+
"report": "dummy managed agent report",
|
71 |
+
},
|
72 |
+
"final_answer": {
|
73 |
+
"pre_messages": "dummy final answer pre messages",
|
74 |
+
"post_messages": "dummy final answer post messages",
|
75 |
+
},
|
76 |
+
},
|
77 |
+
"max_steps": 10,
|
78 |
+
"verbosity_level": 2,
|
79 |
+
"grammar": None,
|
80 |
+
"planning_interval": 2,
|
81 |
+
"name": "test_agent",
|
82 |
+
"description": "dummy description",
|
83 |
+
"requirements": ["smolagents"],
|
84 |
+
"authorized_imports": ["pandas"],
|
85 |
+
"executor_type": "local",
|
86 |
+
"executor_kwargs": {},
|
87 |
+
"max_print_outputs_length": None,
|
88 |
+
},
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
@pytest.fixture
|
93 |
+
def get_agent_dict():
|
94 |
+
def _get_agent_dict(agent_dict_key):
|
95 |
+
return AGENT_DICTS[agent_dict_key]
|
96 |
+
|
97 |
+
return _get_agent_dict
|