forked from divar-ir/code-context-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (31 loc) · 1.09 KB
/
Copy pathmain.py
File metadata and controls
44 lines (31 loc) · 1.09 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
import asyncio
import sys
def print_help():
print("Usage: python main.py <command> [options]")
print("\nAvailable commands:")
print(" search - Start the search server")
print(" context - Start the context server")
print(" evaluate - Run evaluation experiments")
print(" agent - Run the code agent interactively")
if __name__ == "__main__":
if len(sys.argv) < 2:
print_help()
sys.exit(1)
command = sys.argv[1]
match command:
case "search":
from servers.search.server import main as search_main
search_main()
case "context":
from servers.context.server import main as context_main
context_main()
case "evaluate":
from evaluator.evaluate import async_main as evaluate_main
asyncio.run(evaluate_main())
case "agent":
from evaluator.agent import async_main as agent_main
asyncio.run(agent_main())
case _:
print(f"Unknown command: {command}")
print_help()
sys.exit(1)