Skip to content

Commit 638c956

Browse files
authored
Merge pull request #1365 from Torantulino/master
Merge into Stable for PR batch 4 v0.1.3
2 parents 2a7bc5c + a17a850 commit 638c956

29 files changed

+1085
-353
lines changed

.devcontainer/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
2+
ARG VARIANT=3-bullseye
3+
FROM python:3.8
4+
5+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
7+
&& apt-get purge -y imagemagick imagemagick-6-common
8+
9+
# Temporary: Upgrade python packages due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
10+
# They are installed by the base image (python) which does not have the patch.
11+
RUN python3 -m pip install --upgrade setuptools
12+
13+
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
14+
# COPY requirements.txt /tmp/pip-tmp/
15+
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
16+
# && rm -rf /tmp/pip-tmp
17+
18+
# [Optional] Uncomment this section to install additional OS packages.
19+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
20+
# && apt-get -y install --no-install-recommends <your-package-list-here>
21+
22+
# [Optional] Uncomment this line to install global node packages.
23+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"build": {
3+
"dockerfile": "./Dockerfile",
4+
"context": "."
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/common-utils:2": {
8+
"installZsh": "true",
9+
"username": "vscode",
10+
"userUid": "1000",
11+
"userGid": "1000",
12+
"upgradePackages": "true"
13+
},
14+
"ghcr.io/devcontainers/features/python:1": "none",
15+
"ghcr.io/devcontainers/features/node:1": "none",
16+
"ghcr.io/devcontainers/features/git:1": {
17+
"version": "latest",
18+
"ppa": "false"
19+
}
20+
},
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"python.defaultInterpreterPath": "/usr/local/bin/python"
28+
}
29+
}
30+
},
31+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
32+
// "forwardPorts": [],
33+
34+
// Use 'postCreateCommand' to run commands after the container is created.
35+
// "postCreateCommand": "pip3 install --user -r requirements.txt",
36+
37+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
38+
"remoteUser": "vscode"
39+
}

.env.template

