-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·69 lines (58 loc) · 1.89 KB
/
setup.sh
File metadata and controls
executable file
·69 lines (58 loc) · 1.89 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Setup script for A2A Ruby samples
set -e
echo "🚀 Setting up A2A Ruby Samples..."
# Check if Ruby is installed
if ! command -v ruby &> /dev/null; then
echo "❌ Ruby is not installed. Please install Ruby 2.7+ first."
exit 1
fi
# Check if Bundler is installed
if ! command -v bundle &> /dev/null; then
echo "📦 Installing Bundler..."
gem install bundler
fi
# A2A Ruby gem will be installed from GitHub via Bundler
echo "📦 A2A Ruby gem will be installed from GitHub repository via Bundler"
# Install dependencies for all samples
echo "📚 Installing dependencies for all samples..."
samples=(
"samples/helloworld-agent"
"samples/dice-agent"
"samples/weather-agent"
)
for sample in "${samples[@]}"; do
if [ -d "$sample" ]; then
echo "📦 Installing dependencies for $sample..."
cd "$sample"
# Check if .env.example exists and .env doesn't
if [ -f ".env.example" ] && [ ! -f ".env" ]; then
echo " 📝 Creating .env file from .env.example"
cp .env.example .env
echo " ⚠️ Please edit .env and configure your API keys"
fi
bundle install
cd - > /dev/null
echo "✅ $sample ready"
fi
done
echo ""
echo "🎉 Setup complete! You can now run the samples:"
echo ""
echo " 🌟 Start with Hello World:"
echo " cd samples/helloworld-agent && ruby server.rb"
echo ""
echo " 🎲 Try the Dice Agent:"
echo " cd samples/dice-agent && ruby server.rb"
echo ""
echo " 🌤️ Weather Agent (requires API key):"
echo " cd samples/weather-agent"
echo " # Edit .env and add WEATHER_API_KEY"
echo " ruby server.rb"
echo ""
echo " 🧪 Test any agent:"
echo " ruby client.rb"
echo " ruby client.rb --interactive"
echo ""
echo "🔗 Get weather API key: https://openweathermap.org/api"
echo "💡 For cross-stack testing, see README.md"