Repository navigation
Expand file tree
/
Copy pathtest_chatbot.sh
More file actions
executable file
·47 lines (37 loc) · 1.7 KB
/
Copy pathtest_chatbot.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.7 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
#!/bin/bash
# Test script for chatbot example
THREAD_ID="test-$(date +%s)"
BASE_URL="${DURAGRAPH_URL:-http://localhost:8081}"
echo "=========================================="
echo "Testing DuraGraph Chatbot with Memory"
echo "=========================================="
echo "Thread ID: $THREAD_ID"
echo "Control Plane: $BASE_URL"
echo ""
# Message 1
echo "→ Message 1: Hello"
curl -s -X POST "$BASE_URL/api/v1/runs" \
-H "Content-Type: application/json" \
-d "{\"assistant_id\": \"chatbot\", \"thread_id\": \"$THREAD_ID\", \"input\": {\"input\": \"Hello\", \"thread_id\": \"$THREAD_ID\"}}" | jq -r '.run_id'
sleep 2
# Message 2
echo "→ Message 2: What is your name?"
curl -s -X POST "$BASE_URL/api/v1/runs" \
-H "Content-Type: application/json" \
-d "{\"assistant_id\": \"chatbot\", \"thread_id\": \"$THREAD_ID\", \"input\": {\"input\": \"What is your name?\", \"thread_id\": \"$THREAD_ID\"}}" | jq -r '.run_id'
sleep 2
# Message 3
echo "→ Message 3: How many messages have we exchanged?"
curl -s -X POST "$BASE_URL/api/v1/runs" \
-H "Content-Type: application/json" \
-d "{\"assistant_id\": \"chatbot\", \"thread_id\": \"$THREAD_ID\", \"input\": {\"input\": \"How many messages have we exchanged?\", \"thread_id\": \"$THREAD_ID\"}}" | jq -r '.run_id'
sleep 2
# Message 4
echo "→ Message 4: Goodbye"
curl -s -X POST "$BASE_URL/api/v1/runs" \
-H "Content-Type: application/json" \
-d "{\"assistant_id\": \"chatbot\", \"thread_id\": \"$THREAD_ID\", \"input\": {\"input\": \"Goodbye\", \"thread_id\": \"$THREAD_ID\"}}" | jq -r '.run_id'
echo ""
echo "=========================================="
echo "Test complete! Check worker logs for conversation."
echo "=========================================="