+117-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,123 @@
1-
PINECONE_API_KEY=your-pinecone-api-key
2-
PINECONE_ENV=your-pinecone-region
1+
################################################################################
2+
### AUTO-GPT - GENERAL SETTINGS
3+
################################################################################
4+
# EXECUTE_LOCAL_COMMANDS - Allow local command execution (Example: False)
5+
EXECUTE_LOCAL_COMMANDS=False
6+
# BROWSE_CHUNK_MAX_LENGTH - When browsing website, define the length of chunk stored in memory
7+
BROWSE_CHUNK_MAX_LENGTH=8192
8+
# BROWSE_SUMMARY_MAX_TOKEN - Define the maximum length of the summary generated by GPT agent when browsing website
9+
BROWSE_SUMMARY_MAX_TOKEN=300
10+
# USER_AGENT - Define the user-agent used by the requests library to browse website (string)
11+
# USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
12+
# AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)
13+
AI_SETTINGS_FILE=ai_settings.yaml
14+
15+
################################################################################
16+
### LLM PROVIDER
17+
################################################################################
18+
19+
### OPENAI
20+
# OPENAI_API_KEY - OpenAI API Key (Example: my-openai-api-key)
21+
# TEMPERATURE - Sets temperature in OpenAI (Default: 1)
22+
# USE_AZURE - Use Azure OpenAI or not (Default: False)
323
OPENAI_API_KEY=your-openai-api-key
424
TEMPERATURE=1
5-
ELEVENLABS_API_KEY=your-elevenlabs-api-key
6-
ELEVENLABS_VOICE_1_ID=your-voice-id
7-
ELEVENLABS_VOICE_2_ID=your-voice-id
25+
USE_AZURE=False
26+
27+
### AZURE
28+
# OPENAI_AZURE_API_BASE - OpenAI API base URL for Azure (Example: https://my-azure-openai-url.com)
29+
# OPENAI_AZURE_API_VERSION - OpenAI API version for Azure (Example: v1)
30+
# OPENAI_AZURE_DEPLOYMENT_ID - OpenAI deployment ID for Azure (Example: my-deployment-id)
31+
# OPENAI_AZURE_CHAT_DEPLOYMENT_ID - OpenAI deployment ID for Azure Chat (Example: my-deployment-id-for-azure-chat)
32+
# OPENAI_AZURE_EMBEDDINGS_DEPLOYMENT_ID - OpenAI deployment ID for Embedding (Example: my-deployment-id-for-azure-embeddigs)
33+
OPENAI_AZURE_API_BASE=your-base-url-for-azure
34+
OPENAI_AZURE_API_VERSION=api-version-for-azure
35+
OPENAI_AZURE_DEPLOYMENT_ID=deployment-id-for-azure
36+
OPENAI_AZURE_CHAT_DEPLOYMENT_ID=deployment-id-for-azure-chat
37+
OPENAI_AZURE_EMBEDDINGS_DEPLOYMENT_ID=deployment-id-for-azure-embeddigs
38+
39+
################################################################################
40+
### LLM MODELS
41+
################################################################################
42+
43+
# SMART_LLM_MODEL - Smart language model (Default: gpt-4)
44+
# FAST_LLM_MODEL - Fast language model (Default: gpt-3.5-turbo)
845
SMART_LLM_MODEL=gpt-4
946
FAST_LLM_MODEL=gpt-3.5-turbo
10-
GOOGLE_API_KEY=
11-
CUSTOM_SEARCH_ENGINE_ID=
12-
USE_AZURE=False
13-
EXECUTE_LOCAL_COMMANDS=False
47+
48+
### LLM MODEL SETTINGS
49+
# FAST_TOKEN_LIMIT - Fast token limit for OpenAI (Default: 4000)
50+
# SMART_TOKEN_LIMIT - Smart token limit for OpenAI (Default: 8000)
51+
# When using --gpt3onlythis needs to be set to 4000.
52+
FAST_TOKEN_LIMIT=4000
53+
SMART_TOKEN_LIMIT=8000
54+
55+
################################################################################
56+
### MEMORY
57+
################################################################################
58+
59+
# MEMORY_BACKEND - Memory backend type (Default: local)
60+
MEMORY_BACKEND=local
61+
62+
### PINECONE
63+
# PINECONE_API_KEY - Pinecone API Key (Example: my-pinecone-api-key)
64+
# PINECONE_ENV - Pinecone environment (region) (Example: us-west-2)
65+
PINECONE_API_KEY=your-pinecone-api-key
66+
PINECONE_ENV=your-pinecone-region
67+
68+
### REDIS
69+
# REDIS_HOST - Redis host (Default: localhost)
70+
# REDIS_PORT - Redis port (Default: 6379)
71+
# REDIS_PASSWORD - Redis password (Default: "")
72+
# WIPE_REDIS_ON_START - Wipes data / index on start (Default: False)
73+
# MEMORY_INDEX - Name of index created in Redis database (Default: auto-gpt)
74+
REDIS_HOST=localhost
75+
REDIS_PORT=6379
76+
REDIS_PASSWORD=
77+
WIPE_REDIS_ON_START=False
78+
MEMORY_INDEX=auto-gpt
79+
80+
################################################################################
81+
### IMAGE GENERATION PROVIDER
82+
################################################################################
83+
84+
### OPEN AI
85+
# IMAGE_PROVIDER - Image provider (Example: dalle)
1486
IMAGE_PROVIDER=dalle
15-
HUGGINGFACE_API_TOKEN=
87+
88+
### HUGGINGFACE
89+
# STABLE DIFFUSION
90+
# (Default URL: https://api-inference.huggingface.co/models/CompVis/stable-diffusion-v1-4)
91+
# Set in image_gen.py)
92+
# HUGGINGFACE_API_TOKEN - HuggingFace API token (Example: my-huggingface-api-token)
93+
HUGGINGFACE_API_TOKEN=your-huggingface-api-token
94+
95+
################################################################################
96+
### SEARCH PROVIDER
97+
################################################################################
98+
99+
### GOOGLE
100+
# GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
101+
# CUSTOM_SEARCH_ENGINE_ID - Custom search engine ID (Example: my-custom-search-engine-id)
102+
GOOGLE_API_KEY=your-google-api-key
103+
CUSTOM_SEARCH_ENGINE_ID=your-custom-search-engine-id
104+
105+
################################################################################
106+
### TTS PROVIDER
107+
################################################################################
108+
109+
### MAC OS
110+
# USE_MAC_OS_TTS - Use Mac OS TTS or not (Default: False)
16111
USE_MAC_OS_TTS=False
17-
MEMORY_BACKEND=local
112+
113+
### STREAMELEMENTS
114+
# USE_BRIAN_TTS - Use Brian TTS or not (Default: False)
115+
USE_BRIAN_TTS=False
116+
117+
### ELEVENLABS
118+
# ELEVENLABS_API_KEY - Eleven Labs API key (Example: my-elevenlabs-api-key)
119+
# ELEVENLABS_VOICE_1_ID - Eleven Labs voice 1 ID (Example: my-voice-id-1)
120+
# ELEVENLABS_VOICE_2_ID - Eleven Labs voice 2 ID (Example: my-voice-id-2)
121+
ELEVENLABS_API_KEY=your-elevenlabs-api-key
122+
ELEVENLABS_VOICE_1_ID=your-voice-id-1
123+
ELEVENLABS_VOICE_2_ID=your-voice-id-2

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ last_run_ai_settings.yaml
1616
.idea/*
1717
auto-gpt.json
1818
log.txt
19+
log-ingestion.txt
20+
logs
1921

2022
# Coverage reports
2123
.coverage

Dockerfile

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
# Use an official Python base image from the Docker Hub
12
FROM python:3.11-slim
2-
ENV PIP_NO_CACHE_DIR=yes
3-
WORKDIR /app
4-
COPY requirements.txt .
5-
RUN pip install -r requirements.txt
6-
COPY scripts/ .
7-
ENTRYPOINT ["python", "main.py"]
3+
4+
# Set environment variables
5+
ENV PIP_NO_CACHE_DIR=yes \
6+
PYTHONUNBUFFERED=1 \
7+
PYTHONDONTWRITEBYTECODE=1
8+
9+
# Create a non-root user and set permissions
10+
RUN useradd --create-home appuser
11+
WORKDIR /home/appuser
12+
RUN chown appuser:appuser /home/appuser
13+
USER appuser
14+
15+
# Copy the requirements.txt file and install the requirements
16+
COPY --chown=appuser:appuser requirements.txt .
17+
RUN pip install --no-cache-dir --user -r requirements.txt
18+
19+
# Copy the application files
20+
COPY --chown=appuser:appuser scripts/ .
21+
22+
# Set the entrypoint
23+
ENTRYPOINT ["python", "main.py"]

0 commit comments

Comments
 (0)