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

Function main

scripts/run_defects4j_fl.py:13–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 6

runMethod · 0.95
reportMethod · 0.95
FaultLocalizationClass · 0.90
HyperAgentClass · 0.90
getMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected