-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch.sh
More file actions
executable file
·99 lines (87 loc) · 2.61 KB
/
launch.sh
File metadata and controls
executable file
·99 lines (87 loc) · 2.61 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
#!/bin/bash
# Arithmax Research Agent - Launcher
# Supports both CLI and Web modes
echo "FeenQR"
echo "======================="
echo ""
# Check if we're in the right directory
if [ ! -f "QuantResearchAgent.csproj" ]; then
echo " Error: Please run this script from the FeenQR root directory"
exit 1
fi
# Function to check if Qdrant is running
check_qdrant() {
if curl -s http://localhost:6333/health >/dev/null 2>&1; then
return 0
else
return 1
fi
}
# Function to start Qdrant
start_qdrant() {
echo " Checking Qdrant vector database..."
if check_qdrant; then
echo " Qdrant is already running"
else
echo " Starting Qdrant container..."
if command -v docker >/dev/null 2>&1; then
# Check if container exists
if docker ps -a --format '{{.Names}}' | grep -q "^qdrant$"; then
docker start qdrant
else
docker run -d --name qdrant \
-p 6333:6333 -p 6334:6334 \
-v "$(pwd)/qdrant_storage:/qdrant/storage" \
qdrant/qdrant
fi
# Wait for Qdrant to be ready
echo " Waiting for Qdrant to be ready..."
for i in {1..30}; do
if check_qdrant; then
echo " Qdrant is ready"
break
fi
sleep 1
done
if ! check_qdrant; then
echo " Warning: Qdrant may not be ready. Continuing anyway..."
fi
else
echo " Warning: Docker not found. Please start Qdrant manually:"
echo " docker run -p 6333:6333 -p 6334:6334 -v \$(pwd)/qdrant_storage:/qdrant/storage qdrant/qdrant"
fi
fi
echo ""
}
# Start Qdrant for both modes
start_qdrant
# Check for mode argument
MODE="cli"
if [ "$1" = "web" ]; then
MODE="web"
fi
if [ "$MODE" = "web" ]; then
echo " Starting Web interface..."
echo " Checking for webapp..."
if [ ! -d "WebApp" ]; then
echo " Error: Webapp not found at WebApp"
echo " Please ensure the webapp is built and available."
exit 1
fi
echo " Webapp will be available at http://localhost:5228"
echo ""
cd WebApp/Server
dotnet run
else
echo " Building backend..."
dotnet build QuantResearchAgent.csproj
if [ $? -ne 0 ]; then
echo " Backend build failed. Please check for errors."
exit 1
fi
echo " Backend built successfully"
echo ""
echo " Starting CLI interface..."
echo ""
dotnet run --project QuantResearchAgent.csproj
fi