forked from BrianLees/agent_c_framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_client
More file actions
executable file
·54 lines (42 loc) · 1.83 KB
/
Copy pathdev_client
File metadata and controls
executable file
·54 lines (42 loc) · 1.83 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
#!/bin/bash
set -e
# Go to the directory containing this script
cd "$(dirname "$0")"
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "Error: Docker is not running. Please start Docker and try again."
exit 1
fi
source build_support/posix.env.sh
# Create directories if they don't exist
mkdir -p "$AGENT_C_CONFIG_PATH"
mkdir -p "$AGENT_C_IMAGES_PATH"
mkdir -p "$AGENT_C_AGENTS_PATH"
mkdir -p "$AGENT_C_SAVED_CHAT_FOLDER"
# Check if config file exists and set up AI keys
if [ ! -f "$AGENT_C_CONFIG_PATH/agent_c.config" ]; then
echo "Creating new configuration file..."
cp config/agent_c.config.example "$AGENT_C_CONFIG_PATH/agent_c.config"
cp data/*.db "$AGENT_C_CONFIG_PATH/"
# Prompt for OpenAI API key
read -p "Please enter your OpenAI API key: " OPENAI_API_KEY
if [ -n "$OPENAI_API_KEY" ]; then
sed -i '' "s/OPENAI_API_KEY=FROM-OPEN-AI/OPENAI_API_KEY=$OPENAI_API_KEY/" "$AGENT_C_CONFIG_PATH/agent_c.config"
fi
# Prompt for Anthropic API key
read -p "Please enter your Anthropic API key (press Enter to skip): " ANTHROPIC_API_KEY
if [ -n "$ANTHROPIC_API_KEY" ]; then
sed -i '' "s/^#ANTHROPIC_API_KEY=.*/ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY/" "$AGENT_C_CONFIG_PATH/agent_c.config"
fi
echo "Configuration file has been created at $AGENT_C_CONFIG_PATH/agent_c.config"
echo "Please review and edit the configuration file if needed."
echo ""
read -p "Press Enter to continue..."
fi
# Set platform for Docker based on architecture
export DOCKER_DEFAULT_PLATFORM="linux/amd64" # Default to amd64
if [ "$(uname -m)" = "arm64" ]; then
export DOCKER_DEFAULT_PLATFORM="linux/arm64"
fi
# Run in docker compose with any supplied arguments
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose-client-only.yml -p agent_c_dev_client "$@"