#!/usr/bin/env bash
set -e

PROJECT="$HOME/esarobotech/r1"
CONDA="$HOME/miniconda3"

INTERFACE="${1:-enp3s0}"

WHISPER="$HOME/esarobotech/whisper.cpp/build/bin/whisper-cli"
MODEL="$HOME/esarobotech/whisper.cpp/models/ggml-medium.bin"
LLM_URL="http://127.0.0.1:8080/v1/chat/completions"

source "$CONDA/etc/profile.d/conda.sh"
conda activate ai_robot

cd "$PROJECT"

echo "[R1] Starting voice assistant"
echo "[R1] Interface: $INTERFACE"
echo "[R1] Whisper:   $MODEL"
echo "[R1] LLM:       $LLM_URL"

exec ./build/r1_voice \
    "$INTERFACE" \
    "$WHISPER" \
    "$MODEL" \
    "$LLM_URL"
