MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / main

Function main

scripts/run_defects4j_apr.py:20–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 return parser.parse_args()
19
20def main():
21 args = get_args()
22
23 config = {
24 "name": "claude",
25 "nav": [{
26 "model": "claude-3-haiku-20240307",
27 "api_type": os.environ.get("ANTHROPIC_API_KEY"),
28 "stop_sequences": ["\nObservation:"],
29 "base_url": "https://api.anthropic.com",
30 "api_type": "anthropic",
31 }],
32 "edit": [{
33 "model": "claude-3-5-sonnet-20240620",
34 "api_type": os.environ.get("ANTHROPIC_API_KEY"),
35 "stop_sequences": ["\nObservation:"],
36 "price": [0.003, 0.015],
37 "base_url": "https://api.anthropic.com",
38 "api_type": "anthropic",
39 }],
40 "exec": [{
41 "model": "claude-3-haiku-20240307",
42 "api_type": os.environ.get("ANTHROPIC_API_KEY"),
43 "stop_sequences": ["\nObservation:"],
44 "price": [0.003, 0.015],
45 "base_url": "https://api.anthropic.com",
46 "api_type": "anthropic",
47 }],
48 "plan": [{
49 "model": "claude-3-5-sonnet-20240620",
50 "api_type": os.environ.get("ANTHROPIC_API_KEY"),
51 "price": [0.003, 0.015],
52 "base_url": "https://api.anthropic.com",
53 "api_type": "anthropic",
54 }],
55 "type": "patch"
56 }
57
58 task = AutomatedProgramRepair(logdir="results/defects4j_apr", split="test", max_repetitions=1, max_num_tests=2, defects4j=D4J_FOLDER)
59 result_list = []
60 for idx in range(len(task)):
61 repo_dir = task[idx]
62 pilot = HyperAgent(
63 repo_path=repo_dir,
64 commit="",
65 language="java",
66 llm_configs=config,
67 verbose=2,
68 )
69 result = task.run(pilot, idx)
70 result_list.append(result)
71 performance_table = task.report(result_list)
72 print(performance_table)
73
74if __name__ == "__main__":
75 main()

Callers 1

Calls 7

runMethod · 0.95
reportMethod · 0.95
HyperAgentClass · 0.90
getMethod · 0.80
appendMethod · 0.80
get_argsFunction · 0.70

Tested by

no test coverage detected