diff --git a/tools/test_instruction.sh b/tools/test_instruction.sh new file mode 100755 index 000000000..9432c729c --- /dev/null +++ b/tools/test_instruction.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Test de l'endpoint instruction en langage naturel +# Usage : ./tools/test_instruction.sh "ouvre le dossier Demo sur le bureau" + +INSTRUCTION="${1:-ouvre le dossier Demo sur le bureau}" +API="http://localhost:5002/api/v3" + +echo "🧠 Instruction : $INSTRUCTION" +echo "" + +# Lancer l'instruction +RESULT=$(curl -s -X POST "$API/execute/instruction" \ + -H "Content-Type: application/json" \ + -d "{\"instruction\": \"$INSTRUCTION\"}") + +echo "📤 Réponse : $RESULT" +echo "" + +# Polling du résultat +echo "⏳ En attente du résultat..." +for i in $(seq 1 60); do + sleep 2 + STATUS=$(curl -s "$API/execute/instruction/result") + RUNNING=$(echo "$STATUS" | python3 -c "import json,sys; print(json.load(sys.stdin).get('is_running', False))" 2>/dev/null) + + if [ "$RUNNING" = "False" ]; then + echo "" + echo "✅ Terminé !" + echo "$STATUS" | python3 -m json.tool 2>/dev/null + exit 0 + fi + + echo -n "." +done + +echo "" +echo "⚠️ Timeout après 2 minutes" diff --git a/visual_workflow_builder/backend/instance/workflows.db b/visual_workflow_builder/backend/instance/workflows.db index edcdbb089..7f74e27ff 100644 Binary files a/visual_workflow_builder/backend/instance/workflows.db and b/visual_workflow_builder/backend/instance/workflows.db differ