-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_demo.sh
executable file
·49 lines (35 loc) · 1.48 KB
/
run_demo.sh
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
48
49
#!/bin/bash
# If using standard Claude API source
# export COMPUTER_USE_MODEL="claude-3-5-sonnet-20241022"
# If using AWS Bedrock
export COMPUTER_USE_MODEL="anthropic.claude-3-5-sonnet-20241022-v2:0"
export AWS_PROFILE="range-dev"
export AWS_REGION="us-west-2"
# This secret was generated using the following command:
# echo -n "ThisIsATest" | md5sum
# The secret is shared with the Docker container
SECRET_KEY='4c0b569e4c96df157eee1b65dd0e4d41'
COMPUTER_USE_SECRET=$(./encrypt-json.sh $SECRET_KEY ./connections/computer-use.json)
HUMAN_SECRET=$(./encrypt-json.sh $SECRET_KEY ./connections/human.json)
docker-compose up -d
echo "Waiting for Guacamole to start..."
sleep 2
get_token() {
curl -s --data-urlencode "data=$1" http://localhost:8080/guacamole/api/tokens | jq -r '.authToken'
}
COMPUTER_USE_TOKEN=$(get_token $COMPUTER_USE_SECRET)
HUMAN_TOKEN=$(get_token $HUMAN_SECRET)
COMPUTER_USE_URL="http://localhost:8080/guacamole/?token=${COMPUTER_USE_TOKEN}"
HUMAN_URL="http://localhost:8080/guacamole/?token=${HUMAN_TOKEN}"
echo -n "What would you like the computer to do? "
read COMPUTER_PROMPT
echo
echo "Watch the computer use session at: $HUMAN_URL"
echo
echo "Note: the session will fail to connect at first, since computer use hasn't started."
echo "Open the link in your browser and then press Enter to continue..."
read
echo "Begin attempting to reconnect to the session now. Starting any moment..."
source ./venv/bin/activate
cd src
python main.py $COMPUTER_USE_URL "$COMPUTER_PROMPT"