mirror of
https://github.com/katanemo/plano.git
synced 2026-05-12 01:02:56 +02:00
run demos without docker, keep docker optional via --with-ui
This commit is contained in:
parent
b9f01c8471
commit
1285bd083d
33 changed files with 447 additions and 316 deletions
|
|
@ -1,15 +1,4 @@
|
|||
services:
|
||||
rag_energy_source_agent:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "18083:80"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl" ,"http://localhost:80/healthz"]
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
anythingllm:
|
||||
image: mintplexlabs/anythingllm
|
||||
restart: always
|
||||
|
|
|
|||
12
demos/advanced/multi_turn_rag/pyproject.toml
Normal file
12
demos/advanced/multi_turn_rag/pyproject.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[project]
|
||||
name = "multi-turn-rag"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"fastapi",
|
||||
"uvicorn",
|
||||
"pydantic>=2.8",
|
||||
"httpx>=0.27",
|
||||
"openai>=1.51",
|
||||
"python-dotenv>=1.0",
|
||||
]
|
||||
|
|
@ -22,18 +22,27 @@ start_demo() {
|
|||
echo "Starting Plano with config.yaml..."
|
||||
planoai up config.yaml
|
||||
|
||||
# Step 4: Start Network Agent
|
||||
echo "Starting HR Agent using Docker Compose..."
|
||||
docker compose up -d # Run in detached mode
|
||||
# Step 4: Start agents natively
|
||||
echo "Starting agents..."
|
||||
bash start_agents.sh &
|
||||
|
||||
# Step 5: Optionally start UI services (AnythingLLM)
|
||||
if [ "$1" == "--with-ui" ]; then
|
||||
echo "Starting UI services (AnythingLLM)..."
|
||||
docker compose up -d
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to stop the demo
|
||||
stop_demo() {
|
||||
# Step 1: Stop Docker Compose services
|
||||
echo "Stopping HR Agent using Docker Compose..."
|
||||
docker compose down -v
|
||||
# Stop agents
|
||||
echo "Stopping agents..."
|
||||
pkill -f start_agents.sh 2>/dev/null || true
|
||||
|
||||
# Step 2: Stop Plano
|
||||
# Stop Docker Compose services if running
|
||||
docker compose down 2>/dev/null || true
|
||||
|
||||
# Stop Plano
|
||||
echo "Stopping Plano..."
|
||||
planoai down
|
||||
}
|
||||
|
|
@ -42,6 +51,5 @@ stop_demo() {
|
|||
if [ "$1" == "down" ]; then
|
||||
stop_demo
|
||||
else
|
||||
# Default action is to bring the demo up
|
||||
start_demo
|
||||
start_demo "$1"
|
||||
fi
|
||||
|
|
|
|||
24
demos/advanced/multi_turn_rag/start_agents.sh
Executable file
24
demos/advanced/multi_turn_rag/start_agents.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
PIDS=()
|
||||
|
||||
log() { echo "$(date '+%F %T') - $*"; }
|
||||
|
||||
cleanup() {
|
||||
log "Stopping agents..."
|
||||
for PID in "${PIDS[@]}"; do
|
||||
kill $PID 2>/dev/null && log "Stopped process $PID"
|
||||
done
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
log "Starting rag_energy_source_agent on port 18083..."
|
||||
uv run uvicorn main:app --host 0.0.0.0 --port 18083 &
|
||||
PIDS+=($!)
|
||||
|
||||
for PID in "${PIDS[@]}"; do
|
||||
wait "$PID"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue