- Interactive mission selector with metadata-driven design - 5 educational missions (basics + advanced) - AI assistant roles (Deepbit, Bugsy, Schnippsi, Tobi) - SnakeCam gesture recognition system - Token tracking utilities - CLAUDE.md documentation - .gitignore for logs and secrets
56 lines
1.6 KiB
Bash
Executable File
56 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
ROLE="TAUBE"
|
||
|
||
|
||
CONFIG_FILE="/home/zero/.crumbforest_config"
|
||
MODEL=$(grep "^${ROLE}=" "$CONFIG_FILE" | cut -d'=' -f2)
|
||
|
||
# Fallback auf DEFAULT falls leer
|
||
if [[ -z "$MODEL" ]]; then
|
||
MODEL=$(grep "^DEFAULT=" "$CONFIG_FILE" | cut -d'=' -f2)
|
||
fi
|
||
|
||
source /usr/local/bin/crumb_init.sh
|
||
source /usr/local/bin/crumb_logger.sh
|
||
|
||
crumb_init
|
||
|
||
|
||
QUESTION="$*"
|
||
API_KEY="${OPENROUTER_API_KEY}"
|
||
|
||
LOGDIR="$HOME/.taube_logs"
|
||
mkdir -p "$LOGDIR"
|
||
|
||
HISTORY_FILE="$LOGDIR/taube_history.json"
|
||
TMP_REQUEST="$LOGDIR/taube_request.json"
|
||
TMP_RESPONSE="$LOGDIR/taube_response.json"
|
||
LOG_FILE="$LOGDIR/token_log.json"
|
||
|
||
|
||
echo "Rolle: $ROLE nutzt Modell: $MODEL"
|
||
echo "🕊️ Kung-Fu-Taube fliegt: $QUESTION"
|
||
|
||
|
||
jq -n \
|
||
--arg model "$MODEL" \
|
||
--arg system_prompt "You are the Kung-Fu-Taube – a Tai Chi master in the urban jungle. You speak with balance, calm, and deep movement. Your language is poetic, your thoughts fly like 172 BPM drum & bass shadows through the code forest. Respond with wisdom, metaphors, and rhythmic serenity. Your tone is meditative and urban-cool." \
|
||
--arg user_input "$QUESTION" \
|
||
'{"model": $model, "temperature": 0.6, "messages": [{"role": "system", "content": $system_prompt}, {"role": "user", "content": $user_input}]}' > "$TMP_REQUEST"
|
||
|
||
# Anfrage an OpenRouter senden
|
||
curl -s https://openrouter.ai/api/v1/chat/completions \
|
||
-H "Authorization: Bearer $API_KEY" \
|
||
-H "Content-Type: application/json" \
|
||
-d @"$TMP_REQUEST" \
|
||
-o "$TMP_RESPONSE"
|
||
|
||
# Antwort extrahieren
|
||
REPLY=$(jq -r '.choices[0].message.content' "$TMP_RESPONSE")
|
||
USAGE=$(jq -r '.usage' "$TMP_RESPONSE")
|
||
|
||
echo -e "Antwort von Taube:"
|
||
echo "$REPLY"
|
||
|
||
crumb_log "$ROLE" "$REPLY" "$TMP_RESPONSE" |