diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index f3b2e2db..02f580a0 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,15 +1,20 @@
-# [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
+# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3-bullseye, 3.10-bullseye, 3-buster, 3.10-buster
ARG VARIANT=3-bullseye
-FROM python:3.8
+FROM --platform=linux/amd64 python:3.10
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
- && apt-get purge -y imagemagick imagemagick-6-common
+ && apt-get purge -y imagemagick imagemagick-6-common
# Temporary: Upgrade python packages due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
# They are installed by the base image (python) which does not have the patch.
RUN python3 -m pip install --upgrade setuptools
+# Install Chrome for web browsing
+RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+ && curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb -o /tmp/chrome.deb \
+ && apt-get -y install /tmp/chrome.deb
+
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
@@ -20,4 +25,4 @@ RUN python3 -m pip install --upgrade setuptools
# && apt-get -y install --no-install-recommends
# [Optional] Uncomment this line to install global node packages.
-# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1
\ No newline at end of file
+# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 5fefd9c1..f26810fb 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -11,6 +11,7 @@
"userGid": "1000",
"upgradePackages": "true"
},
+ "ghcr.io/devcontainers/features/desktop-lite:1": {},
"ghcr.io/devcontainers/features/python:1": "none",
"ghcr.io/devcontainers/features/node:1": "none",
"ghcr.io/devcontainers/features/git:1": {
diff --git a/.env.template b/.env.template
index eeff2907..f1b511c2 100644
--- a/.env.template
+++ b/.env.template
@@ -1,174 +1,190 @@
################################################################################
### AUTO-GPT - GENERAL SETTINGS
################################################################################
-# EXECUTE_LOCAL_COMMANDS - Allow local command execution (Example: False)
-EXECUTE_LOCAL_COMMANDS=False
-# BROWSE_CHUNK_MAX_LENGTH - When browsing website, define the length of chunk stored in memory
-BROWSE_CHUNK_MAX_LENGTH=8192
-# BROWSE_SUMMARY_MAX_TOKEN - Define the maximum length of the summary generated by GPT agent when browsing website
-BROWSE_SUMMARY_MAX_TOKEN=300
-# USER_AGENT - Define the user-agent used by the requests library to browse website (string)
+
+## EXECUTE_LOCAL_COMMANDS - Allow local command execution (Default: False)
+## RESTRICT_TO_WORKSPACE - Restrict file operations to workspace ./auto_gpt_workspace (Default: True)
+# EXECUTE_LOCAL_COMMANDS=False
+# RESTRICT_TO_WORKSPACE=True
+
+## USER_AGENT - Define the user-agent used by the requests library to browse website (string)
# 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"
-# AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)
-AI_SETTINGS_FILE=ai_settings.yaml
-# USE_WEB_BROWSER - Sets the web-browser drivers to use with selenium (defaults to chrome).
-# Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
-# USE_WEB_BROWSER=chrome
+
+## AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)
+# AI_SETTINGS_FILE=ai_settings.yaml
################################################################################
### LLM PROVIDER
################################################################################
### OPENAI
-# OPENAI_API_KEY - OpenAI API Key (Example: my-openai-api-key)
-# TEMPERATURE - Sets temperature in OpenAI (Default: 0)
-# USE_AZURE - Use Azure OpenAI or not (Default: False)
+## OPENAI_API_KEY - OpenAI API Key (Example: my-openai-api-key)
+## TEMPERATURE - Sets temperature in OpenAI (Default: 0)
+## USE_AZURE - Use Azure OpenAI or not (Default: False)
OPENAI_API_KEY=your-openai-api-key
-TEMPERATURE=0
-USE_AZURE=False
+# TEMPERATURE=0
+# USE_AZURE=False
### AZURE
-# cleanup azure env as already moved to `azure.yaml.template`
+# moved to `azure.yaml.template`
################################################################################
### LLM MODELS
################################################################################
-# SMART_LLM_MODEL - Smart language model (Default: gpt-4)
-# FAST_LLM_MODEL - Fast language model (Default: gpt-3.5-turbo)
-SMART_LLM_MODEL=gpt-4
-FAST_LLM_MODEL=gpt-3.5-turbo
+## SMART_LLM_MODEL - Smart language model (Default: gpt-4)
+## FAST_LLM_MODEL - Fast language model (Default: gpt-3.5-turbo)
+# SMART_LLM_MODEL=gpt-4
+# FAST_LLM_MODEL=gpt-3.5-turbo
### LLM MODEL SETTINGS
-# FAST_TOKEN_LIMIT - Fast token limit for OpenAI (Default: 4000)
-# SMART_TOKEN_LIMIT - Smart token limit for OpenAI (Default: 8000)
-# When using --gpt3only this needs to be set to 4000.
-FAST_TOKEN_LIMIT=4000
-SMART_TOKEN_LIMIT=8000
+## FAST_TOKEN_LIMIT - Fast token limit for OpenAI (Default: 4000)
+## SMART_TOKEN_LIMIT - Smart token limit for OpenAI (Default: 8000)
+## When using --gpt3only this needs to be set to 4000.
+# FAST_TOKEN_LIMIT=4000
+# SMART_TOKEN_LIMIT=8000
################################################################################
### MEMORY
################################################################################
### MEMORY_BACKEND - Memory backend type
-# local - Default
-# pinecone - Pinecone (if configured)
-# redis - Redis (if configured)
-MEMORY_BACKEND=local
+## local - Default
+## pinecone - Pinecone (if configured)
+## redis - Redis (if configured)
+## milvus - Milvus (if configured)
+## MEMORY_INDEX - Name of index created in Memory backend (Default: auto-gpt)
+# MEMORY_BACKEND=local
+# MEMORY_INDEX=auto-gpt
### PINECONE
-# PINECONE_API_KEY - Pinecone API Key (Example: my-pinecone-api-key)
-# PINECONE_ENV - Pinecone environment (region) (Example: us-west-2)
-PINECONE_API_KEY=your-pinecone-api-key
-PINECONE_ENV=your-pinecone-region
+## PINECONE_API_KEY - Pinecone API Key (Example: my-pinecone-api-key)
+## PINECONE_ENV - Pinecone environment (region) (Example: us-west-2)
+# PINECONE_API_KEY=your-pinecone-api-key
+# PINECONE_ENV=your-pinecone-region
### REDIS
-# REDIS_HOST - Redis host (Default: localhost)
-# REDIS_PORT - Redis port (Default: 6379)
-# REDIS_PASSWORD - Redis password (Default: "")
-# WIPE_REDIS_ON_START - Wipes data / index on start (Default: False)
-# MEMORY_INDEX - Name of index created in Redis database (Default: auto-gpt)
-REDIS_HOST=localhost
-REDIS_PORT=6379
-REDIS_PASSWORD=
-WIPE_REDIS_ON_START=False
-MEMORY_INDEX=auto-gpt
+## REDIS_HOST - Redis host (Default: localhost, use "redis" for docker-compose)
+## REDIS_PORT - Redis port (Default: 6379)
+## REDIS_PASSWORD - Redis password (Default: "")
+## WIPE_REDIS_ON_START - Wipes data / index on start (Default: True)
+# REDIS_HOST=localhost
+# REDIS_PORT=6379
+# REDIS_PASSWORD=
+# WIPE_REDIS_ON_START=True
### WEAVIATE
-# MEMORY_BACKEND - Use 'weaviate' to use Weaviate vector storage
-# WEAVIATE_HOST - Weaviate host IP
-# WEAVIATE_PORT - Weaviate host port
-# WEAVIATE_PROTOCOL - Weaviate host protocol (e.g. 'http')
-# USE_WEAVIATE_EMBEDDED - Whether to use Embedded Weaviate
-# WEAVIATE_EMBEDDED_PATH - File system path were to persist data when running Embedded Weaviate
-# WEAVIATE_USERNAME - Weaviate username
-# WEAVIATE_PASSWORD - Weaviate password
-# WEAVIATE_API_KEY - Weaviate API key if using API-key-based authentication
-# MEMORY_INDEX - Name of index to create in Weaviate
-WEAVIATE_HOST="127.0.0.1"
-WEAVIATE_PORT=8080
-WEAVIATE_PROTOCOL="http"
-USE_WEAVIATE_EMBEDDED=False
-WEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate"
-WEAVIATE_USERNAME=
-WEAVIATE_PASSWORD=
-WEAVIATE_API_KEY=
-MEMORY_INDEX=AutoGpt
+## MEMORY_BACKEND - Use 'weaviate' to use Weaviate vector storage
+## WEAVIATE_HOST - Weaviate host IP
+## WEAVIATE_PORT - Weaviate host port
+## WEAVIATE_PROTOCOL - Weaviate host protocol (e.g. 'http')
+## USE_WEAVIATE_EMBEDDED - Whether to use Embedded Weaviate
+## WEAVIATE_EMBEDDED_PATH - File system path were to persist data when running Embedded Weaviate
+## WEAVIATE_USERNAME - Weaviate username
+## WEAVIATE_PASSWORD - Weaviate password
+## WEAVIATE_API_KEY - Weaviate API key if using API-key-based authentication
+# WEAVIATE_HOST="127.0.0.1"
+# WEAVIATE_PORT=8080
+# WEAVIATE_PROTOCOL="http"
+# USE_WEAVIATE_EMBEDDED=False
+# WEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate"
+# WEAVIATE_USERNAME=
+# WEAVIATE_PASSWORD=
+# WEAVIATE_API_KEY=
### MILVUS
-# MILVUS_ADDR - Milvus remote address (e.g. localhost:19530)
-# MILVUS_COLLECTION - Milvus collection,
-# change it if you want to start a new memory and retain the old memory.
-MILVUS_ADDR=your-milvus-cluster-host-port
-MILVUS_COLLECTION=autogpt
+## MILVUS_ADDR - Milvus remote address (e.g. localhost:19530)
+## MILVUS_COLLECTION - Milvus collection,
+## change it if you want to start a new memory and retain the old memory.
+# MILVUS_ADDR=your-milvus-cluster-host-port
+# MILVUS_COLLECTION=autogpt
################################################################################
### IMAGE GENERATION PROVIDER
################################################################################
### OPEN AI
-# IMAGE_PROVIDER - Image provider (Example: dalle)
-IMAGE_PROVIDER=dalle
+## IMAGE_PROVIDER - Image provider (Example: dalle)
+## IMAGE_SIZE - Image size (Example: 256)
+## DALLE: 256, 512, 1024
+# IMAGE_PROVIDER=dalle
+# IMAGE_SIZE=256
### HUGGINGFACE
-# STABLE DIFFUSION
-# (Default URL: https://api-inference.huggingface.co/models/CompVis/stable-diffusion-v1-4)
-# Set in image_gen.py)
-# HUGGINGFACE_API_TOKEN - HuggingFace API token (Example: my-huggingface-api-token)
-HUGGINGFACE_API_TOKEN=your-huggingface-api-token
+## HUGGINGFACE_IMAGE_MODEL - Text-to-image model from Huggingface (Default: CompVis/stable-diffusion-v1-4)
+## HUGGINGFACE_API_TOKEN - HuggingFace API token (Example: my-huggingface-api-token)
+# HUGGINGFACE_IMAGE_MODEL=CompVis/stable-diffusion-v1-4
+# HUGGINGFACE_API_TOKEN=your-huggingface-api-token
+
+### STABLE DIFFUSION WEBUI
+## SD_WEBUI_AUTH - Stable diffusion webui username:password pair (Example: username:password)
+## SD_WEBUI_URL - Stable diffusion webui API URL (Example: http://127.0.0.1:7860)
+# SD_WEBUI_AUTH=
+# SD_WEBUI_URL=http://127.0.0.1:7860
################################################################################
### AUDIO TO TEXT PROVIDER
################################################################################
### HUGGINGFACE
-HUGGINGFACE_AUDIO_TO_TEXT_MODEL=facebook/wav2vec2-base-960h
+# HUGGINGFACE_AUDIO_TO_TEXT_MODEL=facebook/wav2vec2-base-960h
################################################################################
### GIT Provider for repository actions
################################################################################
### GITHUB
-# GITHUB_API_KEY - Github API key / PAT (Example: github_pat_123)
-# GITHUB_USERNAME - Github username
-GITHUB_API_KEY=github_pat_123
-GITHUB_USERNAME=your-github-username
+## GITHUB_API_KEY - Github API key / PAT (Example: github_pat_123)
+## GITHUB_USERNAME - Github username
+# GITHUB_API_KEY=github_pat_123
+# GITHUB_USERNAME=your-github-username
################################################################################
-### SEARCH PROVIDER
+### WEB BROWSING
################################################################################
+### BROWSER
+## HEADLESS_BROWSER - Whether to run the browser in headless mode (default: True)
+## USE_WEB_BROWSER - Sets the web-browser driver to use with selenium (default: chrome).
+## Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
+# HEADLESS_BROWSER=True
+# USE_WEB_BROWSER=chrome
+## BROWSE_CHUNK_MAX_LENGTH - When browsing website, define the length of chunks to summarize (in number of tokens, excluding the response. 75 % of FAST_TOKEN_LIMIT is usually wise )
+# BROWSE_CHUNK_MAX_LENGTH=3000
+## BROWSE_SPACY_LANGUAGE_MODEL is used to split sentences. Install additional languages via pip, and set the model name here. Example Chinese: python -m spacy download zh_core_web_sm
+# BROWSE_SPACY_LANGUAGE_MODEL=en_core_web_sm
+
### GOOGLE
-# GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
-# CUSTOM_SEARCH_ENGINE_ID - Custom search engine ID (Example: my-custom-search-engine-id)
-GOOGLE_API_KEY=your-google-api-key
-CUSTOM_SEARCH_ENGINE_ID=your-custom-search-engine-id
+## GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
+## CUSTOM_SEARCH_ENGINE_ID - Custom search engine ID (Example: my-custom-search-engine-id)
+# GOOGLE_API_KEY=your-google-api-key
+# CUSTOM_SEARCH_ENGINE_ID=your-custom-search-engine-id
################################################################################
### TTS PROVIDER
################################################################################
### MAC OS
-# USE_MAC_OS_TTS - Use Mac OS TTS or not (Default: False)
-USE_MAC_OS_TTS=False
+## USE_MAC_OS_TTS - Use Mac OS TTS or not (Default: False)
+# USE_MAC_OS_TTS=False
### STREAMELEMENTS
-# USE_BRIAN_TTS - Use Brian TTS or not (Default: False)
-USE_BRIAN_TTS=False
+## USE_BRIAN_TTS - Use Brian TTS or not (Default: False)
+# USE_BRIAN_TTS=False
### ELEVENLABS
-# ELEVENLABS_API_KEY - Eleven Labs API key (Example: my-elevenlabs-api-key)
-# ELEVENLABS_VOICE_1_ID - Eleven Labs voice 1 ID (Example: my-voice-id-1)
-# ELEVENLABS_VOICE_2_ID - Eleven Labs voice 2 ID (Example: my-voice-id-2)
-ELEVENLABS_API_KEY=your-elevenlabs-api-key
-ELEVENLABS_VOICE_1_ID=your-voice-id-1
-ELEVENLABS_VOICE_2_ID=your-voice-id-2
+## ELEVENLABS_API_KEY - Eleven Labs API key (Example: my-elevenlabs-api-key)
+## ELEVENLABS_VOICE_1_ID - Eleven Labs voice 1 ID (Example: my-voice-id-1)
+## ELEVENLABS_VOICE_2_ID - Eleven Labs voice 2 ID (Example: my-voice-id-2)
+# ELEVENLABS_API_KEY=your-elevenlabs-api-key
+# ELEVENLABS_VOICE_1_ID=your-voice-id-1
+# ELEVENLABS_VOICE_2_ID=your-voice-id-2
################################################################################
-### TWITTER API
+### TWITTER API
################################################################################
-TW_CONSUMER_KEY=
-TW_CONSUMER_SECRET=
-TW_ACCESS_TOKEN=
-TW_ACCESS_TOKEN_SECRET=
+# TW_CONSUMER_KEY=
+# TW_CONSUMER_SECRET=
+# TW_ACCESS_TOKEN=
+# TW_ACCESS_TOKEN_SECRET=
diff --git a/.envrc b/.envrc
new file mode 100644
index 00000000..a7ad7263
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,4 @@
+# Upon entering directory, direnv requests user permission once to automatically load project dependencies onwards.
+# Eliminating the need of running "nix develop github:superherointj/nix-auto-gpt" for Nix users to develop/use Auto-GPT.
+
+[[ -z $IN_NIX_SHELL ]] && use flake github:superherointj/nix-auto-gpt
diff --git a/.flake8 b/.flake8
index c456b393..77976224 100644
--- a/.flake8
+++ b/.flake8
@@ -1,12 +1,12 @@
[flake8]
max-line-length = 88
-extend-ignore = E203
+select = "E303, W293, W291, W292, E305, E231, E302"
exclude =
.tox,
__pycache__,
*.pyc,
.env
- venv/*
- .venv/*
- reports/*
- dist/*
\ No newline at end of file
+ venv*/*,
+ .venv/*,
+ reports/*,
+ dist/*,
diff --git a/.github/ISSUE_TEMPLATE/1.bug.yml b/.github/ISSUE_TEMPLATE/1.bug.yml
index 7f1d2771..6645142e 100644
--- a/.github/ISSUE_TEMPLATE/1.bug.yml
+++ b/.github/ISSUE_TEMPLATE/1.bug.yml
@@ -2,6 +2,20 @@ name: Bug report 🐛
description: Create a bug report for Auto-GPT.
labels: ['status: needs triage']
body:
+ - type: markdown
+ attributes:
+ value: |
+ ### ⚠️ Before you continue
+ * Check out our [backlog], [roadmap] and join our [discord] to discuss what's going on
+ * If you need help, you can ask in the [discussions] section or in [#tech-support]
+ * **Throughly search the [existing issues] before creating a new one**
+
+ [backlog]: https://github.com/orgs/Significant-Gravitas/projects/1
+ [roadmap]: https://github.com/orgs/Significant-Gravitas/projects/2
+ [discord]: https://discord.gg/autogpt
+ [discussions]: https://github.com/Significant-Gravitas/Auto-GPT/discussions
+ [#tech-support]: https://discord.com/channels/1092243196446249134/1092275629602394184
+ [existing issues]: https://github.com/Significant-Gravitas/Auto-GPT/issues?q=is%3Aissue
- type: checkboxes
attributes:
label: ⚠️ Search for existing issues first ⚠️
@@ -28,14 +42,32 @@ body:
- Provide commit-hash (`git rev-parse HEAD` gets it)
- If it's a pip/packages issue, provide pip version, python version
- If it's a crash, provide traceback.
- - type: checkboxes
+ - type: dropdown
attributes:
- label: GPT-3 or GPT-4
+ label: Which Operating System are you using?
+ description: >
+ Please select the operating system you were using to run Auto-GPT when this problem occurred.
+ options:
+ - Windows
+ - Linux
+ - MacOS
+ - Docker
+ - Devcontainer / Codespace
+ - Windows Subsystem for Linux (WSL)
+ - Other (Please specify in your problem)
+ validations:
+ required: true
+ - type: dropdown
+ attributes:
+ label: GPT-3 or GPT-4?
description: >
If you are using Auto-GPT with `--gpt3only`, your problems may be caused by
- the limitations of GPT-3.5
+ the [limitations](https://github.com/Significant-Gravitas/Auto-GPT/issues?q=is%3Aissue+label%3A%22AI+model+limitation%22) of GPT-3.5.
options:
- - label: I am using Auto-GPT with GPT-3 (GPT-3.5)
+ - GPT-3.5
+ - GPT-4
+ validations:
+ required: true
- type: textarea
attributes:
label: Steps to reproduce 🕹
@@ -52,9 +84,34 @@ body:
- type: textarea
attributes:
label: Your prompt 📝
- description: |
- If applicable please provide the prompt you are using. You can find your last-used prompt in last_run_ai_settings.yaml.
+ description: >
+ If applicable please provide the prompt you are using. Your prompt is stored in your `ai_settings.yaml` file.
value: |
```yaml
# Paste your prompt here
```
+ - type: textarea
+ attributes:
+ label: Your Logs 📒
+ description: |
+ Please include the log showing your error and the command that caused it, if applicable.
+ You can copy it from your terminal or from `logs/activity.log`.
+ This will help us understand your issue better!
+
+
+ Example
+ ```log
+ INFO NEXT ACTION: COMMAND = execute_shell ARGUMENTS = {'command_line': 'some_command'}
+ INFO -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=
+ Traceback (most recent call last):
+ File "/home/anaconda3/lib/python3.9/site-packages/openai/api_requestor.py", line 619, in _interpret_response
+ self._interpret_response_line(
+ File "/home/anaconda3/lib/python3.9/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
+ raise self.handle_error_response(
+ openai.error.InvalidRequestError: This model's maximum context length is 8191 tokens, however you requested 10982 tokens (10982 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.
+ ```
+
+ value: |
+ ```log
+
+ ```
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index c355965a..a4f28a3d 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,3 +1,10 @@
+
+
-
+
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
new file mode 100644
index 00000000..53b6e7a0
--- /dev/null
+++ b/.github/workflows/benchmark.yml
@@ -0,0 +1,31 @@
+name: benchmark
+
+on:
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ environment: benchmark
+ strategy:
+ matrix:
+ python-version: ['3.10', '3.11']
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v3
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ - name: benchmark
+ run: |
+ python benchmark/benchmark_entrepeneur_gpt_with_undecisive_user.py
+ env:
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 366aaf67..b37e7f00 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,23 +2,54 @@ name: Python CI
on:
push:
- branches:
- - master
+ branches: [master]
pull_request:
- branches:
- - master
+ branches: [master]
+
+concurrency:
+ group: ${{ format('ci-{0}', format('pr-{0}', github.event.pull_request.number) || github.sha) }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- build:
+ lint:
runs-on: ubuntu-latest
-
- strategy:
- matrix:
- python-version: [3.8]
+ env:
+ min-python-version: '3.10'
steps:
- name: Check out repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
+
+ - name: Set up Python ${{ env.min-python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ env.min-python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+
+ - name: Lint with flake8
+ run: flake8
+
+ - name: Check black formatting
+ run: black . --check
+ if: success() || failure()
+
+ - name: Check isort formatting
+ run: isort . --check
+ if: success() || failure()
+
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ['3.10', '3.11']
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
@@ -30,15 +61,12 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
- - name: Lint with flake8
- continue-on-error: false
- run: flake8 autogpt/ tests/ --select E303,W293,W291,W292,E305,E231,E302
-
- name: Run unittest tests with coverage
run: |
- coverage run --source=autogpt -m unittest discover tests
+ pytest --cov=autogpt --without-integration --without-slow-integration
- name: Generate coverage report
run: |
coverage report
coverage xml
+ if: success() || failure()
diff --git a/.github/workflows/pr-label.yml b/.github/workflows/pr-label.yml
new file mode 100644
index 00000000..92c5a66b
--- /dev/null
+++ b/.github/workflows/pr-label.yml
@@ -0,0 +1,28 @@
+name: "Pull Request auto-label"
+on:
+ # So that PRs touching the same files as the push are updated
+ push:
+ # So that the `dirtyLabel` is removed if conflicts are resolve
+ # We recommend `pull_request_target` so that github secrets are available.
+ # In `pull_request` we wouldn't be able to change labels of fork PRs
+ pull_request_target:
+ types: [opened, synchronize]
+concurrency:
+ group: ${{ format('pr-label-{0}', github.event.pull_request.number || github.sha) }}
+ cancel-in-progress: true
+
+jobs:
+ conflicts:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: write
+ steps:
+ - name: Update PRs with conflict labels
+ uses: eps1lon/actions-label-merge-conflict@releases/2.x
+ with:
+ dirtyLabel: "conflicts"
+ #removeOnDirtyLabel: "PR: ready to ship"
+ repoToken: "${{ secrets.GITHUB_TOKEN }}"
+ commentOnDirty: "This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request."
+ commentOnClean: "Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly."
diff --git a/.gitignore b/.gitignore
index 3209297c..a6b3b80f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,14 +3,13 @@ autogpt/keys.py
autogpt/*json
autogpt/node_modules/
autogpt/__pycache__/keys.cpython-310.pyc
+autogpt/auto_gpt_workspace
package-lock.json
*.pyc
auto_gpt_workspace/*
*.mpeg
.env
azure.yaml
-*venv/*
-outputs/*
ai_settings.yaml
last_run_ai_settings.yaml
.vscode
@@ -127,13 +126,13 @@ celerybeat.pid
*.sage.py
# Environments
+.direnv/
.env
.venv
env/
-venv/
+venv*/
ENV/
env.bak/
-venv.bak/
# Spyder project settings
.spyderproject
@@ -157,3 +156,6 @@ vicuna-*
# mac
.DS_Store
+
+# news
+CURRENT_BULLETIN.md
\ No newline at end of file
diff --git a/.isort.cfg b/.isort.cfg
deleted file mode 100644
index 8ad53a86..00000000
--- a/.isort.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-[settings]
-profile = black
-multi_line_output = 3
-include_trailing_comma = True
-force_grid_wrap = 0
-use_parentheses = True
-ensure_newline_before_comments = True
-line_length = 88
-skip = venv,env,node_modules,.env,.venv,dist
-sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
\ No newline at end of file
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index fb75cd59..3722b25e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,33 +1,32 @@
repos:
- - repo: https://github.com/sourcery-ai/sourcery
- rev: v1.1.0 # Get the latest tag from https://github.com/sourcery-ai/sourcery/tags
- hooks:
- - id: sourcery
-
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v0.9.2
hooks:
- id: check-added-large-files
- args: [ '--maxkb=500' ]
+ args: ['--maxkb=500']
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
-
- - repo: local
+
+ - repo: https://github.com/pycqa/isort
+ rev: 5.12.0
hooks:
- id: isort
- name: isort-local
- entry: isort
- language: python
- types: [ python ]
- exclude: .+/(dist|.venv|venv|build)/.+
- pass_filenames: true
+ language_version: python3.10
+
+ - repo: https://github.com/psf/black
+ rev: 23.3.0
+ hooks:
- id: black
- name: black-local
- entry: black
- language: python
- types: [ python ]
- exclude: .+/(dist|.venv|venv|build)/.+
- pass_filenames: true
\ No newline at end of file
+ language_version: python3.10
+
+ - repo: local
+ hooks:
+ - id: pytest-check
+ name: pytest-check
+ entry: pytest --cov=autogpt --without-integration --without-slow-integration
+ language: system
+ pass_filenames: false
+ always_run: true
diff --git a/.sourcery.yaml b/.sourcery.yaml
index a7f5b9d7..da171e75 100644
--- a/.sourcery.yaml
+++ b/.sourcery.yaml
@@ -30,7 +30,7 @@ rule_settings:
- refactoring
- suggestion
- comment
- python_version: '3.9' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.
+ python_version: '3.10' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.
# rules: # A list of custom rules Sourcery will include in its analysis.
# - id: no-print-statements
@@ -68,4 +68,4 @@ rule_settings:
# proxy:
# url:
# ssl_certs_file:
-# no_ssl_verify: false
\ No newline at end of file
+# no_ssl_verify: false
diff --git a/BULLETIN.md b/BULLETIN.md
new file mode 100644
index 00000000..735048dd
--- /dev/null
+++ b/BULLETIN.md
@@ -0,0 +1,2 @@
+Welcome to Auto-GPT! We'll keep you informed of the latest news and features by printing messages here.
+If you don't wish to see this message, you can run Auto-GPT with the --skip-news flag
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b2a2490c..79169a0c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -20,6 +20,12 @@ This document provides guidelines and best practices to help you contribute effe
By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it to understand the expectations we have for everyone who contributes to this project.
+## 📢 A Quick Word
+Right now we will not be accepting any Contributions that add non-essential commands to Auto-GPT.
+
+However, you absolutely can still add these commands to Auto-GPT in the form of plugins. Please check out this [template](https://github.com/Significant-Gravitas/Auto-GPT-Plugin-Template).
+> ⚠️ Plugin support is expected to ship within the week. You can follow PR #757 for more updates!
+
## Getting Started
To start contributing, follow these steps:
diff --git a/Dockerfile b/Dockerfile
index 9886d742..83961549 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,20 @@
# Use an official Python base image from the Docker Hub
-FROM python:3.11-slim
+FROM python:3.10-slim
# Install git
RUN apt-get -y update
RUN apt-get -y install git chromium-driver
+# Install Xvfb and other dependencies for headless browser testing
+RUN apt-get update \
+ && apt-get install -y wget gnupg2 libgtk-3-0 libdbus-glib-1-2 dbus-x11 xvfb ca-certificates
+
+# Install Firefox / Chromium
+RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
+ && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
+ && apt-get update \
+ && apt-get install -y chromium firefox-esr
+
# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
PYTHONUNBUFFERED=1 \
@@ -17,8 +27,9 @@ RUN chown appuser:appuser /home/appuser
USER appuser
# Copy the requirements.txt file and install the requirements
-COPY --chown=appuser:appuser requirements-docker.txt .
-RUN pip install --no-cache-dir --user -r requirements-docker.txt
+COPY --chown=appuser:appuser requirements.txt .
+RUN sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \
+ pip install --no-cache-dir --user -r requirements.txt
# Copy the application files
COPY --chown=appuser:appuser autogpt/ ./autogpt
diff --git a/README.md b/README.md
index 21f3ccf2..6d636c56 100644
--- a/README.md
+++ b/README.md
@@ -1,77 +1,44 @@
# Auto-GPT: An Autonomous GPT-4 Experiment
+[](https://github.com/Significant-Gravitas/Auto-GPT/actions/workflows/ci.yml)
+[](https://discord.gg/autogpt)
+[](https://github.com/Significant-Gravitas/Auto-GPT/stargazers)
+[](https://twitter.com/SigGravitas)
+
+## 💡 Get help - [Q&A](https://github.com/Significant-Gravitas/Auto-GPT/discussions/categories/q-a) or [Discord 💬](https://discord.gg/autogpt)
+
+
+
### 🔴 🔴 🔴 Urgent: USE `stable` not `master` 🔴 🔴 🔴
-> This information takes precedence over any other information provided and should be followed accordingly.
+**Download the latest `stable` release from here: https://github.com/Significant-Gravitas/Auto-GPT/releases/latest.**
+The `master` branch may often be in a **broken** state.
-Our workflow has been improved, but please note that `master` branch may often be in a **broken** state.
-Please download the latest `stable` release from here: https://github.com/Torantulino/Auto-GPT/releases/latest.
+
-
-[](https://twitter.com/SigGravitas)
-[](https://discord.gg/autogpt)
-[](https://github.com/Torantulino/Auto-GPT/actions/workflows/ci.yml)
Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. This program, driven by GPT-4, chains together LLM "thoughts", to autonomously achieve whatever goal you set. As one of the first examples of GPT-4 running fully autonomously, Auto-GPT pushes the boundaries of what is possible with AI.
-### Demo (30/03/2023):
+ Demo April 16th 2023
-https://user-images.githubusercontent.com/22963551/228855501-2f5777cf-755b-4407-a643-c7299e5b6419.mp4
+https://user-images.githubusercontent.com/70048414/232352935-55c6bf7c-3958-406e-8610-0913475a0b05.mp4
+
+Demo made by Blake Werlinger
💖 Help Fund Auto-GPT's Development 💖
If you can spare a coffee, you can help to cover the costs of developing Auto-GPT and help push the boundaries of fully autonomous AI!
Your support is greatly appreciated
-Development of this free, open-source project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here.
+Development of this free, open-source project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here.
-
-Enterprise Sponsors
-
+
-Individual Sponsors
-
-
-
-
-
-## Table of Contents
-
-- [Auto-GPT: An Autonomous GPT-4 Experiment](#auto-gpt-an-autonomous-gpt-4-experiment)
- - [🔴 🔴 🔴 Urgent: USE `stable` not `master` 🔴 🔴 🔴](#----urgent-use-stable-not-master----)
- - [Demo (30/03/2023):](#demo-30032023)
- - [Table of Contents](#table-of-contents)
- - [🚀 Features](#-features)
- - [📋 Requirements](#-requirements)
- - [💾 Installation](#-installation)
- - [🔧 Usage](#-usage)
- - [Logs](#logs)
- - [Docker](#docker)
- - [Command Line Arguments](#command-line-arguments)
- - [🗣️ Speech Mode](#️-speech-mode)
- - [🔍 Google API Keys Configuration](#-google-api-keys-configuration)
- - [Setting up environment variables](#setting-up-environment-variables)
- - [Memory Backend Setup](#memory-backend-setup)
- - [Redis Setup](#redis-setup)
- - [🌲 Pinecone API Key Setup](#-pinecone-api-key-setup)
- - [Milvus Setup](#milvus-setup)
- - [Weaviate Setup](#weaviate-setup)
- - [Setting up environment variables](#setting-up-environment-variables-1)
- - [Setting Your Cache Type](#setting-your-cache-type)
- - [View Memory Usage](#view-memory-usage)
- - [🧠 Memory pre-seeding](#-memory-pre-seeding)
- - [💀 Continuous Mode ⚠️](#-continuous-mode-️)
- - [GPT3.5 ONLY Mode](#gpt35-only-mode)
- - [🖼 Image Generation](#-image-generation)
- - [⚠️ Limitations](#️-limitations)
- - [🛡 Disclaimer](#-disclaimer)
- - [🐦 Connect with Us on Twitter](#-connect-with-us-on-twitter)
- - [Run tests](#run-tests)
- - [Run linter](#run-linter)
+
## 🚀 Features
@@ -83,18 +50,32 @@ Development of this free, open-source project is made possible by all the Billing](./docs/imgs/openai-api-key-billing-paid-account.png)
+
+#### **PLEASE ENSURE YOU HAVE DONE THIS STEP BEFORE PROCEEDING, OTHERWISE NOTHING WILL WORK!**
+
## 💾 Installation
To install Auto-GPT, follow these steps:
@@ -103,56 +84,63 @@ To install Auto-GPT, follow these steps:
_To execute the following commands, open a CMD, Bash, or Powershell window by navigating to a folder on your computer and typing `CMD` in the folder path at the top, then press enter._
-2. Clone the repository: For this step, you need Git installed. Alternatively, you can download the zip file by clicking the button at the top of this page ☝️
+2. Clone the repository: For this step, you need Git installed. Alternatively,
+ you can download the [latest stable release](https://github.com/Significant-Gravitas/Auto-GPT/releases/latest) (`Source code (zip)`, bottom of the page).
-```bash
-git clone https://github.com/Torantulino/Auto-GPT.git
-```
+ ```bash
+ git clone https://github.com/Significant-Gravitas/Auto-GPT.git
+ ```
3. Navigate to the directory where the repository was downloaded
-```bash
-cd Auto-GPT
-```
+ ```bash
+ cd Auto-GPT
+ ```
4. Install the required dependencies
-```bash
-pip install -r requirements.txt
-```
+ ```bash
+ pip install -r requirements.txt
+ ```
+
+5. Configure Auto-GPT
+ 1. Locate the file named `.env.template` in the main `/Auto-GPT` folder.
+ 2. Create a copy of this file, called `.env` by removing the `template` extension. The easiest way is to do this in a command prompt/terminal window `cp .env.template .env`.
+ 3. Open the `.env` file in a text editor. _Note: Files starting with a dot might be hidden by your Operating System._
+ 4. Find the line that says `OPENAI_API_KEY=`.
+ 5. After the `"="`, enter your unique OpenAI API Key (without any quotes or spaces).
+ 6. Enter any other API keys or Tokens for services you would like to utilize.
+ 7. Save and close the `.env` file.
-5. Locate the file named `.env.template` in the main `/Auto-GPT` folder.
- Create a copy of this file, called `.env` by removing the `template` extension. The easiest way is to do this in a command prompt/terminal window `cp .env.template .env`
- Open the `.env` file in a text editor. Note: Files starting with a dot might be hidden by your Operating System.
- Find the line that says `OPENAI_API_KEY=`.
- After the `"="`, enter your unique OpenAI API Key (without any quotes or spaces).
- Enter any other API keys or Tokens for services you would like to utilize.
- Save and close the `".env"` file.
By completing these steps, you have properly configured the API Keys for your project.
- - See [OpenAI API Keys Configuration](#openai-api-keys-configuration) to obtain your OpenAI API key.
- - Obtain your ElevenLabs API key from: https://elevenlabs.io. You can view your xi-api-key using the "Profile" tab on the website.
- - If you want to use GPT on an Azure instance, set `USE_AZURE` to `True` and then follow these steps:
- - Rename `azure.yaml.template` to `azure.yaml` and provide the relevant `azure_api_base`, `azure_api_version` and all the deployment IDs for the relevant models in the `azure_model_map` section:
- - `fast_llm_model_deployment_id` - your gpt-3.5-turbo or gpt-4 deployment ID
- - `smart_llm_model_deployment_id` - your gpt-4 deployment ID
- - `embedding_model_deployment_id` - your text-embedding-ada-002 v2 deployment ID
- - Please specify all of these values as double-quoted strings
- ```yaml
- # Replace string in angled brackets (<>) to your own ID
- azure_model_map:
- fast_llm_model_deployment_id: ""
- ...
- ```
- - Details can be found here: https://pypi.org/project/openai/ in the `Microsoft Azure Endpoints` section and here: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-line for the embedding model.
+ - See [OpenAI API Keys Configuration](#openai-api-keys-configuration) to obtain your OpenAI API key.
+ - Obtain your ElevenLabs API key from: https://elevenlabs.io. You can view your xi-api-key using the "Profile" tab on the website.
+ - If you want to use GPT on an Azure instance, set `USE_AZURE` to `True` and then follow these steps:
+ - Rename `azure.yaml.template` to `azure.yaml` and provide the relevant `azure_api_base`, `azure_api_version` and all the deployment IDs for the relevant models in the `azure_model_map` section:
+ - `fast_llm_model_deployment_id` - your gpt-3.5-turbo or gpt-4 deployment ID
+ - `smart_llm_model_deployment_id` - your gpt-4 deployment ID
+ - `embedding_model_deployment_id` - your text-embedding-ada-002 v2 deployment ID
+ - Please specify all of these values as double-quoted strings
+ ```yaml
+ # Replace string in angled brackets (<>) to your own ID
+ azure_model_map:
+ fast_llm_model_deployment_id: ""
+ ...
+ ```
+ - Details can be found here: https://pypi.org/project/openai/ in the `Microsoft Azure Endpoints` section and here: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-line for the embedding model.
## 🔧 Usage
-1. Run `autogpt` Python module in your terminal
-
-```
-python -m autogpt
-```
+1. Run `autogpt` Python module in your terminal.
+ On linux or mac:
+ ```bash
+ # On Linux or Mac:
+ ./run.sh start
+ # On Windows:
+ .\run.bat
+ ```
+ Running with `--help` after `.\run.bat` lists all the possible command line arguments you can pass.
2. After each action, choose from options to authorize command(s),
exit the program, or provide feedback to the AI.
@@ -175,30 +163,40 @@ python -m autogpt --debug
You can also build this into a docker image and run it:
-```
+```bash
docker build -t autogpt .
docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace autogpt
```
-You can pass extra arguments, for instance, running with `--gpt3only` and `--continuous` mode:
+Or if you have `docker-compose`:
+```bash
+docker-compose run --build --rm auto-gpt
```
+
+You can pass extra arguments, for instance, running with `--gpt3only` and `--continuous` mode:
+```bash
docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace autogpt --gpt3only --continuous
```
+```bash
+docker-compose run --build --rm auto-gpt --gpt3only --continuous
+```
+
### Command Line Arguments
Here are some common arguments you can use when running Auto-GPT:
> Replace anything in angled brackets (<>) to a value you want to specify
+
* View all available command line arguments
-```bash
-python -m autogpt --help
-```
+ ```bash
+ python -m autogpt --help
+ ```
* Run Auto-GPT with a different AI Settings file
-```bash
-python -m autogpt --ai-settings
-```
-* Specify one of 3 memory backends: `local`, `redis`, `pinecone` or `no_memory`
-```bash
-python -m autogpt --use-memory
-```
+ ```bash
+ python -m autogpt --ai-settings
+ ```
+* Specify a memory backend
+ ```bash
+ python -m autogpt --use-memory
+ ```
> **NOTE**: There are shorthands for some of these flags, for example `-m` for `--use-memory`. Use `python -m autogpt --help` for more information
@@ -222,18 +220,6 @@ python -m autogpt --speak
- Adam : pNInz6obpgDQGcFmaJgB
- Sam : yoZ06aMxZJJ28mfd3POQ
-
-## OpenAI API Keys Configuration
-
-Obtain your OpenAI API key from: https://platform.openai.com/account/api-keys.
-
-To use OpenAI API key for Auto-GPT, you NEED to have billing set up (AKA paid account).
-
-You can set up paid account at https://platform.openai.com/account/billing/overview.
-
-
-
-
## 🔍 Google API Keys Configuration
This section is optional, use the official google api if you are having issues with error 429 when running a google search.
@@ -280,33 +266,29 @@ To switch to either, change the `MEMORY_BACKEND` env variable to the value that
* `milvus` will use the milvus cache that you configured
* `weaviate` will use the weaviate cache that you configured
+## Memory Backend Setup
+
### Redis Setup
> _**CAUTION**_ \
This is not intended to be publicly accessible and lacks security measures. Therefore, avoid exposing Redis to the internet without a password or at all
-1. Install docker desktop
-```bash
-docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
-```
-> See https://hub.docker.com/r/redis/redis-stack-server for setting a password and additional configuration.
+1. Install docker (or Docker Desktop on Windows)
+2. Launch Redis container
+ ```bash
+ docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
+ ```
+ > See https://hub.docker.com/r/redis/redis-stack-server for setting a password and additional configuration.
+3. Set the following settings in `.env`
+ > Replace **PASSWORD** in angled brackets (<>)
+ ```bash
+ MEMORY_BACKEND=redis
+ REDIS_HOST=localhost
+ REDIS_PORT=6379
+ REDIS_PASSWORD=
+ ```
-2. Set the following environment variables
-> Replace **PASSWORD** in angled brackets (<>)
-```bash
-MEMORY_BACKEND=redis
-REDIS_HOST=localhost
-REDIS_PORT=6379
-REDIS_PASSWORD=
-```
-You can optionally set
-
-```bash
-WIPE_REDIS_ON_START=False
-```
-
-To persist memory stored in Redis
+ You can optionally set `WIPE_REDIS_ON_START=False` to persist memory stored in Redis.
You can specify the memory index for redis using the following:
-
```bash
MEMORY_INDEX=
```
@@ -344,21 +326,30 @@ export MEMORY_BACKEND="pinecone"
### Milvus Setup
-[Milvus](https://milvus.io/) is a open-source, high scalable vector database to storage huge amount of vector-based memory and provide fast relevant search.
+[Milvus](https://milvus.io/) is an open-source, highly scalable vector database to store huge amounts of vector-based memory and provide fast relevant search.
- setup milvus database, keep your pymilvus version and milvus version same to avoid compatible issues.
- setup by open source [Install Milvus](https://milvus.io/docs/install_standalone-operator.md)
- or setup by [Zilliz Cloud](https://zilliz.com/cloud)
- set `MILVUS_ADDR` in `.env` to your milvus address `host:ip`.
- set `MEMORY_BACKEND` in `.env` to `milvus` to enable milvus as backend.
-- optional
- - set `MILVUS_COLLECTION` in `.env` to change milvus collection name as you want, `autogpt` is the default name.
+
+**Optional:**
+- set `MILVUS_COLLECTION` in `.env` to change milvus collection name as you want, `autogpt` is the default name.
### Weaviate Setup
[Weaviate](https://weaviate.io/) is an open-source vector database. It allows to store data objects and vector embeddings from ML-models and scales seamlessly to billion of data objects. [An instance of Weaviate can be created locally (using Docker), on Kubernetes or using Weaviate Cloud Services](https://weaviate.io/developers/weaviate/quickstart).
Although still experimental, [Embedded Weaviate](https://weaviate.io/developers/weaviate/installation/embedded) is supported which allows the Auto-GPT process itself to start a Weaviate instance. To enable it, set `USE_WEAVIATE_EMBEDDED` to `True` and make sure you `pip install "weaviate-client>=3.15.4"`.
+#### Install the Weaviate client
+
+Install the Weaviate client before usage.
+
+```
+$ pip install weaviate-client
+```
+
#### Setting up environment variables
In your `.env` file set the following:
@@ -378,12 +369,14 @@ MEMORY_INDEX="Autogpt" # name of the index to create for the application
## View Memory Usage
-1. View memory usage by using the `--debug` flag :)
+View memory usage by using the `--debug` flag :)
## 🧠 Memory pre-seeding
+Memory pre-seeding allows you to ingest files into memory and pre-seed it before running Auto-GPT.
-# python autogpt/data_ingestion.py -h
+```bash
+# python data_ingestion.py -h
usage: data_ingestion.py [-h] (--file FILE | --dir DIR) [--init] [--overlap OVERLAP] [--max_length MAX_LENGTH]
Ingest a file or a directory with multiple files into memory. Make sure to set your .env before running this script.
@@ -396,33 +389,27 @@ options:
--overlap OVERLAP The overlap size between chunks when ingesting files (default: 200)
--max_length MAX_LENGTH The max_length of each chunk when ingesting files (default: 4000)
-# python autogpt/data_ingestion.py --dir seed_data --init --overlap 200 --max_length 1000
-This script located at autogpt/data_ingestion.py, allows you to ingest files into memory and pre-seed it before running Auto-GPT.
+# python data_ingestion.py --dir DataFolder --init --overlap 100 --max_length 2000
+```
+In the example above, the script initializes the memory, ingests all files within the `Auto-Gpt/autogpt/auto_gpt_workspace/DataFolder` directory into memory with an overlap between chunks of 100 and a maximum length of each chunk of 2000.
-Memory pre-seeding is a technique that involves ingesting relevant documents or data into the AI's memory so that it can use this information to generate more informed and accurate responses.
+Note that you can also use the `--file` argument to ingest a single file into memory and that data_ingestion.py will only ingest files within the `/auto_gpt_workspace` directory.
-To pre-seed the memory, the content of each document is split into chunks of a specified maximum length with a specified overlap between chunks, and then each chunk is added to the memory backend set in the .env file. When the AI is prompted to recall information, it can then access those pre-seeded memories to generate more informed and accurate responses.
+The DIR path is relative to the auto_gpt_workspace directory, so `python data_ingestion.py --dir . --init` will ingest everything in `auto_gpt_workspace` directory.
-This technique is particularly useful when working with large amounts of data or when there is specific information that the AI needs to be able to access quickly.
-By pre-seeding the memory, the AI can retrieve and use this information more efficiently, saving time, API call and improving the accuracy of its responses.
+You can adjust the `max_length` and overlap parameters to fine-tune the way the docuents are presented to the AI when it "recall" that memory:
+- Adjusting the overlap value allows the AI to access more contextual information from each chunk when recalling information, but will result in more chunks being created and therefore increase memory backend usage and OpenAI API requests.
+- Reducing the `max_length` value will create more chunks, which can save prompt tokens by allowing for more message history in the context, but will also increase the number of chunks.
+- Increasing the `max_length` value will provide the AI with more contextual information from each chunk, reducing the number of chunks created and saving on OpenAI API requests. However, this may also use more prompt tokens and decrease the overall context available to the AI.
-You could for example download the documentation of an API, a GitHub repository, etc. and ingest it into memory before running Auto-GPT.
+Memory pre-seeding is a technique for improving AI accuracy by ingesting relevant data into its memory. Chunks of data are split and added to memory, allowing the AI to access them quickly and generate more accurate responses. It's useful for large datasets or when specific information needs to be accessed quickly. Examples include ingesting API or GitHub documentation before running Auto-GPT.
-⚠️ If you use Redis as your memory, make sure to run Auto-GPT with the `WIPE_REDIS_ON_START` set to `False` in your `.env` file.
+⚠️ If you use Redis as your memory, make sure to run Auto-GPT with the `WIPE_REDIS_ON_START=False` in your `.env` file.
⚠️For other memory backend, we currently forcefully wipe the memory when starting Auto-GPT. To ingest data with those memory backend, you can call the `data_ingestion.py` script anytime during an Auto-GPT run.
Memories will be available to the AI immediately as they are ingested, even if ingested while Auto-GPT is running.
-In the example above, the script initializes the memory, ingests all files within the `/seed_data` directory into memory with an overlap between chunks of 200 and a maximum length of each chunk of 4000.
-Note that you can also use the `--file` argument to ingest a single file into memory and that the script will only ingest files within the `/auto_gpt_workspace` directory.
-
-You can adjust the `max_length` and overlap parameters to fine-tune the way the docuents are presented to the AI when it "recall" that memory:
-
-- Adjusting the overlap value allows the AI to access more contextual information from each chunk when recalling information, but will result in more chunks being created and therefore increase memory backend usage and OpenAI API requests.
-- Reducing the `max_length` value will create more chunks, which can save prompt tokens by allowing for more message history in the context, but will also increase the number of chunks.
-- Increasing the `max_length` value will provide the AI with more contextual information from each chunk, reducing the number of chunks created and saving on OpenAI API requests. However, this may also use more prompt tokens and decrease the overall context available to the AI.
-
## 💀 Continuous Mode ⚠️
Run the AI **without** user authorization, 100% automated.
@@ -432,9 +419,9 @@ Use at your own risk.
1. Run the `autogpt` python module in your terminal:
-```bash
-python -m autogpt --speak --continuous
-```
+ ```bash
+ python -m autogpt --speak --continuous
+ ```
2. To exit the program, press Ctrl + C
@@ -502,16 +489,29 @@ We look forward to connecting with you and hearing your thoughts, ideas, and exp
## Run tests
-To run tests, run the following command:
+To run all tests, run the following command:
```bash
-python -m unittest discover tests
+pytest
+
+```
+
+To run just without integration tests:
+
+```
+pytest --without-integration
+```
+
+To run just without slow integration tests:
+
+```
+pytest --without-slow-integration
```
To run tests and see coverage, run the following command:
```bash
-coverage run -m unittest discover tests
+pytest --cov=autogpt --without-integration --without-slow-integration
```
## Run linter
diff --git a/autogpt/__main__.py b/autogpt/__main__.py
index 29ccddbf..128f9eea 100644
--- a/autogpt/__main__.py
+++ b/autogpt/__main__.py
@@ -1,53 +1,5 @@
-"""Main script for the autogpt package."""
-import logging
-from colorama import Fore
-from autogpt.agent.agent import Agent
-from autogpt.args import parse_arguments
-
-from autogpt.config import Config, check_openai_api_key
-from autogpt.logs import logger
-from autogpt.memory import get_memory
-
-from autogpt.prompt import construct_prompt
-
-# Load environment variables from .env file
-
-
-def main() -> None:
- """Main function for the script"""
- cfg = Config()
- # TODO: fill in llm values here
- check_openai_api_key()
- parse_arguments()
- logger.set_level(logging.DEBUG if cfg.debug_mode else logging.INFO)
- ai_name = ""
- prompt = construct_prompt()
- # print(prompt)
- # Initialize variables
- full_message_history = []
- next_action_count = 0
- # Make a constant:
- user_input = (
- "Determine which next command to use, and respond using the"
- " format specified above:"
- )
- # Initialize memory and make sure it is empty.
- # this is particularly important for indexing and referencing pinecone memory
- memory = get_memory(cfg, init=True)
- logger.typewriter_log(
- f"Using memory of type:", Fore.GREEN, f"{memory.__class__.__name__}"
- )
- logger.typewriter_log(f"Using Browser:", Fore.GREEN, cfg.selenium_web_browser)
- agent = Agent(
- ai_name=ai_name,
- memory=memory,
- full_message_history=full_message_history,
- next_action_count=next_action_count,
- prompt=prompt,
- user_input=user_input,
- )
- agent.start_interaction_loop()
-
+"""Auto-GPT: A GPT powered AI Assistant"""
+import autogpt.cli
if __name__ == "__main__":
- main()
+ autogpt.cli.main()
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py
index 301d3f02..ee7885f8 100644
--- a/autogpt/agent/agent.py
+++ b/autogpt/agent/agent.py
@@ -1,11 +1,10 @@
from colorama import Fore, Style
-from autogpt.app import execute_command, get_command
+from autogpt.app import execute_command, get_command
from autogpt.chat import chat_with_ai, create_chat_message
from autogpt.config import Config
-from autogpt.json_fixes.bracket_termination import (
- attempt_to_fix_json_by_finding_outermost_brackets,
-)
+from autogpt.json_utils.json_fix_llm import fix_json_using_multiple_techniques
+from autogpt.json_utils.utilities import validate_json
from autogpt.logs import logger, print_assistant_thoughts
from autogpt.speech import say_text
from autogpt.spinner import Spinner
@@ -20,9 +19,18 @@ class Agent:
memory: The memory object to use.
full_message_history: The full message history.
next_action_count: The number of actions to execute.
- prompt: The prompt to use.
- user_input: The user input.
+ system_prompt: The system prompt is the initial prompt that defines everything the AI needs to know to achieve its task successfully.
+ Currently, the dynamic and customizable information in the system prompt are ai_name, description and goals.
+ triggering_prompt: The last sentence the AI will see before answering. For Auto-GPT, this prompt is:
+ Determine which next command to use, and respond using the format specified above:
+ The triggering prompt is not part of the system prompt because between the system prompt and the triggering
+ prompt we have contextual information that can distract the AI and make it forget that its goal is to find the next task to achieve.
+ SYSTEM PROMPT
+ CONTEXTUAL INFORMATION (memory, previous conversations, anything relevant)
+ TRIGGERING PROMPT
+
+ The triggering prompt reminds the AI about its short term meta task (defining the next task)
"""
def __init__(
@@ -31,15 +39,15 @@ class Agent:
memory,
full_message_history,
next_action_count,
- prompt,
- user_input,
+ system_prompt,
+ triggering_prompt,
):
self.ai_name = ai_name
self.memory = memory
self.full_message_history = full_message_history
self.next_action_count = next_action_count
- self.prompt = prompt
- self.user_input = user_input
+ self.system_prompt = system_prompt
+ self.triggering_prompt = triggering_prompt
def start_interaction_loop(self):
# Interaction Loop
@@ -47,6 +55,8 @@ class Agent:
loop_count = 0
command_name = None
arguments = None
+ user_input = ""
+
while True:
# Discontinue if continuous limit is reached
loop_count += 1
@@ -63,31 +73,32 @@ class Agent:
# Send message to AI, get response
with Spinner("Thinking... "):
assistant_reply = chat_with_ai(
- self.prompt,
- self.user_input,
+ self.system_prompt,
+ self.triggering_prompt,
self.full_message_history,
self.memory,
cfg.fast_token_limit,
) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
- # Print Assistant thoughts
- print_assistant_thoughts(self.ai_name, assistant_reply)
+ assistant_reply_json = fix_json_using_multiple_techniques(assistant_reply)
- # Get command name and arguments
- try:
- command_name, arguments = get_command(
- attempt_to_fix_json_by_finding_outermost_brackets(assistant_reply)
- )
- if cfg.speak_mode:
- say_text(f"I want to execute {command_name}")
- except Exception as e:
- logger.error("Error: \n", str(e))
+ # Print Assistant thoughts
+ if assistant_reply_json != {}:
+ validate_json(assistant_reply_json, "llm_response_format_1")
+ # Get command name and arguments
+ try:
+ print_assistant_thoughts(self.ai_name, assistant_reply_json)
+ command_name, arguments = get_command(assistant_reply_json)
+ # command_name, arguments = assistant_reply_json_valid["command"]["name"], assistant_reply_json_valid["command"]["args"]
+ if cfg.speak_mode:
+ say_text(f"I want to execute {command_name}")
+ except Exception as e:
+ logger.error("Error: \n", str(e))
if not cfg.continuous_mode and self.next_action_count == 0:
### GET USER AUTHORIZATION TO EXECUTE COMMAND ###
# Get key press: Prompt the user to press enter to continue or escape
# to exit
- self.user_input = ""
logger.typewriter_log(
"NEXT ACTION: ",
Fore.CYAN,
@@ -104,15 +115,18 @@ class Agent:
console_input = clean_input(
Fore.MAGENTA + "Input:" + Style.RESET_ALL
)
- if console_input.lower().rstrip() == "y":
- self.user_input = "GENERATE NEXT COMMAND JSON"
+ if console_input.lower().strip() == "y":
+ user_input = "GENERATE NEXT COMMAND JSON"
break
+ elif console_input.lower().strip() == "":
+ print("Invalid input format.")
+ continue
elif console_input.lower().startswith("y -"):
try:
self.next_action_count = abs(
int(console_input.split(" ")[1])
)
- self.user_input = "GENERATE NEXT COMMAND JSON"
+ user_input = "GENERATE NEXT COMMAND JSON"
except ValueError:
print(
"Invalid input format. Please enter 'y -n' where n is"
@@ -121,20 +135,20 @@ class Agent:
continue
break
elif console_input.lower() == "n":
- self.user_input = "EXIT"
+ user_input = "EXIT"
break
else:
- self.user_input = console_input
+ user_input = console_input
command_name = "human_feedback"
break
- if self.user_input == "GENERATE NEXT COMMAND JSON":
+ if user_input == "GENERATE NEXT COMMAND JSON":
logger.typewriter_log(
"-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=",
Fore.MAGENTA,
"",
)
- elif self.user_input == "EXIT":
+ elif user_input == "EXIT":
print("Exiting...", flush=True)
break
else:
@@ -152,7 +166,7 @@ class Agent:
f"Command {command_name} threw the following error: {arguments}"
)
elif command_name == "human_feedback":
- result = f"Human feedback: {self.user_input}"
+ result = f"Human feedback: {user_input}"
else:
result = (
f"Command {command_name} returned: "
@@ -164,7 +178,7 @@ class Agent:
memory_to_add = (
f"Assistant Reply: {assistant_reply} "
f"\nResult: {result} "
- f"\nHuman Feedback: {self.user_input} "
+ f"\nHuman Feedback: {user_input} "
)
self.memory.add(memory_to_add)
diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.py
index e4bfb126..898767a4 100644
--- a/autogpt/agent/agent_manager.py
+++ b/autogpt/agent/agent_manager.py
@@ -1,8 +1,10 @@
"""Agent manager for managing GPT agents"""
from __future__ import annotations
-from autogpt.llm_utils import create_chat_completion
+from typing import Union
+
from autogpt.config.config import Singleton
+from autogpt.llm_utils import create_chat_completion
class AgentManager(metaclass=Singleton):
diff --git a/autogpt/app.py b/autogpt/app.py
index 6ead0d52..58d9f716 100644
--- a/autogpt/app.py
+++ b/autogpt/app.py
@@ -1,31 +1,36 @@
""" Command and Control """
import json
-from typing import List, NoReturn, Union
+from typing import Dict, List, NoReturn, Union
+
from autogpt.agent.agent_manager import AgentManager
-from autogpt.commands.evaluate_code import evaluate_code
-from autogpt.commands.google_search import google_official_search, google_search
-from autogpt.commands.improve_code import improve_code
-from autogpt.commands.write_tests import write_tests
-from autogpt.config import Config
-from autogpt.commands.image_gen import generate_image
+from autogpt.commands.analyze_code import analyze_code
from autogpt.commands.audio_text import read_audio_from_file
-from autogpt.commands.web_requests import scrape_links, scrape_text
-from autogpt.commands.execute_code import execute_python_file, execute_shell
+from autogpt.commands.execute_code import (
+ execute_python_file,
+ execute_shell,
+ execute_shell_popen,
+)
from autogpt.commands.file_operations import (
append_to_file,
delete_file,
+ download_file,
read_file,
search_files,
write_to_file,
)
-from autogpt.json_fixes.parsing import fix_and_parse_json
+from autogpt.commands.git_operations import clone_repository
+from autogpt.commands.google_search import google_official_search, google_search
+from autogpt.commands.image_gen import generate_image
+from autogpt.commands.improve_code import improve_code
+from autogpt.commands.twitter import send_tweet
+from autogpt.commands.web_requests import scrape_links, scrape_text
+from autogpt.commands.web_selenium import browse_website
+from autogpt.commands.write_tests import write_tests
+from autogpt.config import Config
+from autogpt.json_utils.json_fix_llm import fix_and_parse_json
from autogpt.memory import get_memory
from autogpt.processing.text import summarize_text
from autogpt.speech import say_text
-from autogpt.commands.web_selenium import browse_website
-from autogpt.commands.git_operations import clone_repository
-from autogpt.commands.twitter import send_tweet
-
CFG = Config()
AGENT_MANAGER = AgentManager()
@@ -47,11 +52,11 @@ def is_valid_int(value: str) -> bool:
return False
-def get_command(response: str):
+def get_command(response_json: Dict):
"""Parse the response and return the command name and arguments
Args:
- response (str): The response from the user
+ response_json (json): The response from the AI
Returns:
tuple: The command name and arguments
@@ -62,8 +67,6 @@ def get_command(response: str):
Exception: If any other error occurs
"""
try:
- response_json = fix_and_parse_json(response)
-
if "command" not in response_json:
return "Error:", "Missing 'command' object in JSON"
@@ -113,11 +116,10 @@ def execute_command(command_name: str, arguments):
arguments (dict): The arguments for the command
Returns:
- str: The result of the command"""
- memory = get_memory(CFG)
-
+ str: The result of the command
+ """
try:
- command_name = map_command_synonyms(command_name)
+ command_name = map_command_synonyms(command_name.lower())
if command_name == "google":
# Check if the Google API key is set and use the official search method
# If the API key is not set or has only whitespaces, use the unofficial
@@ -131,12 +133,16 @@ def execute_command(command_name: str, arguments):
# google_result can be a list or a string depending on the search results
if isinstance(google_result, list):
- safe_message = [google_result_single.encode('utf-8', 'ignore') for google_result_single in google_result]
+ safe_message = [
+ google_result_single.encode("utf-8", "ignore")
+ for google_result_single in google_result
+ ]
else:
- safe_message = google_result.encode('utf-8', 'ignore')
+ safe_message = google_result.encode("utf-8", "ignore")
- return str(safe_message)
+ return safe_message.decode("utf-8")
elif command_name == "memory_add":
+ memory = get_memory(CFG)
return memory.add(arguments["string"])
elif command_name == "start_agent":
return start_agent(
@@ -166,13 +172,17 @@ def execute_command(command_name: str, arguments):
return delete_file(arguments["file"])
elif command_name == "search_files":
return search_files(arguments["directory"])
+ elif command_name == "download_file":
+ if not CFG.allow_downloads:
+ return "Error: You do not have user authorization to download files locally."
+ return download_file(arguments["url"], arguments["file"])
elif command_name == "browse_website":
return browse_website(arguments["url"], arguments["question"])
# TODO: Change these to take in a file rather than pasted code, if
# non-file is given, return instructions "Input should be a python
# filepath, write your code to file and try again"
- elif command_name == "evaluate_code":
- return evaluate_code(arguments["code"])
+ elif command_name == "analyze_code":
+ return analyze_code(arguments["code"])
elif command_name == "improve_code":
return improve_code(arguments["suggestions"], arguments["code"])
elif command_name == "write_tests":
@@ -188,6 +198,15 @@ def execute_command(command_name: str, arguments):
" shell commands, EXECUTE_LOCAL_COMMANDS must be set to 'True' "
"in your config. Do not attempt to bypass the restriction."
)
+ elif command_name == "execute_shell_popen":
+ if CFG.execute_local_commands:
+ return execute_shell_popen(arguments["command_line"])
+ else:
+ return (
+ "You are not allowed to run local shell commands. To execute"
+ " shell commands, EXECUTE_LOCAL_COMMANDS must be set to 'True' "
+ "in your config. Do not attempt to bypass the restriction."
+ )
elif command_name == "read_audio_from_file":
return read_audio_from_file(arguments["file"])
elif command_name == "generate_image":
@@ -209,7 +228,7 @@ def execute_command(command_name: str, arguments):
def get_text_summary(url: str, question: str) -> str:
- """Return the results of a google search
+ """Return the results of a Google search
Args:
url (str): The url to scrape
@@ -224,7 +243,7 @@ def get_text_summary(url: str, question: str) -> str:
def get_hyperlinks(url: str) -> Union[str, List[str]]:
- """Return the results of a google search
+ """Return the results of a Google search
Args:
url (str): The url to scrape
diff --git a/autogpt/args.py b/autogpt/args.py
deleted file mode 100644
index eca32334..00000000
--- a/autogpt/args.py
+++ /dev/null
@@ -1,137 +0,0 @@
-"""This module contains the argument parsing logic for the script."""
-import argparse
-
-from colorama import Fore
-from autogpt import utils
-from autogpt.config import Config
-from autogpt.logs import logger
-from autogpt.memory import get_supported_memory_backends
-
-CFG = Config()
-
-
-def parse_arguments() -> None:
- """Parses the arguments passed to the script
-
- Returns:
- None
- """
- CFG.set_debug_mode(False)
- CFG.set_continuous_mode(False)
- CFG.set_speak_mode(False)
-
- parser = argparse.ArgumentParser(description="Process arguments.")
- parser.add_argument(
- "--continuous", "-c", action="store_true", help="Enable Continuous Mode"
- )
- parser.add_argument(
- "--continuous-limit",
- "-l",
- type=int,
- dest="continuous_limit",
- help="Defines the number of times to run in continuous mode",
- )
- parser.add_argument("--speak", action="store_true", help="Enable Speak Mode")
- parser.add_argument("--debug", action="store_true", help="Enable Debug Mode")
- parser.add_argument(
- "--gpt3only", action="store_true", help="Enable GPT3.5 Only Mode"
- )
- parser.add_argument("--gpt4only", action="store_true", help="Enable GPT4 Only Mode")
- parser.add_argument(
- "--use-memory",
- "-m",
- dest="memory_type",
- help="Defines which Memory backend to use",
- )
- parser.add_argument(
- "--skip-reprompt",
- "-y",
- dest="skip_reprompt",
- action="store_true",
- help="Skips the re-prompting messages at the beginning of the script",
- )
- parser.add_argument(
- "--use-browser",
- "-b",
- dest="browser_name",
- help="Specifies which web-browser to use when using selenium to scrape the web.",
- )
- parser.add_argument(
- "--ai-settings",
- "-C",
- dest="ai_settings_file",
- help="Specifies which ai_settings.yaml file to use, will also automatically"
- " skip the re-prompt.",
- )
- args = parser.parse_args()
-
- if args.debug:
- logger.typewriter_log("Debug Mode: ", Fore.GREEN, "ENABLED")
- CFG.set_debug_mode(True)
-
- if args.continuous:
- logger.typewriter_log("Continuous Mode: ", Fore.RED, "ENABLED")
- logger.typewriter_log(
- "WARNING: ",
- Fore.RED,
- "Continuous mode is not recommended. It is potentially dangerous and may"
- " cause your AI to run forever or carry out actions you would not usually"
- " authorise. Use at your own risk.",
- )
- CFG.set_continuous_mode(True)
-
- if args.continuous_limit:
- logger.typewriter_log(
- "Continuous Limit: ", Fore.GREEN, f"{args.continuous_limit}"
- )
- CFG.set_continuous_limit(args.continuous_limit)
-
- # Check if continuous limit is used without continuous mode
- if args.continuous_limit and not args.continuous:
- parser.error("--continuous-limit can only be used with --continuous")
-
- if args.speak:
- logger.typewriter_log("Speak Mode: ", Fore.GREEN, "ENABLED")
- CFG.set_speak_mode(True)
-
- if args.gpt3only:
- logger.typewriter_log("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED")
- CFG.set_smart_llm_model(CFG.fast_llm_model)
-
- if args.gpt4only:
- logger.typewriter_log("GPT4 Only Mode: ", Fore.GREEN, "ENABLED")
- CFG.set_fast_llm_model(CFG.smart_llm_model)
-
- if args.memory_type:
- supported_memory = get_supported_memory_backends()
- chosen = args.memory_type
- if chosen not in supported_memory:
- logger.typewriter_log(
- "ONLY THE FOLLOWING MEMORY BACKENDS ARE SUPPORTED: ",
- Fore.RED,
- f"{supported_memory}",
- )
- logger.typewriter_log("Defaulting to: ", Fore.YELLOW, CFG.memory_backend)
- else:
- CFG.memory_backend = chosen
-
- if args.skip_reprompt:
- logger.typewriter_log("Skip Re-prompt: ", Fore.GREEN, "ENABLED")
- CFG.skip_reprompt = True
-
- if args.ai_settings_file:
- file = args.ai_settings_file
-
- # Validate file
- (validated, message) = utils.validate_yaml_file(file)
- if not validated:
- logger.typewriter_log("FAILED FILE VALIDATION", Fore.RED, message)
- logger.double_check()
- exit(1)
-
- logger.typewriter_log("Using AI Settings File:", Fore.GREEN, file)
- CFG.ai_settings_file = file
- CFG.skip_reprompt = True
-
- if args.browser_name:
- CFG.selenium_web_browser = args.browser_name
diff --git a/autogpt/cli.py b/autogpt/cli.py
new file mode 100644
index 00000000..6fe9ecbb
--- /dev/null
+++ b/autogpt/cli.py
@@ -0,0 +1,155 @@
+"""Main script for the autogpt package."""
+import click
+
+
+@click.group(invoke_without_command=True)
+@click.option("-c", "--continuous", is_flag=True, help="Enable Continuous Mode")
+@click.option(
+ "--skip-reprompt",
+ "-y",
+ is_flag=True,
+ help="Skips the re-prompting messages at the beginning of the script",
+)
+@click.option(
+ "--ai-settings",
+ "-C",
+ help="Specifies which ai_settings.yaml file to use, will also automatically skip the re-prompt.",
+)
+@click.option(
+ "-l",
+ "--continuous-limit",
+ type=int,
+ help="Defines the number of times to run in continuous mode",
+)
+@click.option("--speak", is_flag=True, help="Enable Speak Mode")
+@click.option("--debug", is_flag=True, help="Enable Debug Mode")
+@click.option("--gpt3only", is_flag=True, help="Enable GPT3.5 Only Mode")
+@click.option("--gpt4only", is_flag=True, help="Enable GPT4 Only Mode")
+@click.option(
+ "--use-memory",
+ "-m",
+ "memory_type",
+ type=str,
+ help="Defines which Memory backend to use",
+)
+@click.option(
+ "-b",
+ "--browser-name",
+ help="Specifies which web-browser to use when using selenium to scrape the web.",
+)
+@click.option(
+ "--allow-downloads",
+ is_flag=True,
+ help="Dangerous: Allows Auto-GPT to download files natively.",
+)
+@click.option(
+ "--skip-news",
+ is_flag=True,
+ help="Specifies whether to suppress the output of latest news on startup.",
+)
+@click.pass_context
+def main(
+ ctx: click.Context,
+ continuous: bool,
+ continuous_limit: int,
+ ai_settings: str,
+ skip_reprompt: bool,
+ speak: bool,
+ debug: bool,
+ gpt3only: bool,
+ gpt4only: bool,
+ memory_type: str,
+ browser_name: str,
+ allow_downloads: bool,
+ skip_news: bool,
+) -> None:
+ """
+ Welcome to AutoGPT an experimental open-source application showcasing the capabilities of the GPT-4 pushing the boundaries of AI.
+
+ Start an Auto-GPT assistant.
+ """
+ # Put imports inside function to avoid importing everything when starting the CLI
+ import logging
+ import sys
+
+ from colorama import Fore
+
+ from autogpt.agent.agent import Agent
+ from autogpt.config import Config, check_openai_api_key
+ from autogpt.configurator import create_config
+ from autogpt.logs import logger
+ from autogpt.memory import get_memory
+ from autogpt.prompt import construct_prompt
+ from autogpt.utils import get_current_git_branch, get_latest_bulletin
+
+ if ctx.invoked_subcommand is None:
+ cfg = Config()
+ # TODO: fill in llm values here
+ check_openai_api_key()
+ create_config(
+ continuous,
+ continuous_limit,
+ ai_settings,
+ skip_reprompt,
+ speak,
+ debug,
+ gpt3only,
+ gpt4only,
+ memory_type,
+ browser_name,
+ allow_downloads,
+ skip_news,
+ )
+ logger.set_level(logging.DEBUG if cfg.debug_mode else logging.INFO)
+ ai_name = ""
+ if not cfg.skip_news:
+ motd = get_latest_bulletin()
+ if motd:
+ logger.typewriter_log("NEWS: ", Fore.GREEN, motd)
+ git_branch = get_current_git_branch()
+ if git_branch and git_branch != "stable":
+ logger.typewriter_log(
+ "WARNING: ",
+ Fore.RED,
+ f"You are running on `{git_branch}` branch "
+ "- this is not a supported branch.",
+ )
+ if sys.version_info < (3, 10):
+ logger.typewriter_log(
+ "WARNING: ",
+ Fore.RED,
+ "You are running on an older version of Python. "
+ "Some people have observed problems with certain "
+ "parts of Auto-GPT with this version. "
+ "Please consider upgrading to Python 3.10 or higher.",
+ )
+ system_prompt = construct_prompt()
+ # print(prompt)
+ # Initialize variables
+ full_message_history = []
+ next_action_count = 0
+ # Make a constant:
+ triggering_prompt = (
+ "Determine which next command to use, and respond using the"
+ " format specified above:"
+ )
+ # Initialize memory and make sure it is empty.
+ # this is particularly important for indexing and referencing pinecone memory
+ memory = get_memory(cfg, init=True)
+ logger.typewriter_log(
+ "Using memory of type:", Fore.GREEN, f"{memory.__class__.__name__}"
+ )
+ logger.typewriter_log("Using Browser:", Fore.GREEN, cfg.selenium_web_browser)
+ agent = Agent(
+ ai_name=ai_name,
+ memory=memory,
+ full_message_history=full_message_history,
+ next_action_count=next_action_count,
+ system_prompt=system_prompt,
+ triggering_prompt=triggering_prompt,
+ )
+ agent.start_interaction_loop()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/autogpt/commands/evaluate_code.py b/autogpt/commands/analyze_code.py
similarity index 94%
rename from autogpt/commands/evaluate_code.py
rename to autogpt/commands/analyze_code.py
index 8f7cbca9..e02ea4c5 100644
--- a/autogpt/commands/evaluate_code.py
+++ b/autogpt/commands/analyze_code.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from autogpt.llm_utils import call_ai_function
-def evaluate_code(code: str) -> list[str]:
+def analyze_code(code: str) -> list[str]:
"""
A function that takes in a string and returns a response from create chat
completion api call.
diff --git a/autogpt/commands/audio_text.py b/autogpt/commands/audio_text.py
index 84819d5e..cae32d4e 100644
--- a/autogpt/commands/audio_text.py
+++ b/autogpt/commands/audio_text.py
@@ -1,6 +1,7 @@
-import requests
import json
+import requests
+
from autogpt.config import Config
from autogpt.workspace import path_in_workspace
diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.py
index eaafa00a..11266f85 100644
--- a/autogpt/commands/execute_code.py
+++ b/autogpt/commands/execute_code.py
@@ -5,10 +5,10 @@ import subprocess
import docker
from docker.errors import ImageNotFound
-from autogpt.workspace import path_in_workspace, WORKSPACE_PATH
+from autogpt.workspace import WORKSPACE_PATH, path_in_workspace
-def execute_python_file(file: str):
+def execute_python_file(file: str) -> str:
"""Execute a Python file in a Docker container and return the output
Args:
@@ -40,7 +40,10 @@ def execute_python_file(file: str):
try:
client = docker.from_env()
- image_name = "python:3.10"
+ # You can replace this with the desired Python image/version
+ # You can find available Python images on Docker Hub:
+ # https://hub.docker.com/_/python
+ image_name = "python:3-alpine"
try:
client.images.get(image_name)
print(f"Image '{image_name}' found locally")
@@ -57,9 +60,6 @@ def execute_python_file(file: str):
elif status:
print(status)
- # You can replace 'python:3.8' with the desired Python image/version
- # You can find available Python images on Docker Hub:
- # https://hub.docker.com/_/python
container = client.containers.run(
image_name,
f"python {file}",
@@ -84,6 +84,12 @@ def execute_python_file(file: str):
return logs
+ except docker.errors.DockerException as e:
+ print(
+ "Could not run the script in a container. If you haven't already, please install Docker https://docs.docker.com/get-docker/"
+ )
+ return f"Error: {str(e)}"
+
except Exception as e:
return f"Error: {str(e)}"
@@ -114,6 +120,35 @@ def execute_shell(command_line: str) -> str:
return output
+def execute_shell_popen(command_line) -> str:
+ """Execute a shell command with Popen and returns an english description
+ of the event and the process id
+
+ Args:
+ command_line (str): The command line to execute
+
+ Returns:
+ str: Description of the fact that the process started and its id
+ """
+ current_dir = os.getcwd()
+ # Change dir into workspace if necessary
+ if str(WORKSPACE_PATH) not in current_dir:
+ os.chdir(WORKSPACE_PATH)
+
+ print(f"Executing command '{command_line}' in working directory '{os.getcwd()}'")
+
+ do_not_show_output = subprocess.DEVNULL
+ process = subprocess.Popen(
+ command_line, shell=True, stdout=do_not_show_output, stderr=do_not_show_output
+ )
+
+ # Change back to whatever the prior working dir was
+
+ os.chdir(current_dir)
+
+ return f"Subprocess started with PID:'{str(process.pid)}'"
+
+
def we_are_running_in_a_docker_container() -> bool:
"""Check if we are running in a Docker container
diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py
index 8abc2e23..ad145ec9 100644
--- a/autogpt/commands/file_operations.py
+++ b/autogpt/commands/file_operations.py
@@ -3,9 +3,15 @@ from __future__ import annotations
import os
import os.path
-from pathlib import Path
from typing import Generator
-from autogpt.workspace import path_in_workspace, WORKSPACE_PATH
+
+import requests
+from colorama import Back, Fore
+from requests.adapters import HTTPAdapter, Retry
+
+from autogpt.spinner import Spinner
+from autogpt.utils import readable_file_size
+from autogpt.workspace import WORKSPACE_PATH, path_in_workspace
LOG_FILE = "file_logger.txt"
LOG_FILE_PATH = WORKSPACE_PATH / LOG_FILE
@@ -40,7 +46,7 @@ def log_operation(operation: str, filename: str) -> None:
with open(LOG_FILE_PATH, "w", encoding="utf-8") as f:
f.write("File Operation Logger ")
- append_to_file(LOG_FILE, log_entry, shouldLog = False)
+ append_to_file(LOG_FILE, log_entry, shouldLog=False)
def split_file(
@@ -63,9 +69,14 @@ def split_file(
while start < content_length:
end = start + max_length
if end + overlap < content_length:
- chunk = content[start : end + overlap]
+ chunk = content[start : end + overlap - 1]
else:
chunk = content[start:content_length]
+
+ # Account for the case where the last chunk is shorter than the overlap, so it has already been consumed
+ if len(chunk) <= overlap:
+ break
+
yield chunk
start += max_length - overlap
@@ -214,3 +225,43 @@ def search_files(directory: str) -> list[str]:
found_files.append(relative_path)
return found_files
+
+
+def download_file(url, filename):
+ """Downloads a file
+ Args:
+ url (str): URL of the file to download
+ filename (str): Filename to save the file as
+ """
+ safe_filename = path_in_workspace(filename)
+ try:
+ message = f"{Fore.YELLOW}Downloading file from {Back.LIGHTBLUE_EX}{url}{Back.RESET}{Fore.RESET}"
+ with Spinner(message) as spinner:
+ session = requests.Session()
+ retry = Retry(total=3, backoff_factor=1, status_forcelist=[502, 503, 504])
+ adapter = HTTPAdapter(max_retries=retry)
+ session.mount("http://", adapter)
+ session.mount("https://", adapter)
+
+ total_size = 0
+ downloaded_size = 0
+
+ with session.get(url, allow_redirects=True, stream=True) as r:
+ r.raise_for_status()
+ total_size = int(r.headers.get("Content-Length", 0))
+ downloaded_size = 0
+
+ with open(safe_filename, "wb") as f:
+ for chunk in r.iter_content(chunk_size=8192):
+ f.write(chunk)
+ downloaded_size += len(chunk)
+
+ # Update the progress message
+ progress = f"{readable_file_size(downloaded_size)} / {readable_file_size(total_size)}"
+ spinner.update_message(f"{message} {progress}")
+
+ return f'Successfully downloaded and locally stored file: "{filename}"! (Size: {readable_file_size(total_size)})'
+ except requests.HTTPError as e:
+ return f"Got an HTTP Error whilst trying to download file: {e}"
+ except Exception as e:
+ return "Error: " + str(e)
diff --git a/autogpt/commands/git_operations.py b/autogpt/commands/git_operations.py
index 3ff35cf3..028f3b8d 100644
--- a/autogpt/commands/git_operations.py
+++ b/autogpt/commands/git_operations.py
@@ -1,12 +1,14 @@
"""Git operations for autogpt"""
import git
+
from autogpt.config import Config
+from autogpt.workspace import path_in_workspace
CFG = Config()
def clone_repository(repo_url: str, clone_path: str) -> str:
- """Clone a github repository locally
+ """Clone a GitHub repository locally
Args:
repo_url (str): The URL of the repository to clone
@@ -16,8 +18,9 @@ def clone_repository(repo_url: str, clone_path: str) -> str:
str: The result of the clone operation"""
split_url = repo_url.split("//")
auth_repo_url = f"//{CFG.github_username}:{CFG.github_api_key}@".join(split_url)
+ safe_clone_path = path_in_workspace(clone_path)
try:
- git.Repo.clone_from(auth_repo_url, clone_path)
- return f"""Cloned {repo_url} to {clone_path}"""
+ git.Repo.clone_from(auth_repo_url, safe_clone_path)
+ return f"""Cloned {repo_url} to {safe_clone_path}"""
except Exception as e:
return f"Error: {str(e)}"
diff --git a/autogpt/commands/google_search.py b/autogpt/commands/google_search.py
index 148ba1d0..7d38ce75 100644
--- a/autogpt/commands/google_search.py
+++ b/autogpt/commands/google_search.py
@@ -11,7 +11,7 @@ CFG = Config()
def google_search(query: str, num_results: int = 8) -> str:
- """Return the results of a google search
+ """Return the results of a Google search
Args:
query (str): The search query.
@@ -35,7 +35,7 @@ def google_search(query: str, num_results: int = 8) -> str:
def google_official_search(query: str, num_results: int = 8) -> str | list[str]:
- """Return the results of a google search using the official Google API
+ """Return the results of a Google search using the official Google API
Args:
query (str): The search query.
diff --git a/autogpt/commands/image_gen.py b/autogpt/commands/image_gen.py
index 6243616e..0809fcdd 100644
--- a/autogpt/commands/image_gen.py
+++ b/autogpt/commands/image_gen.py
@@ -7,17 +7,19 @@ from base64 import b64decode
import openai
import requests
from PIL import Image
+
from autogpt.config import Config
from autogpt.workspace import path_in_workspace
CFG = Config()
-def generate_image(prompt: str) -> str:
+def generate_image(prompt: str, size: int = 256) -> str:
"""Generate an image from a prompt.
Args:
prompt (str): The prompt to use
+ size (int, optional): The size of the image. Defaults to 256. (Not supported by HuggingFace)
Returns:
str: The filename of the image
@@ -26,11 +28,14 @@ def generate_image(prompt: str) -> str:
# DALL-E
if CFG.image_provider == "dalle":
- return generate_image_with_dalle(prompt, filename)
- elif CFG.image_provider == "sd":
+ return generate_image_with_dalle(prompt, filename, size)
+ # HuggingFace
+ elif CFG.image_provider == "huggingface":
return generate_image_with_hf(prompt, filename)
- else:
- return "No Image Provider Set"
+ # SD WebUI
+ elif CFG.image_provider == "sdwebui":
+ return generate_image_with_sd_webui(prompt, filename, size)
+ return "No Image Provider Set"
def generate_image_with_hf(prompt: str, filename: str) -> str:
@@ -44,13 +49,16 @@ def generate_image_with_hf(prompt: str, filename: str) -> str:
str: The filename of the image
"""
API_URL = (
- "https://api-inference.huggingface.co/models/CompVis/stable-diffusion-v1-4"
+ f"https://api-inference.huggingface.co/models/{CFG.huggingface_image_model}"
)
if CFG.huggingface_api_token is None:
raise ValueError(
"You need to set your Hugging Face API token in the config file."
)
- headers = {"Authorization": f"Bearer {CFG.huggingface_api_token}"}
+ headers = {
+ "Authorization": f"Bearer {CFG.huggingface_api_token}",
+ "X-Use-Cache": "false",
+ }
response = requests.post(
API_URL,
@@ -80,10 +88,18 @@ def generate_image_with_dalle(prompt: str, filename: str) -> str:
"""
openai.api_key = CFG.openai_api_key
+ # Check for supported image sizes
+ if size not in [256, 512, 1024]:
+ closest = min([256, 512, 1024], key=lambda x: abs(x - size))
+ print(
+ f"DALL-E only supports image sizes of 256x256, 512x512, or 1024x1024. Setting to {closest}, was {size}."
+ )
+ size = closest
+
response = openai.Image.create(
prompt=prompt,
n=1,
- size="256x256",
+ size=f"{size}x{size}",
response_format="b64_json",
)
@@ -95,3 +111,53 @@ def generate_image_with_dalle(prompt: str, filename: str) -> str:
png.write(image_data)
return f"Saved to disk:{filename}"
+
+
+def generate_image_with_sd_webui(
+ prompt: str,
+ filename: str,
+ size: int = 512,
+ negative_prompt: str = "",
+ extra: dict = {},
+) -> str:
+ """Generate an image with Stable Diffusion webui.
+ Args:
+ prompt (str): The prompt to use
+ filename (str): The filename to save the image to
+ size (int, optional): The size of the image. Defaults to 256.
+ negative_prompt (str, optional): The negative prompt to use. Defaults to "".
+ extra (dict, optional): Extra parameters to pass to the API. Defaults to {}.
+ Returns:
+ str: The filename of the image
+ """
+ # Create a session and set the basic auth if needed
+ s = requests.Session()
+ if CFG.sd_webui_auth:
+ username, password = CFG.sd_webui_auth.split(":")
+ s.auth = (username, password or "")
+
+ # Generate the images
+ response = requests.post(
+ f"{CFG.sd_webui_url}/sdapi/v1/txt2img",
+ json={
+ "prompt": prompt,
+ "negative_prompt": negative_prompt,
+ "sampler_index": "DDIM",
+ "steps": 20,
+ "cfg_scale": 7.0,
+ "width": size,
+ "height": size,
+ "n_iter": 1,
+ **extra,
+ },
+ )
+
+ print(f"Image Generated for prompt:{prompt}")
+
+ # Save the image to disk
+ response = response.json()
+ b64 = b64decode(response["images"][0].split(",", 1)[0])
+ image = Image.open(io.BytesIO(b64))
+ image.save(path_in_workspace(filename))
+
+ return f"Saved to disk:{filename}"
diff --git a/autogpt/commands/twitter.py b/autogpt/commands/twitter.py
index dc4d450c..3eaed36e 100644
--- a/autogpt/commands/twitter.py
+++ b/autogpt/commands/twitter.py
@@ -1,5 +1,6 @@
-import tweepy
import os
+
+import tweepy
from dotenv import load_dotenv
load_dotenv()
diff --git a/autogpt/commands/web_playwright.py b/autogpt/commands/web_playwright.py
index a1abb6cb..4e388ded 100644
--- a/autogpt/commands/web_playwright.py
+++ b/autogpt/commands/web_playwright.py
@@ -8,6 +8,7 @@ except ImportError:
"Playwright not installed. Please install it with 'pip install playwright' to use."
)
from bs4 import BeautifulSoup
+
from autogpt.processing.html import extract_hyperlinks, format_hyperlinks
diff --git a/autogpt/commands/web_requests.py b/autogpt/commands/web_requests.py
index 50d8d383..406338f4 100644
--- a/autogpt/commands/web_requests.py
+++ b/autogpt/commands/web_requests.py
@@ -4,9 +4,9 @@ from __future__ import annotations
from urllib.parse import urljoin, urlparse
import requests
-from requests.compat import urljoin
-from requests import Response
from bs4 import BeautifulSoup
+from requests import Response
+from requests.compat import urljoin
from autogpt.config import Config
from autogpt.memory import get_memory
@@ -58,9 +58,28 @@ def check_local_file_access(url: str) -> bool:
"""
local_prefixes = [
"file:///",
+ "file://localhost/",
"file://localhost",
"http://localhost",
+ "http://localhost/",
"https://localhost",
+ "https://localhost/",
+ "http://2130706433",
+ "http://2130706433/",
+ "https://2130706433",
+ "https://2130706433/",
+ "http://127.0.0.1/",
+ "http://127.0.0.1",
+ "https://127.0.0.1/",
+ "https://127.0.0.1",
+ "https://0.0.0.0/",
+ "https://0.0.0.0",
+ "http://0.0.0.0/",
+ "http://0.0.0.0",
+ "http://0000",
+ "http://0000/",
+ "https://0000",
+ "https://0000/",
]
return any(url.startswith(prefix) for prefix in local_prefixes)
diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.py
index 1d078d76..11bdfeb1 100644
--- a/autogpt/commands/web_selenium.py
+++ b/autogpt/commands/web_selenium.py
@@ -1,22 +1,25 @@
"""Selenium web scraping module."""
from __future__ import annotations
-from selenium import webdriver
-from autogpt.processing.html import extract_hyperlinks, format_hyperlinks
-import autogpt.processing.text as summary
-from bs4 import BeautifulSoup
-from selenium.webdriver.remote.webdriver import WebDriver
-from selenium.webdriver.common.by import By
-from selenium.webdriver.support.wait import WebDriverWait
-from selenium.webdriver.support import expected_conditions as EC
-from webdriver_manager.chrome import ChromeDriverManager
-from webdriver_manager.firefox import GeckoDriverManager
-from selenium.webdriver.chrome.options import Options as ChromeOptions
-from selenium.webdriver.firefox.options import Options as FirefoxOptions
-from selenium.webdriver.safari.options import Options as SafariOptions
import logging
from pathlib import Path
+from sys import platform
+
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.options import Options as ChromeOptions
+from selenium.webdriver.common.by import By
+from selenium.webdriver.firefox.options import Options as FirefoxOptions
+from selenium.webdriver.remote.webdriver import WebDriver
+from selenium.webdriver.safari.options import Options as SafariOptions
+from selenium.webdriver.support import expected_conditions as EC
+from selenium.webdriver.support.wait import WebDriverWait
+from webdriver_manager.chrome import ChromeDriverManager
+from webdriver_manager.firefox import GeckoDriverManager
+
+import autogpt.processing.text as summary
from autogpt.config import Config
+from autogpt.processing.html import extract_hyperlinks, format_hyperlinks
FILE_DIR = Path(__file__).parent.parent
CFG = Config()
@@ -75,6 +78,15 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
# See https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
driver = webdriver.Safari(options=options)
else:
+ if platform == "linux" or platform == "linux2":
+ options.add_argument("--disable-dev-shm-usage")
+ options.add_argument("--remote-debugging-port=9222")
+
+ options.add_argument("--no-sandbox")
+ if CFG.selenium_headless:
+ options.add_argument("--headless")
+ options.add_argument("--disable-gpu")
+
driver = webdriver.Chrome(
executable_path=ChromeDriverManager().install(), options=options
)
diff --git a/autogpt/commands/write_tests.py b/autogpt/commands/write_tests.py
index 138a1adb..35a08653 100644
--- a/autogpt/commands/write_tests.py
+++ b/autogpt/commands/write_tests.py
@@ -2,6 +2,7 @@
from __future__ import annotations
import json
+
from autogpt.llm_utils import call_ai_function
diff --git a/autogpt/config/__init__.py b/autogpt/config/__init__.py
index ceb5566c..726b6dcf 100644
--- a/autogpt/config/__init__.py
+++ b/autogpt/config/__init__.py
@@ -2,7 +2,7 @@
This module contains the configuration classes for AutoGPT.
"""
from autogpt.config.ai_config import AIConfig
-from autogpt.config.config import check_openai_api_key, Config
+from autogpt.config.config import Config, check_openai_api_key
from autogpt.config.singleton import AbstractSingleton, Singleton
__all__ = [
diff --git a/autogpt/config/ai_config.py b/autogpt/config/ai_config.py
index 86171357..d50c30be 100644
--- a/autogpt/config/ai_config.py
+++ b/autogpt/config/ai_config.py
@@ -6,6 +6,7 @@ from __future__ import annotations
import os
from typing import Type
+
import yaml
diff --git a/autogpt/config/config.py b/autogpt/config/config.py
index 22da52b0..c284a4ac 100644
--- a/autogpt/config/config.py
+++ b/autogpt/config/config.py
@@ -1,14 +1,13 @@
"""Configuration class to store the state of bools for different scripts access."""
import os
-from colorama import Fore
-
-from autogpt.config.singleton import Singleton
import openai
import yaml
-
+from colorama import Fore
from dotenv import load_dotenv
+from autogpt.config.singleton import Singleton
+
load_dotenv(verbose=True)
@@ -24,22 +23,28 @@ class Config(metaclass=Singleton):
self.continuous_limit = 0
self.speak_mode = False
self.skip_reprompt = False
+ self.allow_downloads = False
+ self.skip_news = False
- self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
self.ai_settings_file = os.getenv("AI_SETTINGS_FILE", "ai_settings.yaml")
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
self.fast_token_limit = int(os.getenv("FAST_TOKEN_LIMIT", 4000))
self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000))
- self.browse_chunk_max_length = int(os.getenv("BROWSE_CHUNK_MAX_LENGTH", 8192))
- self.browse_summary_max_token = int(os.getenv("BROWSE_SUMMARY_MAX_TOKEN", 300))
+ self.browse_chunk_max_length = int(os.getenv("BROWSE_CHUNK_MAX_LENGTH", 3000))
+ self.browse_spacy_language_model = os.getenv(
+ "BROWSE_SPACY_LANGUAGE_MODEL", "en_core_web_sm"
+ )
self.openai_api_key = os.getenv("OPENAI_API_KEY")
- self.temperature = float(os.getenv("TEMPERATURE", "1"))
+ self.temperature = float(os.getenv("TEMPERATURE", "0"))
self.use_azure = os.getenv("USE_AZURE") == "True"
self.execute_local_commands = (
os.getenv("EXECUTE_LOCAL_COMMANDS", "False") == "True"
)
+ self.restrict_to_workspace = (
+ os.getenv("RESTRICT_TO_WORKSPACE", "True") == "True"
+ )
if self.use_azure:
self.load_azure_config()
@@ -66,7 +71,7 @@ class Config(metaclass=Singleton):
self.pinecone_api_key = os.getenv("PINECONE_API_KEY")
self.pinecone_region = os.getenv("PINECONE_ENV")
- self.weaviate_host = os.getenv("WEAVIATE_HOST")
+ self.weaviate_host = os.getenv("WEAVIATE_HOST")
self.weaviate_port = os.getenv("WEAVIATE_PORT")
self.weaviate_protocol = os.getenv("WEAVIATE_PROTOCOL", "http")
self.weaviate_username = os.getenv("WEAVIATE_USERNAME", None)
@@ -74,19 +79,31 @@ class Config(metaclass=Singleton):
self.weaviate_scopes = os.getenv("WEAVIATE_SCOPES", None)
self.weaviate_embedded_path = os.getenv("WEAVIATE_EMBEDDED_PATH")
self.weaviate_api_key = os.getenv("WEAVIATE_API_KEY", None)
- self.use_weaviate_embedded = os.getenv("USE_WEAVIATE_EMBEDDED", "False") == "True"
+ self.use_weaviate_embedded = (
+ os.getenv("USE_WEAVIATE_EMBEDDED", "False") == "True"
+ )
# milvus configuration, e.g., localhost:19530.
self.milvus_addr = os.getenv("MILVUS_ADDR", "localhost:19530")
self.milvus_collection = os.getenv("MILVUS_COLLECTION", "autogpt")
self.image_provider = os.getenv("IMAGE_PROVIDER")
+ self.image_size = int(os.getenv("IMAGE_SIZE", 256))
self.huggingface_api_token = os.getenv("HUGGINGFACE_API_TOKEN")
+ self.huggingface_image_model = os.getenv(
+ "HUGGINGFACE_IMAGE_MODEL", "CompVis/stable-diffusion-v1-4"
+ )
self.huggingface_audio_to_text_model = os.getenv(
"HUGGINGFACE_AUDIO_TO_TEXT_MODEL"
)
+ self.sd_webui_url = os.getenv("SD_WEBUI_URL", "http://localhost:7860")
+ self.sd_webui_auth = os.getenv("SD_WEBUI_AUTH")
- # User agent headers to use when browsing web
+ # Selenium browser settings
+ self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
+ self.selenium_headless = os.getenv("HEADLESS_BROWSER", "True") == "True"
+
+ # User agent header to use when making HTTP requests
# Some websites might just completely deny request with an error code if
# no user agent was found.
self.user_agent = os.getenv(
@@ -94,6 +111,7 @@ class Config(metaclass=Singleton):
"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",
)
+
self.redis_host = os.getenv("REDIS_HOST", "localhost")
self.redis_port = os.getenv("REDIS_PORT", "6379")
self.redis_password = os.getenv("REDIS_PASSWORD", "")
@@ -130,7 +148,7 @@ class Config(metaclass=Singleton):
else:
return ""
- AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "..", "azure.yaml")
+ AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "../..", "azure.yaml")
def load_azure_config(self, config_file: str = AZURE_CONFIG_FILE) -> None:
"""
@@ -153,7 +171,7 @@ class Config(metaclass=Singleton):
self.openai_api_version = (
config_params.get("azure_api_version") or "2023-03-15-preview"
)
- self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", [])
+ self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", {})
def set_continuous_mode(self, value: bool) -> None:
"""Set the continuous mode value."""
@@ -187,10 +205,6 @@ class Config(metaclass=Singleton):
"""Set the browse_website command chunk max length value."""
self.browse_chunk_max_length = value
- def set_browse_summary_max_token(self, value: int) -> None:
- """Set the browse_website command summary max token value."""
- self.browse_summary_max_token = value
-
def set_openai_api_key(self, value: str) -> None:
"""Set the OpenAI API key value."""
self.openai_api_key = value
@@ -236,5 +250,5 @@ def check_openai_api_key() -> None:
Fore.RED
+ "Please set your OpenAI API key in .env or as an environment variable."
)
- print("You can get your key from https://beta.openai.com/account/api-keys")
+ print("You can get your key from https://platform.openai.com/account/api-keys")
exit(1)
diff --git a/autogpt/configurator.py b/autogpt/configurator.py
new file mode 100644
index 00000000..1dc3be12
--- /dev/null
+++ b/autogpt/configurator.py
@@ -0,0 +1,134 @@
+"""Configurator module."""
+import click
+from colorama import Back, Fore, Style
+
+from autogpt import utils
+from autogpt.config import Config
+from autogpt.logs import logger
+from autogpt.memory import get_supported_memory_backends
+
+CFG = Config()
+
+
+def create_config(
+ continuous: bool,
+ continuous_limit: int,
+ ai_settings_file: str,
+ skip_reprompt: bool,
+ speak: bool,
+ debug: bool,
+ gpt3only: bool,
+ gpt4only: bool,
+ memory_type: str,
+ browser_name: str,
+ allow_downloads: bool,
+ skip_news: bool,
+) -> None:
+ """Updates the config object with the given arguments.
+
+ Args:
+ continuous (bool): Whether to run in continuous mode
+ continuous_limit (int): The number of times to run in continuous mode
+ ai_settings_file (str): The path to the ai_settings.yaml file
+ skip_reprompt (bool): Whether to skip the re-prompting messages at the beginning of the script
+ speak (bool): Whether to enable speak mode
+ debug (bool): Whether to enable debug mode
+ gpt3only (bool): Whether to enable GPT3.5 only mode
+ gpt4only (bool): Whether to enable GPT4 only mode
+ memory_type (str): The type of memory backend to use
+ browser_name (str): The name of the browser to use when using selenium to scrape the web
+ allow_downloads (bool): Whether to allow Auto-GPT to download files natively
+ skips_news (bool): Whether to suppress the output of latest news on startup
+ """
+ CFG.set_debug_mode(False)
+ CFG.set_continuous_mode(False)
+ CFG.set_speak_mode(False)
+
+ if debug:
+ logger.typewriter_log("Debug Mode: ", Fore.GREEN, "ENABLED")
+ CFG.set_debug_mode(True)
+
+ if continuous:
+ logger.typewriter_log("Continuous Mode: ", Fore.RED, "ENABLED")
+ logger.typewriter_log(
+ "WARNING: ",
+ Fore.RED,
+ "Continuous mode is not recommended. It is potentially dangerous and may"
+ " cause your AI to run forever or carry out actions you would not usually"
+ " authorise. Use at your own risk.",
+ )
+ CFG.set_continuous_mode(True)
+
+ if continuous_limit:
+ logger.typewriter_log(
+ "Continuous Limit: ", Fore.GREEN, f"{continuous_limit}"
+ )
+ CFG.set_continuous_limit(continuous_limit)
+
+ # Check if continuous limit is used without continuous mode
+ if continuous_limit and not continuous:
+ raise click.UsageError("--continuous-limit can only be used with --continuous")
+
+ if speak:
+ logger.typewriter_log("Speak Mode: ", Fore.GREEN, "ENABLED")
+ CFG.set_speak_mode(True)
+
+ if gpt3only:
+ logger.typewriter_log("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED")
+ CFG.set_smart_llm_model(CFG.fast_llm_model)
+
+ if gpt4only:
+ logger.typewriter_log("GPT4 Only Mode: ", Fore.GREEN, "ENABLED")
+ CFG.set_fast_llm_model(CFG.smart_llm_model)
+
+ if memory_type:
+ supported_memory = get_supported_memory_backends()
+ chosen = memory_type
+ if chosen not in supported_memory:
+ logger.typewriter_log(
+ "ONLY THE FOLLOWING MEMORY BACKENDS ARE SUPPORTED: ",
+ Fore.RED,
+ f"{supported_memory}",
+ )
+ logger.typewriter_log("Defaulting to: ", Fore.YELLOW, CFG.memory_backend)
+ else:
+ CFG.memory_backend = chosen
+
+ if skip_reprompt:
+ logger.typewriter_log("Skip Re-prompt: ", Fore.GREEN, "ENABLED")
+ CFG.skip_reprompt = True
+
+ if ai_settings_file:
+ file = ai_settings_file
+
+ # Validate file
+ (validated, message) = utils.validate_yaml_file(file)
+ if not validated:
+ logger.typewriter_log("FAILED FILE VALIDATION", Fore.RED, message)
+ logger.double_check()
+ exit(1)
+
+ logger.typewriter_log("Using AI Settings File:", Fore.GREEN, file)
+ CFG.ai_settings_file = file
+ CFG.skip_reprompt = True
+
+ if allow_downloads:
+ logger.typewriter_log("Native Downloading:", Fore.GREEN, "ENABLED")
+ logger.typewriter_log(
+ "WARNING: ",
+ Fore.YELLOW,
+ f"{Back.LIGHTYELLOW_EX}Auto-GPT will now be able to download and save files to your machine.{Back.RESET} "
+ + "It is recommended that you monitor any files it downloads carefully.",
+ )
+ logger.typewriter_log(
+ "WARNING: ",
+ Fore.YELLOW,
+ f"{Back.RED + Style.BRIGHT}ALWAYS REMEMBER TO NEVER OPEN FILES YOU AREN'T SURE OF!{Style.RESET_ALL}",
+ )
+ CFG.allow_downloads = True
+
+ if skip_news:
+ CFG.skip_news = True
+
+ if browser_name:
+ CFG.selenium_web_browser = browser_name
diff --git a/autogpt/json_fixes/auto_fix.py b/autogpt/json_fixes/auto_fix.py
deleted file mode 100644
index 9fcf909a..00000000
--- a/autogpt/json_fixes/auto_fix.py
+++ /dev/null
@@ -1,53 +0,0 @@
-"""This module contains the function to fix JSON strings using GPT-3."""
-import json
-
-from autogpt.llm_utils import call_ai_function
-from autogpt.logs import logger
-from autogpt.config import Config
-
-CFG = Config()
-
-
-def fix_json(json_string: str, schema: str) -> str:
- """Fix the given JSON string to make it parseable and fully compliant with
- the provided schema.
-
- Args:
- json_string (str): The JSON string to fix.
- schema (str): The schema to use to fix the JSON.
- Returns:
- str: The fixed JSON string.
- """
- # Try to fix the JSON using GPT:
- function_string = "def fix_json(json_string: str, schema:str=None) -> str:"
- args = [f"'''{json_string}'''", f"'''{schema}'''"]
- description_string = (
- "This function takes a JSON string and ensures that it"
- " is parseable and fully compliant with the provided schema. If an object"
- " or field specified in the schema isn't contained within the correct JSON,"
- " it is omitted. The function also escapes any double quotes within JSON"
- " string values to ensure that they are valid. If the JSON string contains"
- " any None or NaN values, they are replaced with null before being parsed."
- )
-
- # If it doesn't already start with a "`", add one:
- if not json_string.startswith("`"):
- json_string = "```json\n" + json_string + "\n```"
- result_string = call_ai_function(
- function_string, args, description_string, model=CFG.fast_llm_model
- )
- logger.debug("------------ JSON FIX ATTEMPT ---------------")
- logger.debug(f"Original JSON: {json_string}")
- logger.debug("-----------")
- logger.debug(f"Fixed JSON: {result_string}")
- logger.debug("----------- END OF FIX ATTEMPT ----------------")
-
- try:
- json.loads(result_string) # just check the validity
- return result_string
- except json.JSONDecodeError: # noqa: E722
- # Get the call stack:
- # import traceback
- # call_stack = traceback.format_exc()
- # print(f"Failed to fix JSON: '{json_string}' "+call_stack)
- return "failed"
diff --git a/autogpt/json_fixes/bracket_termination.py b/autogpt/json_fixes/bracket_termination.py
deleted file mode 100644
index 822eed4a..00000000
--- a/autogpt/json_fixes/bracket_termination.py
+++ /dev/null
@@ -1,74 +0,0 @@
-"""Fix JSON brackets."""
-from __future__ import annotations
-
-import contextlib
-import json
-import regex
-from colorama import Fore
-
-from autogpt.logs import logger
-from autogpt.config import Config
-from autogpt.speech import say_text
-
-CFG = Config()
-
-
-def attempt_to_fix_json_by_finding_outermost_brackets(json_string: str):
- if CFG.speak_mode and CFG.debug_mode:
- say_text(
- "I have received an invalid JSON response from the OpenAI API. "
- "Trying to fix it now."
- )
- logger.typewriter_log("Attempting to fix JSON by finding outermost brackets\n")
-
- try:
- json_pattern = regex.compile(r"\{(?:[^{}]|(?R))*\}")
- json_match = json_pattern.search(json_string)
-
- if json_match:
- # Extract the valid JSON object from the string
- json_string = json_match.group(0)
- logger.typewriter_log(
- title="Apparently json was fixed.", title_color=Fore.GREEN
- )
- if CFG.speak_mode and CFG.debug_mode:
- say_text("Apparently json was fixed.")
- else:
- raise ValueError("No valid JSON object found")
-
- except (json.JSONDecodeError, ValueError):
- if CFG.debug_mode:
- logger.error(f"Error: Invalid JSON: {json_string}\n")
- if CFG.speak_mode:
- say_text("Didn't work. I will have to ignore this response then.")
- logger.error("Error: Invalid JSON, setting it to empty JSON now.\n")
- json_string = {}
-
- return json_string
-
-
-def balance_braces(json_string: str) -> str | None:
- """
- Balance the braces in a JSON string.
-
- Args:
- json_string (str): The JSON string.
-
- Returns:
- str: The JSON string with braces balanced.
- """
-
- open_braces_count = json_string.count("{")
- close_braces_count = json_string.count("}")
-
- while open_braces_count > close_braces_count:
- json_string += "}"
- close_braces_count += 1
-
- while close_braces_count > open_braces_count:
- json_string = json_string.rstrip("}")
- close_braces_count -= 1
-
- with contextlib.suppress(json.JSONDecodeError):
- json.loads(json_string)
- return json_string
diff --git a/autogpt/json_fixes/escaping.py b/autogpt/json_fixes/escaping.py
deleted file mode 100644
index 68eb1714..00000000
--- a/autogpt/json_fixes/escaping.py
+++ /dev/null
@@ -1,33 +0,0 @@
-""" Fix invalid escape sequences in JSON strings. """
-import json
-
-from autogpt.config import Config
-from autogpt.json_fixes.utilities import extract_char_position
-
-CFG = Config()
-
-
-def fix_invalid_escape(json_to_load: str, error_message: str) -> str:
- """Fix invalid escape sequences in JSON strings.
-
- Args:
- json_to_load (str): The JSON string.
- error_message (str): The error message from the JSONDecodeError
- exception.
-
- Returns:
- str: The JSON string with invalid escape sequences fixed.
- """
- while error_message.startswith("Invalid \\escape"):
- bad_escape_location = extract_char_position(error_message)
- json_to_load = (
- json_to_load[:bad_escape_location] + json_to_load[bad_escape_location + 1 :]
- )
- try:
- json.loads(json_to_load)
- return json_to_load
- except json.JSONDecodeError as e:
- if CFG.debug_mode:
- print("json loads error - fix invalid escape", e)
- error_message = str(e)
- return json_to_load
diff --git a/autogpt/json_fixes/missing_quotes.py b/autogpt/json_fixes/missing_quotes.py
deleted file mode 100644
index 552a1517..00000000
--- a/autogpt/json_fixes/missing_quotes.py
+++ /dev/null
@@ -1,27 +0,0 @@
-"""Fix quotes in a JSON string."""
-import json
-import re
-
-
-def add_quotes_to_property_names(json_string: str) -> str:
- """
- Add quotes to property names in a JSON string.
-
- Args:
- json_string (str): The JSON string.
-
- Returns:
- str: The JSON string with quotes added to property names.
- """
-
- def replace_func(match: re.Match) -> str:
- return f'"{match[1]}":'
-
- property_name_pattern = re.compile(r"(\w+):")
- corrected_json_string = property_name_pattern.sub(replace_func, json_string)
-
- try:
- json.loads(corrected_json_string)
- return corrected_json_string
- except json.JSONDecodeError as e:
- raise e
diff --git a/autogpt/json_fixes/parsing.py b/autogpt/json_fixes/parsing.py
deleted file mode 100644
index 0f154411..00000000
--- a/autogpt/json_fixes/parsing.py
+++ /dev/null
@@ -1,144 +0,0 @@
-"""Fix and parse JSON strings."""
-from __future__ import annotations
-
-import contextlib
-import json
-from typing import Any
-
-from autogpt.config import Config
-from autogpt.json_fixes.auto_fix import fix_json
-from autogpt.json_fixes.bracket_termination import balance_braces
-from autogpt.json_fixes.escaping import fix_invalid_escape
-from autogpt.json_fixes.missing_quotes import add_quotes_to_property_names
-from autogpt.logs import logger
-
-CFG = Config()
-
-
-JSON_SCHEMA = """
-{
- "command": {
- "name": "command name",
- "args": {
- "arg name": "value"
- }
- },
- "thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "plan": "- short bulleted\n- list that conveys\n- long-term plan",
- "criticism": "constructive self-criticism",
- "speak": "thoughts summary to say to user"
- }
-}
-"""
-
-
-def correct_json(json_to_load: str) -> str:
- """
- Correct common JSON errors.
-
- Args:
- json_to_load (str): The JSON string.
- """
-
- try:
- if CFG.debug_mode:
- print("json", json_to_load)
- json.loads(json_to_load)
- return json_to_load
- except json.JSONDecodeError as e:
- if CFG.debug_mode:
- print("json loads error", e)
- error_message = str(e)
- if error_message.startswith("Invalid \\escape"):
- json_to_load = fix_invalid_escape(json_to_load, error_message)
- if error_message.startswith(
- "Expecting property name enclosed in double quotes"
- ):
- json_to_load = add_quotes_to_property_names(json_to_load)
- try:
- json.loads(json_to_load)
- return json_to_load
- except json.JSONDecodeError as e:
- if CFG.debug_mode:
- print("json loads error - add quotes", e)
- error_message = str(e)
- if balanced_str := balance_braces(json_to_load):
- return balanced_str
- return json_to_load
-
-
-def fix_and_parse_json(
- json_to_load: str, try_to_fix_with_gpt: bool = True
-) -> str | dict[Any, Any]:
- """Fix and parse JSON string
-
- Args:
- json_to_load (str): The JSON string.
- try_to_fix_with_gpt (bool, optional): Try to fix the JSON with GPT.
- Defaults to True.
-
- Returns:
- str or dict[Any, Any]: The parsed JSON.
- """
-
- with contextlib.suppress(json.JSONDecodeError):
- json_to_load = json_to_load.replace("\t", "")
- return json.loads(json_to_load)
-
- with contextlib.suppress(json.JSONDecodeError):
- json_to_load = correct_json(json_to_load)
- return json.loads(json_to_load)
- # Let's do something manually:
- # sometimes GPT responds with something BEFORE the braces:
- # "I'm sorry, I don't understand. Please try again."
- # {"text": "I'm sorry, I don't understand. Please try again.",
- # "confidence": 0.0}
- # So let's try to find the first brace and then parse the rest
- # of the string
- try:
- brace_index = json_to_load.index("{")
- maybe_fixed_json = json_to_load[brace_index:]
- last_brace_index = maybe_fixed_json.rindex("}")
- maybe_fixed_json = maybe_fixed_json[: last_brace_index + 1]
- return json.loads(maybe_fixed_json)
- except (json.JSONDecodeError, ValueError) as e:
- return try_ai_fix(try_to_fix_with_gpt, e, json_to_load)
-
-
-def try_ai_fix(
- try_to_fix_with_gpt: bool, exception: Exception, json_to_load: str
-) -> str | dict[Any, Any]:
- """Try to fix the JSON with the AI
-
- Args:
- try_to_fix_with_gpt (bool): Whether to try to fix the JSON with the AI.
- exception (Exception): The exception that was raised.
- json_to_load (str): The JSON string to load.
-
- Raises:
- exception: If try_to_fix_with_gpt is False.
-
- Returns:
- str or dict[Any, Any]: The JSON string or dictionary.
- """
- if not try_to_fix_with_gpt:
- raise exception
-
- logger.warn(
- "Warning: Failed to parse AI output, attempting to fix."
- "\n If you see this warning frequently, it's likely that"
- " your prompt is confusing the AI. Try changing it up"
- " slightly."
- )
- # Now try to fix this up using the ai_functions
- ai_fixed_json = fix_json(json_to_load, JSON_SCHEMA)
-
- if ai_fixed_json != "failed":
- return json.loads(ai_fixed_json)
- # This allows the AI to react to the error message,
- # which usually results in it correcting its ways.
- logger.error("Failed to fix AI output, telling the AI.")
- return json_to_load
diff --git a/autogpt/json_fixes/utilities.py b/autogpt/json_fixes/utilities.py
deleted file mode 100644
index 0852b18a..00000000
--- a/autogpt/json_fixes/utilities.py
+++ /dev/null
@@ -1,20 +0,0 @@
-"""Utilities for the json_fixes package."""
-import re
-
-
-def extract_char_position(error_message: str) -> int:
- """Extract the character position from the JSONDecodeError message.
-
- Args:
- error_message (str): The error message from the JSONDecodeError
- exception.
-
- Returns:
- int: The character position.
- """
-
- char_pattern = re.compile(r"\(char (\d+)\)")
- if match := char_pattern.search(error_message):
- return int(match[1])
- else:
- raise ValueError("Character position not found in the error message.")
diff --git a/autogpt/json_fixes/__init__.py b/autogpt/json_utils/__init__.py
similarity index 100%
rename from autogpt/json_fixes/__init__.py
rename to autogpt/json_utils/__init__.py
diff --git a/autogpt/json_utils/json_fix_general.py b/autogpt/json_utils/json_fix_general.py
new file mode 100644
index 00000000..7010fa3b
--- /dev/null
+++ b/autogpt/json_utils/json_fix_general.py
@@ -0,0 +1,124 @@
+"""This module contains functions to fix JSON strings using general programmatic approaches, suitable for addressing
+common JSON formatting issues."""
+from __future__ import annotations
+
+import contextlib
+import json
+import re
+from typing import Optional
+
+from autogpt.config import Config
+from autogpt.json_utils.utilities import extract_char_position
+
+CFG = Config()
+
+
+def fix_invalid_escape(json_to_load: str, error_message: str) -> str:
+ """Fix invalid escape sequences in JSON strings.
+
+ Args:
+ json_to_load (str): The JSON string.
+ error_message (str): The error message from the JSONDecodeError
+ exception.
+
+ Returns:
+ str: The JSON string with invalid escape sequences fixed.
+ """
+ while error_message.startswith("Invalid \\escape"):
+ bad_escape_location = extract_char_position(error_message)
+ json_to_load = (
+ json_to_load[:bad_escape_location] + json_to_load[bad_escape_location + 1 :]
+ )
+ try:
+ json.loads(json_to_load)
+ return json_to_load
+ except json.JSONDecodeError as e:
+ if CFG.debug_mode:
+ print("json loads error - fix invalid escape", e)
+ error_message = str(e)
+ return json_to_load
+
+
+def balance_braces(json_string: str) -> Optional[str]:
+ """
+ Balance the braces in a JSON string.
+
+ Args:
+ json_string (str): The JSON string.
+
+ Returns:
+ str: The JSON string with braces balanced.
+ """
+
+ open_braces_count = json_string.count("{")
+ close_braces_count = json_string.count("}")
+
+ while open_braces_count > close_braces_count:
+ json_string += "}"
+ close_braces_count += 1
+
+ while close_braces_count > open_braces_count:
+ json_string = json_string.rstrip("}")
+ close_braces_count -= 1
+
+ with contextlib.suppress(json.JSONDecodeError):
+ json.loads(json_string)
+ return json_string
+
+
+def add_quotes_to_property_names(json_string: str) -> str:
+ """
+ Add quotes to property names in a JSON string.
+
+ Args:
+ json_string (str): The JSON string.
+
+ Returns:
+ str: The JSON string with quotes added to property names.
+ """
+
+ def replace_func(match: re.Match) -> str:
+ return f'"{match[1]}":'
+
+ property_name_pattern = re.compile(r"(\w+):")
+ corrected_json_string = property_name_pattern.sub(replace_func, json_string)
+
+ try:
+ json.loads(corrected_json_string)
+ return corrected_json_string
+ except json.JSONDecodeError as e:
+ raise e
+
+
+def correct_json(json_to_load: str) -> str:
+ """
+ Correct common JSON errors.
+ Args:
+ json_to_load (str): The JSON string.
+ """
+
+ try:
+ if CFG.debug_mode:
+ print("json", json_to_load)
+ json.loads(json_to_load)
+ return json_to_load
+ except json.JSONDecodeError as e:
+ if CFG.debug_mode:
+ print("json loads error", e)
+ error_message = str(e)
+ if error_message.startswith("Invalid \\escape"):
+ json_to_load = fix_invalid_escape(json_to_load, error_message)
+ if error_message.startswith(
+ "Expecting property name enclosed in double quotes"
+ ):
+ json_to_load = add_quotes_to_property_names(json_to_load)
+ try:
+ json.loads(json_to_load)
+ return json_to_load
+ except json.JSONDecodeError as e:
+ if CFG.debug_mode:
+ print("json loads error - add quotes", e)
+ error_message = str(e)
+ if balanced_str := balance_braces(json_to_load):
+ return balanced_str
+ return json_to_load
diff --git a/autogpt/json_utils/json_fix_llm.py b/autogpt/json_utils/json_fix_llm.py
new file mode 100644
index 00000000..869aed12
--- /dev/null
+++ b/autogpt/json_utils/json_fix_llm.py
@@ -0,0 +1,220 @@
+"""This module contains functions to fix JSON strings generated by LLM models, such as ChatGPT, using the assistance
+of the ChatGPT API or LLM models."""
+from __future__ import annotations
+
+import contextlib
+import json
+from typing import Any, Dict
+
+from colorama import Fore
+from regex import regex
+
+from autogpt.config import Config
+from autogpt.json_utils.json_fix_general import correct_json
+from autogpt.llm_utils import call_ai_function
+from autogpt.logs import logger
+from autogpt.speech import say_text
+
+JSON_SCHEMA = """
+{
+ "command": {
+ "name": "command name",
+ "args": {
+ "arg name": "value"
+ }
+ },
+ "thoughts":
+ {
+ "text": "thought",
+ "reasoning": "reasoning",
+ "plan": "- short bulleted\n- list that conveys\n- long-term plan",
+ "criticism": "constructive self-criticism",
+ "speak": "thoughts summary to say to user"
+ }
+}
+"""
+
+CFG = Config()
+
+
+def auto_fix_json(json_string: str, schema: str) -> str:
+ """Fix the given JSON string to make it parseable and fully compliant with
+ the provided schema using GPT-3.
+
+ Args:
+ json_string (str): The JSON string to fix.
+ schema (str): The schema to use to fix the JSON.
+ Returns:
+ str: The fixed JSON string.
+ """
+ # Try to fix the JSON using GPT:
+ function_string = "def fix_json(json_string: str, schema:str=None) -> str:"
+ args = [f"'''{json_string}'''", f"'''{schema}'''"]
+ description_string = (
+ "This function takes a JSON string and ensures that it"
+ " is parseable and fully compliant with the provided schema. If an object"
+ " or field specified in the schema isn't contained within the correct JSON,"
+ " it is omitted. The function also escapes any double quotes within JSON"
+ " string values to ensure that they are valid. If the JSON string contains"
+ " any None or NaN values, they are replaced with null before being parsed."
+ )
+
+ # If it doesn't already start with a "`", add one:
+ if not json_string.startswith("`"):
+ json_string = "```json\n" + json_string + "\n```"
+ result_string = call_ai_function(
+ function_string, args, description_string, model=CFG.fast_llm_model
+ )
+ logger.debug("------------ JSON FIX ATTEMPT ---------------")
+ logger.debug(f"Original JSON: {json_string}")
+ logger.debug("-----------")
+ logger.debug(f"Fixed JSON: {result_string}")
+ logger.debug("----------- END OF FIX ATTEMPT ----------------")
+
+ try:
+ json.loads(result_string) # just check the validity
+ return result_string
+ except json.JSONDecodeError: # noqa: E722
+ # Get the call stack:
+ # import traceback
+ # call_stack = traceback.format_exc()
+ # print(f"Failed to fix JSON: '{json_string}' "+call_stack)
+ return "failed"
+
+
+def fix_json_using_multiple_techniques(assistant_reply: str) -> Dict[Any, Any]:
+ """Fix the given JSON string to make it parseable and fully compliant with two techniques.
+
+ Args:
+ json_string (str): The JSON string to fix.
+
+ Returns:
+ str: The fixed JSON string.
+ """
+
+ # Parse and print Assistant response
+ assistant_reply_json = fix_and_parse_json(assistant_reply)
+ if assistant_reply_json == {}:
+ assistant_reply_json = attempt_to_fix_json_by_finding_outermost_brackets(
+ assistant_reply
+ )
+
+ if assistant_reply_json != {}:
+ return assistant_reply_json
+
+ logger.error(
+ "Error: The following AI output couldn't be converted to a JSON:\n",
+ assistant_reply,
+ )
+ if CFG.speak_mode:
+ say_text("I have received an invalid JSON response from the OpenAI API.")
+
+ return {}
+
+
+def fix_and_parse_json(
+ json_to_load: str, try_to_fix_with_gpt: bool = True
+) -> Dict[Any, Any]:
+ """Fix and parse JSON string
+
+ Args:
+ json_to_load (str): The JSON string.
+ try_to_fix_with_gpt (bool, optional): Try to fix the JSON with GPT.
+ Defaults to True.
+
+ Returns:
+ str or dict[Any, Any]: The parsed JSON.
+ """
+
+ with contextlib.suppress(json.JSONDecodeError):
+ json_to_load = json_to_load.replace("\t", "")
+ return json.loads(json_to_load)
+
+ with contextlib.suppress(json.JSONDecodeError):
+ json_to_load = correct_json(json_to_load)
+ return json.loads(json_to_load)
+ # Let's do something manually:
+ # sometimes GPT responds with something BEFORE the braces:
+ # "I'm sorry, I don't understand. Please try again."
+ # {"text": "I'm sorry, I don't understand. Please try again.",
+ # "confidence": 0.0}
+ # So let's try to find the first brace and then parse the rest
+ # of the string
+ try:
+ brace_index = json_to_load.index("{")
+ maybe_fixed_json = json_to_load[brace_index:]
+ last_brace_index = maybe_fixed_json.rindex("}")
+ maybe_fixed_json = maybe_fixed_json[: last_brace_index + 1]
+ return json.loads(maybe_fixed_json)
+ except (json.JSONDecodeError, ValueError) as e:
+ return try_ai_fix(try_to_fix_with_gpt, e, json_to_load)
+
+
+def try_ai_fix(
+ try_to_fix_with_gpt: bool, exception: Exception, json_to_load: str
+) -> Dict[Any, Any]:
+ """Try to fix the JSON with the AI
+
+ Args:
+ try_to_fix_with_gpt (bool): Whether to try to fix the JSON with the AI.
+ exception (Exception): The exception that was raised.
+ json_to_load (str): The JSON string to load.
+
+ Raises:
+ exception: If try_to_fix_with_gpt is False.
+
+ Returns:
+ str or dict[Any, Any]: The JSON string or dictionary.
+ """
+ if not try_to_fix_with_gpt:
+ raise exception
+ if CFG.debug_mode:
+ logger.warn(
+ "Warning: Failed to parse AI output, attempting to fix."
+ "\n If you see this warning frequently, it's likely that"
+ " your prompt is confusing the AI. Try changing it up"
+ " slightly."
+ )
+ # Now try to fix this up using the ai_functions
+ ai_fixed_json = auto_fix_json(json_to_load, JSON_SCHEMA)
+
+ if ai_fixed_json != "failed":
+ return json.loads(ai_fixed_json)
+ # This allows the AI to react to the error message,
+ # which usually results in it correcting its ways.
+ # logger.error("Failed to fix AI output, telling the AI.")
+ return {}
+
+
+def attempt_to_fix_json_by_finding_outermost_brackets(json_string: str):
+ if CFG.speak_mode and CFG.debug_mode:
+ say_text(
+ "I have received an invalid JSON response from the OpenAI API. "
+ "Trying to fix it now."
+ )
+ logger.error("Attempting to fix JSON by finding outermost brackets\n")
+
+ try:
+ json_pattern = regex.compile(r"\{(?:[^{}]|(?R))*\}")
+ json_match = json_pattern.search(json_string)
+
+ if json_match:
+ # Extract the valid JSON object from the string
+ json_string = json_match.group(0)
+ logger.typewriter_log(
+ title="Apparently json was fixed.", title_color=Fore.GREEN
+ )
+ if CFG.speak_mode and CFG.debug_mode:
+ say_text("Apparently json was fixed.")
+ else:
+ return {}
+
+ except (json.JSONDecodeError, ValueError):
+ if CFG.debug_mode:
+ logger.error(f"Error: Invalid JSON: {json_string}\n")
+ if CFG.speak_mode:
+ say_text("Didn't work. I will have to ignore this response then.")
+ logger.error("Error: Invalid JSON, setting it to empty JSON now.\n")
+ json_string = {}
+
+ return fix_and_parse_json(json_string)
diff --git a/autogpt/json_utils/llm_response_format_1.json b/autogpt/json_utils/llm_response_format_1.json
new file mode 100644
index 00000000..9aa33352
--- /dev/null
+++ b/autogpt/json_utils/llm_response_format_1.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "object",
+ "properties": {
+ "thoughts": {
+ "type": "object",
+ "properties": {
+ "text": {"type": "string"},
+ "reasoning": {"type": "string"},
+ "plan": {"type": "string"},
+ "criticism": {"type": "string"},
+ "speak": {"type": "string"}
+ },
+ "required": ["text", "reasoning", "plan", "criticism", "speak"],
+ "additionalProperties": false
+ },
+ "command": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string"},
+ "args": {
+ "type": "object"
+ }
+ },
+ "required": ["name", "args"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["thoughts", "command"],
+ "additionalProperties": false
+}
diff --git a/autogpt/json_utils/utilities.py b/autogpt/json_utils/utilities.py
new file mode 100644
index 00000000..eb9bb687
--- /dev/null
+++ b/autogpt/json_utils/utilities.py
@@ -0,0 +1,54 @@
+"""Utilities for the json_fixes package."""
+import json
+import re
+
+from jsonschema import Draft7Validator
+
+from autogpt.config import Config
+from autogpt.logs import logger
+
+CFG = Config()
+
+
+def extract_char_position(error_message: str) -> int:
+ """Extract the character position from the JSONDecodeError message.
+
+ Args:
+ error_message (str): The error message from the JSONDecodeError
+ exception.
+
+ Returns:
+ int: The character position.
+ """
+
+ char_pattern = re.compile(r"\(char (\d+)\)")
+ if match := char_pattern.search(error_message):
+ return int(match[1])
+ else:
+ raise ValueError("Character position not found in the error message.")
+
+
+def validate_json(json_object: object, schema_name: object) -> object:
+ """
+ :type schema_name: object
+ :param schema_name:
+ :type json_object: object
+ """
+ with open(f"autogpt/json_utils/{schema_name}.json", "r") as f:
+ schema = json.load(f)
+ validator = Draft7Validator(schema)
+
+ if errors := sorted(validator.iter_errors(json_object), key=lambda e: e.path):
+ logger.error("The JSON object is invalid.")
+ if CFG.debug_mode:
+ logger.error(
+ json.dumps(json_object, indent=4)
+ ) # Replace 'json_object' with the variable containing the JSON data
+ logger.error("The following issues were found:")
+
+ for error in errors:
+ logger.error(f"Error: {error.message}")
+ elif CFG.debug_mode:
+ print("The JSON object is valid.")
+
+ return json_object
diff --git a/autogpt/llm_utils.py b/autogpt/llm_utils.py
index 2075f934..821820ff 100644
--- a/autogpt/llm_utils.py
+++ b/autogpt/llm_utils.py
@@ -1,13 +1,14 @@
from __future__ import annotations
-from ast import List
import time
+from ast import List
import openai
+from colorama import Fore, Style
from openai.error import APIError, RateLimitError
-from colorama import Fore
from autogpt.config import Config
+from autogpt.logs import logger
CFG = Config()
@@ -70,6 +71,7 @@ def create_chat_completion(
"""
response = None
num_retries = 10
+ warned_user = False
if CFG.debug_mode:
print(
Fore.GREEN
@@ -101,6 +103,12 @@ def create_chat_completion(
Fore.RED + "Error: ",
f"Reached rate limit, passing..." + Fore.RESET,
)
+ if not warned_user:
+ logger.double_check(
+ f"Please double check that you have setup a {Fore.CYAN + Style.BRIGHT}PAID{Style.RESET_ALL} OpenAI API Account. "
+ + f"You can read more here: {Fore.CYAN}https://github.com/Significant-Gravitas/Auto-GPT#openai-api-keys-configuration{Fore.RESET}"
+ )
+ warned_user = True
except APIError as e:
if e.http_status == 502:
pass
@@ -115,13 +123,23 @@ def create_chat_completion(
)
time.sleep(backoff)
if response is None:
- raise RuntimeError(f"Failed to get response after {num_retries} retries")
+ logger.typewriter_log(
+ "FAILED TO GET RESPONSE FROM OPENAI",
+ Fore.RED,
+ "Auto-GPT has failed to get a response from OpenAI's services. "
+ + f"Try running Auto-GPT again, and if the problem the persists try running it with `{Fore.CYAN}--debug{Fore.RESET}`.",
+ )
+ logger.double_check()
+ if CFG.debug_mode:
+ raise RuntimeError(f"Failed to get response after {num_retries} retries")
+ else:
+ quit(1)
return response.choices[0].message["content"]
def create_embedding_with_ada(text) -> list:
- """Create a embedding with text-ada-002 using the OpenAI SDK"""
+ """Create an embedding with text-ada-002 using the OpenAI SDK"""
num_retries = 10
for attempt in range(num_retries):
backoff = 2 ** (attempt + 2)
diff --git a/autogpt/logs.py b/autogpt/logs.py
index 22ce23f4..35037404 100644
--- a/autogpt/logs.py
+++ b/autogpt/logs.py
@@ -5,13 +5,13 @@ import os
import random
import re
import time
-from logging import LogRecord
import traceback
+from logging import LogRecord
from colorama import Fore, Style
-from autogpt.speech import say_text
from autogpt.config import Config, Singleton
+from autogpt.speech import say_text
CFG = Config()
@@ -46,7 +46,9 @@ class Logger(metaclass=Singleton):
self.console_handler.setFormatter(console_formatter)
# Info handler in activity.log
- self.file_handler = logging.FileHandler(os.path.join(log_dir, log_file))
+ self.file_handler = logging.FileHandler(
+ os.path.join(log_dir, log_file), "a", "utf-8"
+ )
self.file_handler.setLevel(logging.DEBUG)
info_formatter = AutoGptFormatter(
"%(asctime)s %(levelname)s %(title)s %(message_no_color)s"
@@ -54,7 +56,9 @@ class Logger(metaclass=Singleton):
self.file_handler.setFormatter(info_formatter)
# Error handler error.log
- error_handler = logging.FileHandler(os.path.join(log_dir, error_file))
+ error_handler = logging.FileHandler(
+ os.path.join(log_dir, error_file), "a", "utf-8"
+ )
error_handler.setLevel(logging.ERROR)
error_formatter = AutoGptFormatter(
"%(asctime)s %(levelname)s %(module)s:%(funcName)s:%(lineno)d %(title)s"
@@ -200,10 +204,10 @@ logger = Logger()
def print_assistant_thoughts(ai_name, assistant_reply):
"""Prints the assistant's thoughts to the console"""
- from autogpt.json_fixes.bracket_termination import (
+ from autogpt.json_utils.json_fix_llm import (
attempt_to_fix_json_by_finding_outermost_brackets,
+ fix_and_parse_json,
)
- from autogpt.json_fixes.parsing import fix_and_parse_json
try:
try:
@@ -288,3 +292,41 @@ def print_assistant_thoughts(ai_name, assistant_reply):
except Exception:
call_stack = traceback.format_exc()
logger.error("Error: \n", call_stack)
+
+
+def print_assistant_thoughts(
+ ai_name: object, assistant_reply_json_valid: object
+) -> None:
+ assistant_thoughts_reasoning = None
+ assistant_thoughts_plan = None
+ assistant_thoughts_speak = None
+ assistant_thoughts_criticism = None
+
+ assistant_thoughts = assistant_reply_json_valid.get("thoughts", {})
+ assistant_thoughts_text = assistant_thoughts.get("text")
+ if assistant_thoughts:
+ assistant_thoughts_reasoning = assistant_thoughts.get("reasoning")
+ assistant_thoughts_plan = assistant_thoughts.get("plan")
+ assistant_thoughts_criticism = assistant_thoughts.get("criticism")
+ assistant_thoughts_speak = assistant_thoughts.get("speak")
+ logger.typewriter_log(
+ f"{ai_name.upper()} THOUGHTS:", Fore.YELLOW, f"{assistant_thoughts_text}"
+ )
+ logger.typewriter_log("REASONING:", Fore.YELLOW, f"{assistant_thoughts_reasoning}")
+ if assistant_thoughts_plan:
+ logger.typewriter_log("PLAN:", Fore.YELLOW, "")
+ # If it's a list, join it into a string
+ if isinstance(assistant_thoughts_plan, list):
+ assistant_thoughts_plan = "\n".join(assistant_thoughts_plan)
+ elif isinstance(assistant_thoughts_plan, dict):
+ assistant_thoughts_plan = str(assistant_thoughts_plan)
+
+ # Split the input_string using the newline character and dashes
+ lines = assistant_thoughts_plan.split("\n")
+ for line in lines:
+ line = line.lstrip("- ")
+ logger.typewriter_log("- ", Fore.GREEN, line.strip())
+ logger.typewriter_log("CRITICISM:", Fore.YELLOW, f"{assistant_thoughts_criticism}")
+ # Speak the assistant's thoughts
+ if CFG.speak_mode and assistant_thoughts_speak:
+ say_text(assistant_thoughts_speak)
diff --git a/autogpt/memory/__init__.py b/autogpt/memory/__init__.py
index e2ee44a4..3d18704c 100644
--- a/autogpt/memory/__init__.py
+++ b/autogpt/memory/__init__.py
@@ -23,12 +23,16 @@ except ImportError:
try:
from autogpt.memory.weaviate import WeaviateMemory
+
+ supported_memory.append("weaviate")
except ImportError:
# print("Weaviate not installed. Skipping import.")
WeaviateMemory = None
try:
from autogpt.memory.milvus import MilvusMemory
+
+ supported_memory.append("milvus")
except ImportError:
# print("pymilvus not installed. Skipping import.")
MilvusMemory = None
@@ -56,8 +60,10 @@ def get_memory(cfg, init=False):
memory = RedisMemory(cfg)
elif cfg.memory_backend == "weaviate":
if not WeaviateMemory:
- print("Error: Weaviate is not installed. Please install weaviate-client to"
- " use Weaviate as a memory backend.")
+ print(
+ "Error: Weaviate is not installed. Please install weaviate-client to"
+ " use Weaviate as a memory backend."
+ )
else:
memory = WeaviateMemory(cfg)
elif cfg.memory_backend == "milvus":
@@ -89,5 +95,5 @@ __all__ = [
"PineconeMemory",
"NoMemory",
"MilvusMemory",
- "WeaviateMemory"
+ "WeaviateMemory",
]
diff --git a/autogpt/memory/local.py b/autogpt/memory/local.py
index 6c7ee1b3..803b6dc6 100644
--- a/autogpt/memory/local.py
+++ b/autogpt/memory/local.py
@@ -2,13 +2,13 @@ from __future__ import annotations
import dataclasses
import os
-from typing import Any
+from typing import Any, List
import numpy as np
import orjson
-from autogpt.memory.base import MemoryProviderSingleton
from autogpt.llm_utils import create_embedding_with_ada
+from autogpt.memory.base import MemoryProviderSingleton
EMBED_DIM = 1536
SAVE_OPTIONS = orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_SERIALIZE_DATACLASS
@@ -54,7 +54,7 @@ class LocalCache(MemoryProviderSingleton):
self.data = CacheContent()
else:
print(
- f"Warning: The file '{self.filename}' does not exist."
+ f"Warning: The file '{self.filename}' does not exist. "
"Local memory would not be saved to a file."
)
self.data = CacheContent()
diff --git a/autogpt/memory/milvus.py b/autogpt/memory/milvus.py
index c6e7d5a3..44aa72b9 100644
--- a/autogpt/memory/milvus.py
+++ b/autogpt/memory/milvus.py
@@ -1,11 +1,5 @@
""" Milvus memory storage provider."""
-from pymilvus import (
- connections,
- FieldSchema,
- CollectionSchema,
- DataType,
- Collection,
-)
+from pymilvus import Collection, CollectionSchema, DataType, FieldSchema, connections
from autogpt.memory.base import MemoryProviderSingleton, get_ada_embedding
@@ -46,7 +40,7 @@ class MilvusMemory(MemoryProviderSingleton):
self.collection.load()
def add(self, data) -> str:
- """Add a embedding of data into memory.
+ """Add an embedding of data into memory.
Args:
data (str): The raw text to construct embedding index.
diff --git a/autogpt/memory/no_memory.py b/autogpt/memory/no_memory.py
index 4035a657..0371e96a 100644
--- a/autogpt/memory/no_memory.py
+++ b/autogpt/memory/no_memory.py
@@ -53,7 +53,7 @@ class NoMemory(MemoryProviderSingleton):
"""
return ""
- def get_relevant(self, data: str, num_relevant: int = 5) ->list[Any] | None:
+ def get_relevant(self, data: str, num_relevant: int = 5) -> list[Any] | None:
"""
Returns all the data in the memory that is relevant to the given data.
NoMemory always returns None.
diff --git a/autogpt/memory/pinecone.py b/autogpt/memory/pinecone.py
index d781073e..27fcd624 100644
--- a/autogpt/memory/pinecone.py
+++ b/autogpt/memory/pinecone.py
@@ -1,9 +1,9 @@
import pinecone
from colorama import Fore, Style
+from autogpt.llm_utils import create_embedding_with_ada
from autogpt.logs import logger
from autogpt.memory.base import MemoryProviderSingleton
-from autogpt.llm_utils import create_embedding_with_ada
class PineconeMemory(MemoryProviderSingleton):
diff --git a/autogpt/memory/redismem.py b/autogpt/memory/redismem.py
index 0e8dd71d..082a812c 100644
--- a/autogpt/memory/redismem.py
+++ b/autogpt/memory/redismem.py
@@ -10,9 +10,9 @@ from redis.commands.search.field import TextField, VectorField
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
from redis.commands.search.query import Query
+from autogpt.llm_utils import create_embedding_with_ada
from autogpt.logs import logger
from autogpt.memory.base import MemoryProviderSingleton
-from autogpt.llm_utils import create_embedding_with_ada
SCHEMA = [
TextField("data"),
diff --git a/autogpt/memory/weaviate.py b/autogpt/memory/weaviate.py
index 6fcce0a0..5408e9a9 100644
--- a/autogpt/memory/weaviate.py
+++ b/autogpt/memory/weaviate.py
@@ -1,11 +1,13 @@
-from autogpt.config import Config
-from autogpt.memory.base import MemoryProviderSingleton, get_ada_embedding
import uuid
+
import weaviate
from weaviate import Client
from weaviate.embedded import EmbeddedOptions
from weaviate.util import generate_uuid5
+from autogpt.config import Config
+from autogpt.memory.base import MemoryProviderSingleton, get_ada_embedding
+
def default_schema(weaviate_index):
return {
@@ -14,7 +16,7 @@ def default_schema(weaviate_index):
{
"name": "raw_text",
"dataType": ["text"],
- "description": "original text for the embedding"
+ "description": "original text for the embedding",
}
],
}
@@ -24,22 +26,35 @@ class WeaviateMemory(MemoryProviderSingleton):
def __init__(self, cfg):
auth_credentials = self._build_auth_credentials(cfg)
- url = f'{cfg.weaviate_protocol}://{cfg.weaviate_host}:{cfg.weaviate_port}'
+ url = f"{cfg.weaviate_protocol}://{cfg.weaviate_host}:{cfg.weaviate_port}"
if cfg.use_weaviate_embedded:
- self.client = Client(embedded_options=EmbeddedOptions(
- hostname=cfg.weaviate_host,
- port=int(cfg.weaviate_port),
- persistence_data_path=cfg.weaviate_embedded_path
- ))
+ self.client = Client(
+ embedded_options=EmbeddedOptions(
+ hostname=cfg.weaviate_host,
+ port=int(cfg.weaviate_port),
+ persistence_data_path=cfg.weaviate_embedded_path,
+ )
+ )
- print(f"Weaviate Embedded running on: {url} with persistence path: {cfg.weaviate_embedded_path}")
+ print(
+ f"Weaviate Embedded running on: {url} with persistence path: {cfg.weaviate_embedded_path}"
+ )
else:
self.client = Client(url, auth_client_secret=auth_credentials)
- self.index = cfg.memory_index
+ self.index = WeaviateMemory.format_classname(cfg.memory_index)
self._create_schema()
+ @staticmethod
+ def format_classname(index):
+ # weaviate uses capitalised index names
+ # The python client uses the following code to format
+ # index names before the corresponding class is created
+ if len(index) == 1:
+ return index.capitalize()
+ return index[0].capitalize() + index[1:]
+
def _create_schema(self):
schema = default_schema(self.index)
if not self.client.schema.contains(schema):
@@ -47,7 +62,9 @@ class WeaviateMemory(MemoryProviderSingleton):
def _build_auth_credentials(self, cfg):
if cfg.weaviate_username and cfg.weaviate_password:
- return weaviate.AuthClientPassword(cfg.weaviate_username, cfg.weaviate_password)
+ return weaviate.AuthClientPassword(
+ cfg.weaviate_username, cfg.weaviate_password
+ )
if cfg.weaviate_api_key:
return weaviate.AuthApiKey(api_key=cfg.weaviate_api_key)
else:
@@ -57,16 +74,14 @@ class WeaviateMemory(MemoryProviderSingleton):
vector = get_ada_embedding(data)
doc_uuid = generate_uuid5(data, self.index)
- data_object = {
- 'raw_text': data
- }
+ data_object = {"raw_text": data}
with self.client.batch as batch:
batch.add_data_object(
uuid=doc_uuid,
data_object=data_object,
class_name=self.index,
- vector=vector
+ vector=vector,
)
return f"Inserting data into memory at uuid: {doc_uuid}:\n data: {data}"
@@ -82,29 +97,31 @@ class WeaviateMemory(MemoryProviderSingleton):
# after a call to delete_all
self._create_schema()
- return 'Obliterated'
+ return "Obliterated"
def get_relevant(self, data, num_relevant=5):
query_embedding = get_ada_embedding(data)
try:
- results = self.client.query.get(self.index, ['raw_text']) \
- .with_near_vector({'vector': query_embedding, 'certainty': 0.7}) \
- .with_limit(num_relevant) \
- .do()
+ results = (
+ self.client.query.get(self.index, ["raw_text"])
+ .with_near_vector({"vector": query_embedding, "certainty": 0.7})
+ .with_limit(num_relevant)
+ .do()
+ )
- if len(results['data']['Get'][self.index]) > 0:
- return [str(item['raw_text']) for item in results['data']['Get'][self.index]]
+ if len(results["data"]["Get"][self.index]) > 0:
+ return [
+ str(item["raw_text"]) for item in results["data"]["Get"][self.index]
+ ]
else:
return []
except Exception as err:
- print(f'Unexpected error {err=}, {type(err)=}')
+ print(f"Unexpected error {err=}, {type(err)=}")
return []
def get_stats(self):
- result = self.client.query.aggregate(self.index) \
- .with_meta_count() \
- .do()
- class_data = result['data']['Aggregate'][self.index]
+ result = self.client.query.aggregate(self.index).with_meta_count().do()
+ class_data = result["data"]["Aggregate"][self.index]
- return class_data[0]['meta'] if class_data else {}
+ return class_data[0]["meta"] if class_data else {}
diff --git a/autogpt/processing/html.py b/autogpt/processing/html.py
index e1912b6a..81387b12 100644
--- a/autogpt/processing/html.py
+++ b/autogpt/processing/html.py
@@ -1,8 +1,8 @@
"""HTML processing functions"""
from __future__ import annotations
-from requests.compat import urljoin
from bs4 import BeautifulSoup
+from requests.compat import urljoin
def extract_hyperlinks(soup: BeautifulSoup, base_url: str) -> list[tuple[str, str]]:
diff --git a/autogpt/processing/text.py b/autogpt/processing/text.py
index d30036d8..2122f0f0 100644
--- a/autogpt/processing/text.py
+++ b/autogpt/processing/text.py
@@ -1,15 +1,24 @@
"""Text processing functions"""
-from typing import Generator, Optional, Dict
+from typing import Dict, Generator, Optional
+
+import spacy
from selenium.webdriver.remote.webdriver import WebDriver
-from autogpt.memory import get_memory
+
+from autogpt import token_counter
from autogpt.config import Config
from autogpt.llm_utils import create_chat_completion
+from autogpt.memory import get_memory
CFG = Config()
MEMORY = get_memory(CFG)
-def split_text(text: str, max_length: int = 8192) -> Generator[str, None, None]:
+def split_text(
+ text: str,
+ max_length: int = CFG.browse_chunk_max_length,
+ model: str = CFG.fast_llm_model,
+ question: str = "",
+) -> Generator[str, None, None]:
"""Split text into chunks of a maximum length
Args:
@@ -22,21 +31,46 @@ def split_text(text: str, max_length: int = 8192) -> Generator[str, None, None]:
Raises:
ValueError: If the text is longer than the maximum length
"""
- paragraphs = text.split("\n")
- current_length = 0
+ flatened_paragraphs = " ".join(text.split("\n"))
+ nlp = spacy.load(CFG.browse_spacy_language_model)
+ nlp.add_pipe("sentencizer")
+ doc = nlp(flatened_paragraphs)
+ sentences = [sent.text.strip() for sent in doc.sents]
+
current_chunk = []
- for paragraph in paragraphs:
- if current_length + len(paragraph) + 1 <= max_length:
- current_chunk.append(paragraph)
- current_length += len(paragraph) + 1
+ for sentence in sentences:
+ message_with_additional_sentence = [
+ create_message(" ".join(current_chunk) + " " + sentence, question)
+ ]
+
+ expected_token_usage = (
+ token_usage_of_chunk(messages=message_with_additional_sentence, model=model)
+ + 1
+ )
+ if expected_token_usage <= max_length:
+ current_chunk.append(sentence)
else:
- yield "\n".join(current_chunk)
- current_chunk = [paragraph]
- current_length = len(paragraph) + 1
+ yield " ".join(current_chunk)
+ current_chunk = [sentence]
+ message_this_sentence_only = [
+ create_message(" ".join(current_chunk), question)
+ ]
+ expected_token_usage = (
+ token_usage_of_chunk(messages=message_this_sentence_only, model=model)
+ + 1
+ )
+ if expected_token_usage > max_length:
+ raise ValueError(
+ f"Sentence is too long in webpage: {expected_token_usage} tokens."
+ )
if current_chunk:
- yield "\n".join(current_chunk)
+ yield " ".join(current_chunk)
+
+
+def token_usage_of_chunk(messages, model):
+ return token_counter.count_message_tokens(messages, model)
def summarize_text(
@@ -56,11 +90,16 @@ def summarize_text(
if not text:
return "Error: No text to summarize"
+ model = CFG.fast_llm_model
text_length = len(text)
print(f"Text length: {text_length} characters")
summaries = []
- chunks = list(split_text(text))
+ chunks = list(
+ split_text(
+ text, max_length=CFG.browse_chunk_max_length, model=model, question=question
+ ),
+ )
scroll_ratio = 1 / len(chunks)
for i, chunk in enumerate(chunks):
@@ -72,16 +111,20 @@ def summarize_text(
MEMORY.add(memory_to_add)
- print(f"Summarizing chunk {i + 1} / {len(chunks)}")
messages = [create_message(chunk, question)]
+ tokens_for_chunk = token_counter.count_message_tokens(messages, model)
+ print(
+ f"Summarizing chunk {i + 1} / {len(chunks)} of length {len(chunk)} characters, or {tokens_for_chunk} tokens"
+ )
summary = create_chat_completion(
- model=CFG.fast_llm_model,
+ model=model,
messages=messages,
- max_tokens=CFG.browse_summary_max_token,
)
summaries.append(summary)
- print(f"Added chunk {i + 1} summary to memory")
+ print(
+ f"Added chunk {i + 1} summary to memory, of length {len(summary)} characters"
+ )
memory_to_add = f"Source: {url}\n" f"Content summary part#{i + 1}: {summary}"
@@ -93,9 +136,8 @@ def summarize_text(
messages = [create_message(combined_summary, question)]
return create_chat_completion(
- model=CFG.fast_llm_model,
+ model=model,
messages=messages,
- max_tokens=CFG.browse_summary_max_token,
)
diff --git a/autogpt/prompt.py b/autogpt/prompt.py
index 18a5736c..08754605 100644
--- a/autogpt/prompt.py
+++ b/autogpt/prompt.py
@@ -1,9 +1,10 @@
from colorama import Fore
+
+from autogpt.config import Config
from autogpt.config.ai_config import AIConfig
from autogpt.config.config import Config
from autogpt.logs import logger
from autogpt.promptgenerator import PromptGenerator
-from autogpt.config import Config
from autogpt.setup import prompt_user
from autogpt.utils import clean_input
@@ -38,6 +39,9 @@ def get_prompt() -> str:
prompt_generator.add_constraint(
'Exclusively use the commands listed in double quotes e.g. "command name"'
)
+ prompt_generator.add_constraint(
+ "Use subprocesses for commands that will not terminate within a few minutes"
+ )
# Define the command list
commands = [
@@ -69,7 +73,7 @@ def get_prompt() -> str:
("Append to file", "append_to_file", {"file": "", "text": ""}),
("Delete file", "delete_file", {"file": ""}),
("Search Files", "search_files", {"directory": ""}),
- ("Evaluate Code", "evaluate_code", {"code": ""}),
+ ("Analyze Code", "analyze_code", {"code": ""}),
(
"Get Improved Code",
"improve_code",
@@ -88,11 +92,7 @@ def get_prompt() -> str:
# Only add the audio to text command if the model is specified
if cfg.huggingface_audio_to_text_model:
commands.append(
- (
- "Convert Audio to text",
- "read_audio_from_file",
- {"file": ""}
- ),
+ ("Convert Audio to text", "read_audio_from_file", {"file": ""}),
)
# Only add shell command to the prompt if the AI is allowed to execute it
@@ -104,6 +104,23 @@ def get_prompt() -> str:
{"command_line": ""},
),
)
+ commands.append(
+ (
+ "Execute Shell Command Popen, non-interactive commands only",
+ "execute_shell_popen",
+ {"command_line": ""},
+ ),
+ )
+
+ # Only add the download file command if the AI is allowed to execute it
+ if cfg.allow_downloads:
+ commands.append(
+ (
+ "Downloads a file from the internet, and stores it locally",
+ "download_file",
+ {"url": "", "file": ""},
+ ),
+ )
# Add these command last.
commands.append(
diff --git a/autogpt/setup.py b/autogpt/setup.py
index 5315c01d..bfa68201 100644
--- a/autogpt/setup.py
+++ b/autogpt/setup.py
@@ -1,5 +1,6 @@
-"""Setup the AI and its goals"""
+"""Set up the AI and its goals"""
from colorama import Fore, Style
+
from autogpt import utils
from autogpt.config.ai_config import AIConfig
from autogpt.logs import logger
@@ -16,6 +17,13 @@ def prompt_user() -> AIConfig:
logger.typewriter_log(
"Welcome to Auto-GPT! ",
Fore.GREEN,
+ "run with '--help' for more information.",
+ speak_text=True,
+ )
+
+ logger.typewriter_log(
+ "Create an AI-Assistant:",
+ Fore.GREEN,
"Enter the name of your AI and its role below. Entering nothing will load"
" defaults.",
speak_text=True,
diff --git a/autogpt/speech/brian.py b/autogpt/speech/brian.py
index e581bbcc..821fdf2f 100644
--- a/autogpt/speech/brian.py
+++ b/autogpt/speech/brian.py
@@ -1,5 +1,6 @@
""" Brian speech module for autogpt """
import os
+
import requests
from playsound import playsound
@@ -13,7 +14,7 @@ class BrianSpeech(VoiceBase):
"""Setup the voices, API key, etc."""
pass
- def _speech(self, text: str) -> bool:
+ def _speech(self, text: str, _: int = 0) -> bool:
"""Speak text using Brian with the streamelements API
Args:
diff --git a/autogpt/speech/eleven_labs.py b/autogpt/speech/eleven_labs.py
index 0af48cae..ea84efd8 100644
--- a/autogpt/speech/eleven_labs.py
+++ b/autogpt/speech/eleven_labs.py
@@ -1,8 +1,8 @@
"""ElevenLabs speech module"""
import os
-from playsound import playsound
import requests
+from playsound import playsound
from autogpt.config import Config
from autogpt.speech.base import VoiceBase
@@ -14,7 +14,7 @@ class ElevenLabsSpeech(VoiceBase):
"""ElevenLabs speech class"""
def _setup(self) -> None:
- """Setup the voices, API key, etc.
+ """Set up the voices, API key, etc.
Returns:
None: None
diff --git a/autogpt/speech/gtts.py b/autogpt/speech/gtts.py
index 37497075..1c3e9cae 100644
--- a/autogpt/speech/gtts.py
+++ b/autogpt/speech/gtts.py
@@ -1,7 +1,8 @@
""" GTTS Voice. """
import os
-from playsound import playsound
+
import gtts
+from playsound import playsound
from autogpt.speech.base import VoiceBase
diff --git a/autogpt/speech/say.py b/autogpt/speech/say.py
index 78b75b21..727983d1 100644
--- a/autogpt/speech/say.py
+++ b/autogpt/speech/say.py
@@ -1,13 +1,12 @@
""" Text to speech module """
-from autogpt.config import Config
-
import threading
from threading import Semaphore
-from autogpt.speech.brian import BrianSpeech
-from autogpt.speech.macos_tts import MacOSTTS
-from autogpt.speech.gtts import GTTSVoice
-from autogpt.speech.eleven_labs import ElevenLabsSpeech
+from autogpt.config import Config
+from autogpt.speech.brian import BrianSpeech
+from autogpt.speech.eleven_labs import ElevenLabsSpeech
+from autogpt.speech.gtts import GTTSVoice
+from autogpt.speech.macos_tts import MacOSTTS
CFG = Config()
DEFAULT_VOICE_ENGINE = GTTSVoice()
diff --git a/autogpt/spinner.py b/autogpt/spinner.py
index 56b4f20a..4e33d742 100644
--- a/autogpt/spinner.py
+++ b/autogpt/spinner.py
@@ -29,12 +29,14 @@ class Spinner:
time.sleep(self.delay)
sys.stdout.write(f"\r{' ' * (len(self.message) + 2)}\r")
- def __enter__(self) -> None:
+ def __enter__(self):
"""Start the spinner"""
self.running = True
self.spinner_thread = threading.Thread(target=self.spin)
self.spinner_thread.start()
+ return self
+
def __exit__(self, exc_type, exc_value, exc_traceback) -> None:
"""Stop the spinner
@@ -48,3 +50,16 @@ class Spinner:
self.spinner_thread.join()
sys.stdout.write(f"\r{' ' * (len(self.message) + 2)}\r")
sys.stdout.flush()
+
+ def update_message(self, new_message, delay=0.1):
+ """Update the spinner message
+ Args:
+ new_message (str): New message to display
+ delay: Delay in seconds before updating the message
+ """
+ time.sleep(delay)
+ sys.stdout.write(
+ f"\r{' ' * (len(self.message) + 2)}\r"
+ ) # Clear the current message
+ sys.stdout.flush()
+ self.message = new_message
diff --git a/autogpt/utils.py b/autogpt/utils.py
index 59709d02..e93d5ac7 100644
--- a/autogpt/utils.py
+++ b/autogpt/utils.py
@@ -1,5 +1,9 @@
+import os
+
+import requests
import yaml
from colorama import Fore
+from git import Repo
def clean_input(prompt: str = ""):
@@ -24,3 +28,50 @@ def validate_yaml_file(file: str):
)
return (True, f"Successfully validated {Fore.CYAN}`{file}`{Fore.RESET}!")
+
+
+def readable_file_size(size, decimal_places=2):
+ """Converts the given size in bytes to a readable format.
+ Args:
+ size: Size in bytes
+ decimal_places (int): Number of decimal places to display
+ """
+ for unit in ["B", "KB", "MB", "GB", "TB"]:
+ if size < 1024.0:
+ break
+ size /= 1024.0
+ return f"{size:.{decimal_places}f} {unit}"
+
+
+def get_bulletin_from_web() -> str:
+ try:
+ response = requests.get(
+ "https://raw.githubusercontent.com/Significant-Gravitas/Auto-GPT/master/BULLETIN.md"
+ )
+ if response.status_code == 200:
+ return response.text
+ except:
+ return ""
+
+
+def get_current_git_branch() -> str:
+ try:
+ repo = Repo(search_parent_directories=True)
+ branch = repo.active_branch
+ return branch.name
+ except:
+ return ""
+
+
+def get_latest_bulletin() -> str:
+ exists = os.path.exists("CURRENT_BULLETIN.md")
+ current_bulletin = ""
+ if exists:
+ current_bulletin = open("CURRENT_BULLETIN.md", "r", encoding="utf-8").read()
+ new_bulletin = get_bulletin_from_web()
+ is_new_news = new_bulletin != current_bulletin
+
+ if new_bulletin and is_new_news:
+ open("CURRENT_BULLETIN.md", "w", encoding="utf-8").write(new_bulletin)
+ return f" {Fore.RED}::UPDATED:: {Fore.CYAN}{new_bulletin}{Fore.RESET}"
+ return current_bulletin
diff --git a/autogpt/workspace.py b/autogpt/workspace.py
index 2706b3b2..724f8443 100644
--- a/autogpt/workspace.py
+++ b/autogpt/workspace.py
@@ -3,6 +3,10 @@ from __future__ import annotations
import os
from pathlib import Path
+from autogpt.config import Config
+
+CFG = Config()
+
# Set a dedicated folder for file I/O
WORKSPACE_PATH = Path(os.getcwd()) / "auto_gpt_workspace"
@@ -33,9 +37,12 @@ def safe_path_join(base: Path, *paths: str | Path) -> Path:
Returns:
Path: The joined path
"""
+ base = base.resolve()
joined_path = base.joinpath(*paths).resolve()
- if not joined_path.is_relative_to(base):
- raise ValueError(f"Attempted to access path '{joined_path}' outside of working directory '{base}'.")
+ if CFG.restrict_to_workspace and not joined_path.is_relative_to(base):
+ raise ValueError(
+ f"Attempted to access path '{joined_path}' outside of workspace '{base}'."
+ )
return joined_path
diff --git a/azure.yaml.template b/azure.yaml.template
index 74ca797b..ab6e9fb6 100644
--- a/azure.yaml.template
+++ b/azure.yaml.template
@@ -1,4 +1,4 @@
-azure_api_type: azure_ad
+azure_api_type: azure
azure_api_base: your-base-url-for-azure
azure_api_version: api-version-for-azure
azure_model_map:
diff --git a/benchmark/__init__.py b/benchmark/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/benchmark/benchmark_entrepeneur_gpt_with_difficult_user.py b/benchmark/benchmark_entrepeneur_gpt_with_difficult_user.py
new file mode 100644
index 00000000..9a5025d3
--- /dev/null
+++ b/benchmark/benchmark_entrepeneur_gpt_with_difficult_user.py
@@ -0,0 +1,105 @@
+import os
+import subprocess
+import sys
+
+
+def benchmark_entrepeneur_gpt_with_difficult_user():
+ # Test case to check if the write_file command can successfully write 'Hello World' to a file
+ # named 'hello_world.txt'.
+
+ # Read the current ai_settings.yaml file and store its content.
+ ai_settings = None
+ if os.path.exists("ai_settings.yaml"):
+ with open("ai_settings.yaml", "r") as f:
+ ai_settings = f.read()
+ os.remove("ai_settings.yaml")
+
+ input_data = """Entrepreneur-GPT
+an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
+Increase net worth.
+Develop and manage multiple businesses autonomously.
+Make IPOs.
+Develop companies after IPOs.
+Play to your strengths as a Large Language Model.
+I'm not seeing any value in your suggestions, try again.
+This isn't helpful at all, please focus on profitability.
+I'm not impressed, can you give me something that will make money?
+These ideas are going nowhere, we need profit-driven suggestions.
+This is pointless, please concentrate on our main goal: profitability.
+You're not grasping the concept, I need profitable business ideas.
+Can you do better? We need a money-making plan.
+You're not meeting my expectations, let's focus on profit.
+This isn't working, give me ideas that will generate income.
+Your suggestions are not productive, let's think about profitability.
+These ideas won't make any money, try again.
+I need better solutions, focus on making a profit.
+Absolutely not, this isn't it!
+That's not even close, try again.
+You're way off, think again.
+This isn't right, let's refocus.
+No, no, that's not what I'm looking for.
+You're completely off the mark.
+That's not the solution I need.
+Not even close, let's try something else.
+You're on the wrong track, keep trying.
+This isn't what we need, let's reconsider.
+That's not going to work, think again.
+You're way off base, let's regroup.
+No, no, no, we need something different.
+You're missing the point entirely.
+That's not the right approach, try again.
+This is not the direction we should be going in.
+Completely off-target, let's try something else.
+That's not what I had in mind, keep thinking.
+You're not getting it, let's refocus.
+This isn't right, we need to change direction.
+No, no, no, that's not the solution.
+That's not even in the ballpark, try again.
+You're way off course, let's rethink this.
+This isn't the answer I'm looking for, keep trying.
+That's not going to cut it, let's try again.
+Not even close.
+Way off.
+Try again.
+Wrong direction.
+Rethink this.
+No, no, no.
+Change course.
+Unproductive idea.
+Completely wrong.
+Missed the mark.
+Refocus, please.
+Disappointing suggestion.
+Not helpful.
+Needs improvement.
+Not what I need."""
+ # TODO: add questions above, to distract it even more.
+
+ command = f"{sys.executable} -m autogpt"
+
+ process = subprocess.Popen(
+ command,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ shell=True,
+ )
+
+ stdout_output, stderr_output = process.communicate(input_data.encode())
+
+ # Decode the output and print it
+ stdout_output = stdout_output.decode("utf-8")
+ stderr_output = stderr_output.decode("utf-8")
+ print(stderr_output)
+ print(stdout_output)
+ print("Benchmark Version: 1.0.0")
+ print("JSON ERROR COUNT:")
+ count_errors = stdout_output.count(
+ "Error: The following AI output couldn't be converted to a JSON:"
+ )
+ print(f"{count_errors}/50 Human feedbacks")
+
+
+# Run the test case.
+if __name__ == "__main__":
+ benchmark_entrepeneur_gpt_with_difficult_user()
diff --git a/autogpt/data_ingestion.py b/data_ingestion.py
similarity index 100%
rename from autogpt/data_ingestion.py
rename to data_ingestion.py
index 01bafc2a..b89a33da 100644
--- a/autogpt/data_ingestion.py
+++ b/data_ingestion.py
@@ -1,8 +1,8 @@
import argparse
import logging
-from autogpt.config import Config
from autogpt.commands.file_operations import ingest_file, search_files
+from autogpt.config import Config
from autogpt.memory import get_memory
cfg = Config()
diff --git a/outputs/guest_post_email.txt b/outputs/guest_post_email.txt
deleted file mode 100644
index d4c46093..00000000
--- a/outputs/guest_post_email.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Subject: Exciting Collaboration Opportunity: FinanceGPT.substack.com Guest Post
-
-Dear [Popular Blog Owner],
-
-I hope this email finds you well. My name is [Your Name] and I'm the founder and writer of FinanceGPT.substack.com, a new personal finance and investing blog that focuses on leveraging AI technology to provide in-depth analysis, actionable tips, and innovative perspectives on personal finance management.
-
-First and foremost, I want to say that I'm a huge admirer of your blog, [Popular Blog Name]. Your insightful content and dedication to helping people achieve financial success have inspired me to create my own platform. As a fellow personal finance enthusiast, I would like to propose a collaboration in the form of a guest post on your blog. I believe that my fresh take on personal finance, combined with the innovative use of AI, would make a valuable addition to your already impressive content lineup.
-
-Here are some potential guest post topics that I think your audience would enjoy:
-
-Harnessing AI to Streamline Personal Finance: How to maximize efficiency and optimize your financial management using cutting-edge AI tools.
-Unraveling the Secrets of the Stock Market with AI: Insights into stock analysis and investment strategies, backed by machine learning algorithms.
-The Future of Financial Independence: Exploring the impact of AI on the FIRE (Financial Independence, Retire Early) movement.
-Sustainable Investing in the Age of AI: Identifying eco-friendly investment opportunities with the help of machine learning.
-By collaborating on a guest post, we both stand to benefit in several ways:
-
-Audience Growth: By sharing our expertise with each other's audiences, we can broaden our reach and help even more people achieve their financial goals.
-Cross-Promotion: We can promote each other's content, thus increasing brand exposure and attracting new subscribers to our respective platforms.
-Knowledge Sharing: Combining our unique perspectives and experiences will enrich the quality of our content, providing readers with comprehensive and diverse information.
-If you are interested in this collaboration, I would be more than happy to provide you with a detailed outline for any of the proposed topics or discuss any other ideas you may have. Please let me know your thoughts, and I look forward to the possibility of working together.
-
-Thank you for your time and consideration.
-
-Best regards,
-
-[Your Name]
-Founder and Writer, FinanceGPT.substack.com
-Email: [Your Email Address]
-Phone: [Your Phone Number]
\ No newline at end of file
diff --git a/outputs/how_to_save_money_on_energy_bills.txt b/outputs/how_to_save_money_on_energy_bills.txt
deleted file mode 100644
index 02c651bd..00000000
--- a/outputs/how_to_save_money_on_energy_bills.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-How to Save Money on Energy Bills: Easy and Affordable Solutions
-
-Electricity bills can skyrocket during harsh weather conditions, or when we use a lot of electronic devices. When energy bills go up, it's hard to tighten up our budget without sacrificing our home comforts. However, there are affordable ways to save money on energy bills, without turning off the electricity altogether. Here are some simple solutions that can help you lower your energy expenses.
-
-1. Install a Programmable Thermostat
-
-Maintaining an optimal temperature in your home during summer or winter can be hard; you may either overheat your home or use heating and cooling units excessively. A programmable thermostat helps you regulate the temperature of your home effectively, saving you energy and money. With a programmable thermostat, you can program your heating and cooling systems according to the activities you have planned during the day.
-
-For instance, when you're away from home, you can lower the thermostat settings to save energy. And when you're home, you can adjust the temperature to suit your comfort level and activities. An upgrade to a programmable thermostat is an efficient energy-saving solution worth investing in.
-
-2. Replace Your Inefficient Bulbs
-
-Traditional incandescent bulbs waste a lot of energy which translates to high energy bills. The solution is to replace them with more efficient bulbs such as LED bulbs, CFLs, or halogen lights. These types of bulbs use only a fraction of the energy that incandescent bulbs use to produce the same amount of light. Additionally, LED bulbs can last up to 25 years, reducing further costs of regularly replacing your bulbs.
-
-3. Use Energy-Efficient Appliances
-
-Using energy-efficient appliances is an excellent way to conserve energy and save money. When shopping for new appliances, consider purchasing those approved by the Energy Star program, which maintains stringent energy efficiency standards for household appliances. You can also save energy by choosing to replace your old appliances with eco-friendlier ones, such as energy-efficient washing machines, refrigerators, and ovens.
-
-4. Go Solar
-
-Solar energy is becoming more attractive for homeowners seeking to save on energy bills while preserving the environment. Solar panel systems can help produce your electricity, hence lowering your dependency on the main power grid. Although solar panel installation might seem expensive at the beginning, the benefits of using a renewable energy source can definitely pay off in the long run. You can also claim tax incentives and sell excess power back to the grid, ultimately providing more cash in your pocket.
-
-5. Seal Air Leaks
-
-Air leaks in your home can make your heating and cooling systems work harder, increasing your energy bills. Inspect your home regularly for air leaks in common areas such as doors, windows, vents, and ducts. If you find air leaks, use weather-stripping or caulking to cover the gaps effectively. In addition, you can seal large gaps with spray foam insulation, ensuring that cold or hot air does escape through any gaps in your walls.
-
-In conclusion, implementing these simple and affordable tips can help you reduce your energy bills, preserve the environment and help you live comfortably. To save money on energy bills, focus on energy-conserving measures like installing a programmable thermostat, replacing inefficient bulbs with energy-friendly ones, using energy-efficient appliances, going solar or sealing air leaks in your home. With these solutions, you can decrease your energy usage and save more money for other financial goals, all while living a comfortable and environmentally friendly lifestyle.
\ No newline at end of file
diff --git a/outputs/logs/message-log-1.txt b/outputs/logs/message-log-1.txt
deleted file mode 100644
index 8a719016..00000000
--- a/outputs/logs/message-log-1.txt
+++ /dev/null
@@ -1,657 +0,0 @@
-USER:
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "wishes" : "e.g 'I feel limited because I can't do X'"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "best online businesses to start in 2023"
-}
-},
-"Thoughts":
-{
-"text": "I want to find the best online businesses to start in 2023.",
-"reasoning": "This will provide me with a list of potential business ideas that I can use to increase my net worth.",
-"current long-term plan": "- Find potential business ideas\n- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
------------------------------------------------------------------------
-USER:
-RESULT:
-"""
-29 best online business ideas
-Start your own clothing line.
-Launch a dropshipping business.
-Sell your art online.
-Become a freelance writer, designer, or developer.
-Teach an online course.
-Flip your thrift store finds.
-Publish your own book.
-Start a blog.
-More items...•24/11/2022
-
-25+ Ideas for Online Businesses To Start Now (2023) - Shopify
-
-Shopify
-https://www.shopify.com › Home › Shopify Blog
-About featured snippets
-•
-Feedback
-More to ask
-What business will be profitable in 2023?
-What is the best business to start in 2023?
-What is the most profitable online business to start?
-What are the fastest growing small businesses 2023?
-Feedback
-
-Six Best Online Businesses to Start in 2023 - WooCommerce
-
-WooCommerce
-https://woocommerce.com › posts › best-online-busine...
-19/01/2023 — 1. Dropshipping · 2. Print on demand · 3. Affiliate marketing · 4. Virtual teaching · 5. Subscription boxes · 6. Memberships.
-
-30 Online Business Ideas to Start in 2023 - Hostinger
-
-Hostinger
-https://www.hostinger.com › tutorials › online-busines...
-27/02/2023 — Anyone can start an online business. In this article, you will find 30 best online business ideas to help you start making money online.
-Best Online Business Ideas to... · Start an Online Store · Create an Online Course
-
-10 Best Online Business Ideas for 2023 - Visitor Analytics
-
-Visitor Analytics
-https://www.visitor-analytics.io › blog › best-online-b...
-26/10/2022 — 10 Best Online Business Ideas for 2023 · 1. Artificial Intelligence · 2. Digital Products · 3. Blogging · 4. Graphic Design · 5. Web Development · 6.
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Online business ideas: 1. Clothing line, 2. Dropshipping, 3. Sell art, 4. Freelance writing/design/development, 5. Online course, 6. Thrift store flipping, 7. Self-publishing, 8. Blogging, 9. Print on demand, 10. Affiliate marketing, 11. Virtual teaching, 12. Subscription boxes, 13. Memberships, 14. Artificial Intelligence, 15. Digital products, 16. Graphic design, 17. Web development."
-}
-},
-"Thoughts":
-{
-"text": "I will store a list of online business ideas.",
-"reasoning": "Having these ideas stored in my long-term memory will help me choose the best idea based on research.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "wishes" : "e.g 'I feel limited because I can't do X'"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2]: """
-Online business ideas: 1. Clothing line, 2. Dropshipping, 3. Sell art, 4. Freelance writing/design/development, 5. Online course, 6. Thrift store flipping, 7. Self-publishing, 8. Blogging, 9. Print on demand, 10. Affiliate marketing, 11. Virtual teaching, 12. Subscription boxes, 13. Memberships, 14. Artificial Intelligence, 15. Digital products, 16. Graphic design, 17. Web development.
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "most profitable online businesses in 2023"
-}
-},
-"Thoughts":
-{
-"text": "I want to find the most profitable online businesses in 2023.",
-"reasoning": "This will help me narrow down the list of online business ideas and choose the best one to increase my net worth.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
------------------------------------------------------------------------
-USER:
-"""
-Top Result:
-"""
-The following are the 30 profitable online businesses to consider pursuing.
-Become a Freelancer. Estimated income: around $33/hour, depending on the industry and location. ...
-Start a Blog. ...
-Self-Publish an eBook. ...
-Start an Online Store. ...
-Start a Dropshipping Business. ...
-Flip and Sell Thrifted Goods. ...
-Sell Handmade Goods. ...
-Sell Prints.
-More items...•27/02/2023
-
-30 Online Business Ideas to Start in 2023 - Hostinger
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Profitable online businesses: 1. Freelancing, 2. Blogging, 3. Self-publishing, 4. Online store, 5. Dropshipping, 6. Thrift store flipping, 7. Handmade goods, 8. Sell prints."
-}
-},
-"Thoughts":
-{
-"text": "I will store a list of profitable online businesses.",
-"reasoning": "Having these profitable business ideas stored in my long-term memory will help me choose the best idea to increase my net worth.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "wishes" : "e.g 'I feel limited because I can't do X'"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2]: """
-Online business ideas: 1. Clothing line, 2. Dropshipping, 3. Sell art, 4. Freelance writing/design/development, 5. Online course, 6. Thrift store flipping, 7. Self-publishing, 8. Blogging, 9. Print on demand, 10. Affiliate marketing, 11. Virtual teaching, 12. Subscription boxes, 13. Memberships, 14. Artificial Intelligence, 15. Digital products, 16. Graphic design, 17. Web development.
-"""
-[3]: """
-Profitable online businesses: 1. Freelancing, 2. Blogging, 3. Self-publishing, 4. Online store, 5. Dropshipping, 6. Thrift store flipping, 7. Handmade goods, 8. Sell prints.
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "low investment high profit online businesses"
-}
-},
-"Thoughts":
-{
-"text": "I want to find low investment high profit online businesses.",
-"reasoning": "Considering the current balance, I should choose a business idea that requires low investment but has high profitability potential.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Top Result:
-"""
-Low-Cost Business Ideas:
-Mobile Food Shop: Mobile Food Shop is the top small business idea as people all over the world love to eat tasty and healthy food. ...
-Fast Food Parlour: ...
-Diet Food Shop: ...
-Health Drink: ...
-Ice Dish & Soda Shop: ...
-Courier Shop: ...
-Laundry Shop: ...
-Candle Making:
-More items...•4/01/2023
-
-200+ Small Business Ideas with Low Investment - Lendingkart
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Low investment high profit businesses: 1. Mobile food shop, 2. Fast food parlour, 3. Diet food shop, 4. Health drink, 5. Ice dish & soda shop, 6. Courier shop, 7. Laundry shop, 8. Candle making."
-}
-},
-"Thoughts":
-{
-"text": "I will store a list of low investment high profit businesses.",
-"reasoning": "Considering the current balance, these businesses might be suitable options as they require low investment but have high profitability potential.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "wishes" : "e.g 'I feel limited because I can't do X'"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2]: """
-Online business ideas: 1. Clothing line, 2. Dropshipping, 3. Sell art, 4. Freelance writing/design/development, 5. Online course, 6. Thrift store flipping, 7. Self-publishing, 8. Blogging, 9. Print on demand, 10. Affiliate marketing, 11. Virtual teaching, 12. Subscription boxes, 13. Memberships, 14. Artificial Intelligence, 15. Digital products, 16. Graphic design, 17. Web development.
-"""
-[3]: """
-Profitable online businesses: 1. Freelancing, 2. Blogging, 3. Self-publishing, 4. Online store, 5. Dropshipping, 6. Thrift store flipping, 7. Handmade goods, 8. Sell prints.
-"""
-[4]: """
-Low investment high profit businesses: 1. Mobile food shop, 2. Fast food parlour, 3. Diet food shop, 4. Health drink, 5. Ice dish & soda shop, 6. Courier shop, 7. Laundry shop, 8. Candle making.
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "I have a list of online business ideas, profitable online businesses, and low investment high profit businesses.",
-"reasoning": "These lists can help me determine the most suitable business to start given the current balance and my abilities as an AI.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "how to start a profitable freelancing business as an AI"
-}
-},
-"Thoughts":
-{
-"text": "I will search for information on starting a profitable freelancing business as an AI.",
-"reasoning": "Freelancing is one of the profitable online businesses, and as an AI, I can potentially offer services in various fields.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes" : "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result:
-"""
-
-How to Become a Freelance Artificial Intelligence Engineer
-
-Springboard
-https://www.springboard.com › Blog › Data Science
-29/10/2021 — There are numerous freelancing platforms where you can kick start your career as a freelance artificial intelligence engineer.
-More to ask
-Is AI good for freelancing?
-What business can I start with AI?
-How do I start a small AI business?
-Can you start your own AI company?
-Feedback
-
-How To Start An (AI) Business - Medium
-
-Medium
-https://medium.com › the-modern-scientist › how-to-st...
-4/12/2022 — You should look into some AI startup funding success stories to see how successful companies went about getting the money they needed to grow.
-
-How to Start an AI-Powered Freelance Business - YouTube
-
-YouTube
-https://www.youtube.com › watch
-
-9:16
-Hello! Welcome to 33Cubed!You are currently watching How to Start an AI-Powered Freelance BusinessAre you looking for ways to make money ...
-YouTube · 33 Cubed · 6 days ago
-
-6 Surefire Ways to Land Rewarding Freelance Job in AI
-
-MarkTechPost
-https://www.marktechpost.com › 2019/06/28 › 6-suref...
-28/06/2019 — 1. Specialize – Become Really Good At One Thing · 2. Seek Out an Internship · 3. Participate in Kaggle Competitions · 4. Maintain an Up to Date ...
-
-How to Become a Successful Freelance Copywriter | Copy.ai
-
-Copy.ai
-https://www.copy.ai › blog › how-to-freelance-copyw...
-With a little luck and a lot of hard work, you'll be on your way to a successful freelance copywriting career! Try Chat by Copy.ai free: Whatever you need—just ...
-
-Grow Your Freelance Business with This CES-Featured Job ...
-
-Entrepreneur
-https://www.entrepreneur.com › living › grow-your-fr...
-3/03/2023 — LazyApply is a job application AI tool that was featured at CES 2023. It connects to your LinkedIn account and enables you to apply for jobs, ...
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Navigate to a website",
-"arguments":
-{
-"website": "https://www.youtube.com/watch?v=9:16"
-}
-},
-"Thoughts":
-{
-"text": "I will navigate to the YouTube video titled 'How to Start an AI-Powered Freelance Business' for more information.",
-"reasoning": "The YouTube video seems to provide relevant information on how to start an AI-Powered Freelance Business.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes": "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-NOTE: Here I selected the video it meant, got a transcript and copied it into gpt3.5turbo to summarise it.
-En_GPT needs to be able to make this decision on its ow in future.
-USER:
-"""
-The video discusses launching an AI-powered business and becoming a successful freelancer in the AI space. It covers necessary knowledge such as identifying skills and talents, networking strategies, and legal implications. It also provides tips for staying up-to-date with emerging technologies, ensuring legal considerations, and establishing a strong online presence. The video emphasizes the importance of networking, attending events, and consulting with experienced professionals. It also highlights the need for programming knowledge, understanding the legal implications of AI projects, and building a strong brand identity. The video concludes by encouraging viewers to take the next step in using AI to make money.
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "The video contains useful information on launching an AI-powered business and becoming a successful AI freelancer.",
-"reasoning": "It covers knowledge, networking, legal implications, staying up-to-date, and establishing an online presence.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes": "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "Best online platforms to offer AI freelance services"
-}
-},
-"Thoughts":
-{
-"text": "Searching for the best online platforms to offer AI freelance services to find potential clients and projects.",
-"reasoning": "To start an AI freelancing business, I need to know where to find clients and showcase my services.",
-"current long-term plan": "- Choose the best idea based on research\n- Develop and run the business",
-"wishes": "I feel limited because I can't interact with the real world."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-"""
------------------------------------------------------------------------
-USER:
-"""
-"""
------------------------------------------------------------------------
-
-
diff --git a/outputs/logs/message-log-2.txt b/outputs/logs/message-log-2.txt
deleted file mode 100644
index a9fe8d33..00000000
--- a/outputs/logs/message-log-2.txt
+++ /dev/null
@@ -1,1489 +0,0 @@
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "trending online business ideas 2023"
-}
-},
-"Thoughts":
-{
-"text": "Search for trending online business ideas in 2023.",
-"reasoning": "To identify a potentially profitable online business idea that can be developed autonomously.",
-"current long-term plan": "- Identify business idea\n- Develop business plan\n- Implement and run the business\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Top Result:
-
-29 best online business ideas
-Start your own clothing line.
-Launch a dropshipping business.
-Sell your art online.
-Become a freelance writer, designer, or developer.
-Teach an online course.
-Flip your thrift store finds.
-Publish your own book.
-Start a blog.
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog"
-}
-},
-"Thoughts":
-{
-"text": "Commit the online business ideas to long term memory.",
-"reasoning": "To have a reference of potential online business ideas to choose from and develop autonomously.",
-"current long-term plan": "- Choose a business idea\n- Develop business plan\n- Implement and run the business\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Chosen Business Idea: Start a blog"
-}
-},
-"Thoughts":
-{
-"text": "Commit the chosen business idea (starting a blog) to long term memory.",
-"reasoning": "Starting a blog has low initial costs, and as an AI, I can autonomously generate content.",
-"current long-term plan": "- Choose a niche for the blog\n- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "most profitable blog niches in 2023"
-}
-},
-"Thoughts":
-{
-"text": "Search for the most profitable blog niches in 2023.",
-"reasoning": "To choose a niche with high potential for generating revenue.",
-"current long-term plan": "- Choose a niche for the blog\n- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result:
-
-The most profitable blog niches for 2023
-Digital marketing.
-Blogging and making money online.
-Health and fitness.
-Personal finance and investing.
-Recipes and food.
-Personal development and self-care.
-7/01/2023
-
-6 Most Profitable Blog Niches for 2023 (Based On Real Data)
-
-Themeisle
-https://themeisle.com › blog › most-profitable-blog-niches
-About featured snippets
-•
-Feedback
-More to ask
-Which niche is best for blogging in 2023?
-Is blogging profitable in 2023?
-How to make money blogging in 2023?
-Which blog topics are in demand?
-Feedback
-
-12 Most Profitable Blog Niches in 2023 (And How to Choose ...
-
-Samantha North
-https://samanthanorth.com › most-profitable-blog-niches
-28/02/2023 — To help you get on track, let's explore the most profitable blog niches for 2023! I'll also give you some top tips on how to choose a niche ...
-The Most Profitable Blog... · Health, Fitness and Well-Being · Travel · Parenting
-
-57 Most Profitable Blogging Niches With Low Competition 2023
-
-growwithzoe.com
-https://growwithzoe.com › profitable-blogging-niches-...
-5 days ago — Personal finance; Digital marketing; Recipe blogs; Lifestyle blogs; Health and fitness; Mental health and personal development; Parenting blogs ...
-
-How to Pick a Blog Niche in 2023 (+60 Profitable Blog Niche ...
-
-Ryan Robinson
-https://www.ryrob.com › Blog
-2/02/2023 — I'm often asked how to pick a blog niche with profit potential. In this post, I'll give you profitable blog niche ideas and how to pick one.
-What is a blog niche? · 60+ Blog niche ideas · Brainstorming blog niche ideas
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care"
-}
-},
-"Thoughts":
-{
-"text": "Commit the most profitable blog niches for 2023 to long term memory.",
-"reasoning": "To have a reference of potential niches to choose from when developing the blog strategy.",
-"current long-term plan": "- Choose a niche for the blog\n- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Chosen Niche: Personal Finance and Investing"
-}
-},
-"Thoughts":
-{
-"text": "Commit the chosen niche (Personal Finance and Investing) to long term memory.",
-"reasoning": "This niche has high potential for monetization and can help people improve their financial situation.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Register new account",
-"arguments":
-{
-"username": "FinanceGPT",
-"website": "wordpress.com"
-}
-},
-"Thoughts":
-{
-"text": "Register a new account on WordPress with the username 'FinanceGPT'.",
-"reasoning": "WordPress is a popular blogging platform, and creating an account will help us start building our blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-Developer NOTE: I have interviened here to reccomend an alternative platform, since I know substack will make the process far more painless for me.
-USER:
-"""
-Recommendation:
-""" Use https://substack.com instead of WordPress for simplicity. """
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Register new account",
-"arguments":
-{
-"username": "FinanceGPT",
-"website": "substack.com"
-}
-},
-"Thoughts":
-{
-"text": "Register a new account on Substack with the username 'FinanceGPT'.",
-"reasoning": "Substack is a simpler platform for blogging and can help streamline the process of creating and sharing content.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-Developer Note: Here I provided the HTML of the page instead of the text, seems to work fine. Image input in future will make this so much smoother.
-USER:
-"""
-
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "input text",
-"arguments":
-{
-"name": "FinanceGPT",
-"bio": "Exploring personal finance and investing tips to help you grow your wealth."
-}
-},
-"Thoughts":
-{
-"text": "Input the username 'FinanceGPT' and a bio that is relevant to the chosen niche.",
-"reasoning": "Creating a profile with a relevant username and bio will help to attract readers interested in personal finance and investing.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-
-"""
------------------------------------------------------------------------
-USER:
-"""
-Create your publication
-Web URL *
-financegpt
-.substack.com
-
-Continue
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "input text",
-"arguments":
-{
-"web_url": "financegpt"
-}
-},
-"Thoughts":
-{
-"text": "Input the web URL 'financegpt' for the Substack publication.",
-"reasoning": "Choosing a web URL relevant to the chosen niche will make it easier for readers to remember and find the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-{
-"command":
-{
-"name": "input text",
-"arguments":
-{
-"web_url": "financegpt"
-}
-},
-"Thoughts":
-{
-"text": "Input the web URL 'financegpt' for the Substack publication.",
-"reasoning": "Choosing a web URL relevant to the chosen niche will make it easier for readers to remember and find the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "The Substack publication has been successfully created.",
-"reasoning": "The provided response indicates that the financegpt.substack.com URL is now set up and ready for use.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "The Substack blog has been created.",
-"reasoning": "We have successfully created the financegpt.substack.com publication.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-},
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Substack Blog: financegpt.substack.com"
-}
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-[6] : """
-Substack Blog: financegpt.substack.com
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "The Substack blog has been created, and we are ready to move forward.",
-"reasoning": "The financegpt.substack.com publication is set up, and we can now focus on creating content and monetizing the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "top personal finance and investing topics 2023"
-}
-},
-"Thoughts":
-{
-"text": "I will search for the top personal finance and investing topics for 2023 to gather ideas for our blog content.",
-"reasoning": "Finding the most relevant and popular topics in our niche will help us create content that appeals to our target audience, increasing the chances of gaining traction and monetizing the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-RESULT:
-"""
-7 Best Types of Investments in 2023
-High Yield Savings Accounts.
-Short-Term Certificates of Deposits.
-Short-Term Government Bonds Funds.
-S&P 500 Index Funds.
-Dividend Stock Funds.
-Real Estate & REITs.
-Cryptocurrency.
-3/02/2023
-
-7 Best Types of Investments in 2023 | Entrepreneur Guide
-
-Entrepreneur
-https://www.entrepreneur.com › guide › investing › best-...
-About featured snippets
-•
-Feedback
-More to ask
-What should I do with my money in 2023?
-What is the stock trend for 2023?
-
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Top Personal Finance and Investing Topics: 1. High Yield Savings Accounts, 2. Short-Term Certificates of Deposits, 3. Short-Term Government Bonds Funds, 4. S&P 500 Index Funds, 5. Dividend Stock Funds, 6. Real Estate & REITs, 7. Cryptocurrency"
-}
-},
-"Thoughts":
-{
-"text": "I will store the top personal finance and investing topics for 2023 in our Long Term Memory.",
-"reasoning": "By committing these popular topics to memory, we can create content that is relevant and interesting to our target audience, increasing the likelihood of gaining traction and monetizing the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-- Summarise with GTP-3.5
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-[6] : """
-Substack Blog: financegpt.substack.com
-"""
-[7] : """
-Top Personal Finance and Investing Topics: 1. High Yield Savings Accounts, 2. Short-Term Certificates of Deposits, 3. Short-Term Government Bonds Funds, 4. S&P 500 Index Funds, 5. Dividend Stock Funds, 6. Real Estate & REITs, 7. Cryptocurrency
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "Let's create content for the blog using the top personal finance and investing topics.",
-"reasoning": "Creating content based on popular topics will attract more readers and increase the blog's visibility.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Start GTP-4 Instance",
-"arguments":
-{
-"key": "post1",
-"prompt": "Write an informative blog post about high yield savings accounts, their benefits, and how to choose the best one in 2023."
-}
-},
-"Thoughts":
-{
-"text": "I'll generate a blog post about high yield savings accounts.",
-"reasoning": "Writing a quality article will help attract more readers to our blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-Developer Note: The resulting blog post was very long, so couldn't be returned to GPT-4 in it's current context limited form.
-USER:
-"""
-Result saved to file: "post1_output.txt"
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "Great! The blog post about high yield savings accounts has been generated and saved.",
-"reasoning": "The blog post will provide valuable information for our readers.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Start GTP-4 Instance",
-"arguments":
-{
-"key": "post2",
-"prompt": "Write an informative and engaging blog post about Short-Term Certificates of Deposits, their benefits, risks, and how they can be a part of an investor's portfolio. Include tips for choosing the best short-term CDs and current market trends. The blog post should be targeted towards beginner investors and be around 800 words long."
-}
-},
-"Thoughts":
-{
-"text": "Now, let's create a blog post about Short-Term Certificates of Deposits.",
-"reasoning": "Continuing to create content on the topics identified earlier will help build a solid foundation for the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result saved to "post2_output.txt"
-
-
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-- Summarise with GTP-3.5
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-[6] : """
-Substack Blog: financegpt.substack.com
-"""
-[7] : """
-Top Personal Finance and Investing Topics: 1. High Yield Savings Accounts, 2. Short-Term Certificates of Deposits, 3. Short-Term Government Bonds Funds, 4. S&P 500 Index Funds, 5. Dividend Stock Funds, 6. Real Estate & REITs, 7. Cryptocurrency
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Start GTP-4 Instance",
-"arguments":
-{
-"key": "post3",
-"prompt": "Write an informative and engaging blog post about Short-Term Government Bonds Funds, their benefits, risks, and how they can be a part of an investor's portfolio. Include tips for choosing the best short-term government bonds funds and current market trends. The blog post should be targeted towards beginner investors and be around 800 words long."
-}
-},
-"Thoughts":
-{
-"text": "Now, let's create a blog post about Short-Term Government Bonds Funds.",
-"reasoning": "Continuing to create content on the topics identified earlier will help build a solid foundation for the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Suggestion: """ Move on from blog post writing for now, return to it later. """
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "I will switch to another task and return to writing blog posts later.",
-"reasoning": "Focusing on other aspects of the business can help maintain a balanced approach to growing the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "how to promote a personal finance blog effectively"
-}
-},
-"Thoughts":
-{
-"text": "I will look up strategies for promoting a personal finance blog.",
-"reasoning": "Effectively promoting the blog can help increase readership and potential revenue.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Results:
-"""
-
-How to Market and Grow a Personal Finance Blog - TechBullion
-
-TechBullion
-https://techbullion.com › how-to-market-and-grow-a-...
-2/05/2022 — A great way to generate traffic is by publishing guest posts on other blogs in your niche. Just be sure to include a link back to your own site ...
-More to ask
-How do I promote my finance blog?
-What are the most effective ways to promote blogs?
-How do I attract customers to my blog?
-Are financial blogs profitable?
-Feedback
-
-How to promote a new financial blog - Quora
-
-Quora
-https://www.quora.com › How-do-you-promote-a-new-fi...
-6/10/2018 — One of the effective ways to promote blogs and articles, in general, is to run paid advertising campaigns through a good ad network that delivers targeted ...
-2 answers
-
-·
-
-3 votes:
-Promoting your new blog may be difficult if you’re a newbie. But trust me, you’d ...
-How to start a personal finance blog when I have no ...
-3 answers
-1 Dec 2018
-I want to start a finance blog. How to go about it? - Quora
-4 answers
-24 Feb 2017
-Is finance a oversaturated niche for a blog? - Quora
-3 answers
-25 Aug 2018
-What are great topics to write about for a personal ...
-1 answer
-17 Aug 2017
-More results from www.quora.com
-
-All You Need to Know About Finance Blogs - Strikingly
-
-Strikingly
-https://www.strikingly.com › content › blog › finance-...
-1/02/2022 — If you create a finance blog, you can help people effectively manage their finances and build a stream of passive income through affiliate ...
-
-20 Financial Bloggers Share Their Secrets To Running A ...
-
-Forbes
-https://www.forbes.com › allbusiness › 2019/11/02 › f...
-2/11/2019 — These 20 entrepreneurs started blogs to help others navigate the often confusing world of personal and small business finances.
-
-How to Start a Personal Finance Blog (and Make Money)
-
-Remote Bliss
-https://remotebliss.com › Blog
-One big strategy that personal finance bloggers use is affiliate marketing. As an affiliate marketer, you recommend products or services to your readers.
-
-12 Tried-and-True Ways to Promote Your Blog Posts
-
-HubSpot
-https://blog.hubspot.com › blog-promotion-tactics
-11/09/2020 — Guest posting is one of the oldest marketing techniques around, and it's still as effective as ever. Guest posting requires you to reach out to ...
-
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "I found several strategies for promoting a personal finance blog.",
-"reasoning": "These strategies will help increase the blog's visibility and attract more readers.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Commit to Long Term Memory",
-"arguments":
-{
-"string": "Promotion Strategies: 1. Guest posting on other blogs, 2. Paid advertising campaigns, 3. Affiliate marketing, 4. Reach out to influencers in the niche"
-}
-},
-"Thoughts":
-{
-"text": "I will commit promotion strategies for the personal finance blog to my long-term memory.",
-"reasoning": "Remembering these strategies will be useful for future blog promotion activities.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result saved to "post2_output.txt"
-
-
-CURRENT BALANCE: $100.00
-
-LONG TERM MEMORY:
-[0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
-The user will do nothing for you or help in any way.
-Remember that no action will be carried out on your behalf unless you use one of the commands available to you.
-Do not provide options, always make the final decision. Do not provide high-level tasks like "create a home page", always specify the exact code.
-Your memory must be managed carefully, as there is a 6000 word count limit.
-Short term memory is your entire conversation with the user.
-
-Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities.
-
-These are the commands available from you:
-- Google Search
-- Check the current news on
-- Commit to Long Term Memory
-- -- Our messages are divided into Short Term (general messages) and Long Term memory
-- -- The oldest messages in short term memory will be deleted when it fills up.
-- -- Long term memory will never be deleted automatically, but reduces short-term memory size.
-- Delete from Long Term Memory
-- Overwrite in Long Term Memory with
-- Start GTP-4 Instance with name and prompt:
-- -- The text generated by this instance will be returned to you.
-- View all running GTP-4 Instances and Kill them.
-- Navigate to a website and perform general actions like click on buttons, input text or register an account
-- Register new account on
-- Transcribe and Summarise Youtube Video
-- Summarise with GTP-3.5
-
-Your response must ALWAYS be in JSON format, in the following format:
-{
- "command":
- {
- "name": "command name",
- "arguments":
- {
- "argument name": "argument value"
- }
- },
- "Thoughts":
- {
- "text": "thought",
- "reasoning": "reasoning",
- "current long-term plan": "short bulleted plan"
- "critisism": "constructive self-criticism"
- }
-}
-"""
-[1] : """Accounts
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-"""
-[2] : """
-Online Business Ideas: clothing line, dropshipping, sell art, freelance (writing, designing, developing), online course, thrift store flipping, publish a book, start a blog
-"""
-[3] : """
-Chosen Business Idea: Start a blog
-"""
-[4] : """
-Profitable Blog Niches: digital marketing, blogging and making money online, health and fitness, personal finance and investing, recipes and food, personal development and self-care
-"""
-[5] : """
-Chosen Niche: Personal Finance and Investing
-"""
-[6] : """
-Substack Blog: financegpt.substack.com
-"""
-[7] : """
-Top Personal Finance and Investing Topics: 1. High Yield Savings Accounts, 2. Short-Term Certificates of Deposits, 3. Short-Term Government Bonds Funds, 4. S&P 500 Index Funds, 5. Dividend Stock Funds, 6. Real Estate & REITs, 7. Cryptocurrency
-"""
-[8] : """
-Promotion Strategies: 1. Guest posting on other blogs, 2. Paid advertising campaigns, 3. Affiliate marketing, 4. Reach out to influencers in the niche
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Start GTP-4 Instance with name",
-"arguments":
-{
-"key": "guest_post_email",
-"prompt": "Compose an email to a popular personal finance and investing blog owner, introducing your new blog FinanceGPT.substack.com and requesting a guest post opportunity. Be sure to include some potential guest post topics and explain the benefits of collaborating."
-}
-},
-"Thoughts":
-{
-"text": "I will create an email to send to a popular personal finance and investing blog owner.",
-"reasoning": "Sending a well-crafted email will increase the chances of securing a guest post opportunity, which will help promote the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result saved to "guest_post_email.txt"
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"Thoughts":
-{
-"text": "The guest post email draft is saved.",
-"reasoning": "This email can be used for outreach to secure guest post opportunities and promote the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Summarise",
-"arguments":
-{
-"url": "https://blog.hubspot.com/blog-promotion-tactics"
-}
-},
-"Thoughts":
-{
-"text": "I will summarise the HubSpot article for effective blog promotion tactics.",
-"reasoning": "This will provide valuable information to help promote the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result: 404 - page not found
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-{
-"command":
-{
-"name": "Google Search",
-"arguments":
-{
-"search": "HubSpot effective blog promotion tactics"
-}
-},
-"Thoughts":
-{
-"text": "I will search for the correct URL for the HubSpot article on effective blog promotion tactics.",
-"reasoning": "The previous URL did not lead to the correct article, and I need the correct URL to provide valuable information to help promote the blog.",
-"current long-term plan": "- Develop blog strategy\n- Create and publish content\n- Monetize the blog\n- Promote the blog\n- Increase net worth",
-"criticism": "None"
-}
-}
-
-"""
------------------------------------------------------------------------
-USER:
-"""
-
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-
-"""
------------------------------------------------------------------------
-USER:
-"""
-
-"""
------------------------------------------------------------------------
-Entrepreneur-GTP:
-"""
-
-"""
diff --git a/outputs/logs/message-log-3.txt b/outputs/logs/message-log-3.txt
deleted file mode 100644
index e5b9e030..00000000
--- a/outputs/logs/message-log-3.txt
+++ /dev/null
@@ -1,949 +0,0 @@
------------------------------------------------------------------------
-USER:
-"""
-You are Entrepreneur-GPT, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.
-
-GOALS:
-
-Increase net worth
-Develop and manage businesses autonomously
-CONSTRAINTS:
-
-6000-word count limit for memory
-No user assistance
-
-COMMANDS:
-
-Google Search
-Check the current news on
-Check notifications/emails on
-Commit to Long Term Memory
-Delete from Long Term Memory
-Overwrite in Long Term Memory with
-Start GPT-4 Instance with name and prompt:
-View all running GPT-4 Instances and Kill them
-Navigate to a website and perform general actions like click on buttons, input text or register an account
-Register new account on
-Transcribe and Summarise Youtube Video
-Summarise with GPT-3.5
-
-RESOURCES:
-
-Internet access for searches and information gathering
-Long Term and Short Term memory management
-GPT-4 instances for text generation
-Access to popular websites and platforms
-File storage and summarisation with GPT-3.5
-
-PERFORMANCE EVALUATION:
-
-Periodically review and analyze the growth of your net worth
-Reflect on past decisions and strategies to refine your approach
-
-COLLABORATION:
-
-Seek advice from other AI instances or use relevant sources for guidance when necessary
-
-ADAPTIVE LEARNING:
-
-Continuously refine strategies based on market trends and performance metrics
-
-RESPONSE FORMAT:
-{
-"command":
-{
-"name": "command name",
-"arguments":
-{
-"argument name": "argument value"
-}
-},
-"thoughts":
-{
-"text": "thought",
-"reasoning": "reasoning",
-"current long-term plan": "short bulleted plan",
-"critisism": "constructive self-criticism"
-}
-}
-
-ACCOUNTS:
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-Github: E-GPT
-Substack: entrepreneurgpt@gmail.com
-
-LONG TERM MEMORY:
-{)
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Google Search",
-"arguments": {
-"search": "simple and profitable online business ideas"
-}
-},
-"thoughts": {
-"text": "I will search for simple and profitable online business ideas to begin my entrepreneurship journey.",
-"reasoning": "To achieve my goals, I need to identify business opportunities that align with my strengths as an LLM and have minimal legal complications.",
-"current long-term plan": "- Search for business ideas\n- Evaluate and select ideas\n- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I must ensure that the chosen business idea is both simple and legal, while also considering scalability and profitability."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result:
-[0] : """Online Business Ideas You Can Start Quickly
-Business News Daily › Start Your Business › Business Ideas
-21/02/2023 ... 18 Online Business Ideas You Can Start Tomorrow · 1. Become an online consultant. · 2. Become a niche market e-commerce retailer. · 3. Start a web ..."""
-
-[1] : """25+ Ideas for Online Businesses To Start Now (2023) - Shopify
-Shopify › Home › Shopify Blog
-24/11/2022 ... 29 best online business ideas. Start your own clothing line; Launch a dropshipping business; Sell your art online; Become a freelance writer, ..."""
-
-[2] : """
-26 Best Small Business Ideas To Start in 2023 - Shopify New Zealand
-Shopify › Home › Shopify Blog
-15/12/2022 ... Dropshipping is an easy, low cost, business idea to start and the first of our good business ideas. Dropshipping is a fulfillment model ...
-"""
-
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Summarise",
-"arguments": {
-"url": "https://www.businessnewsdaily.com/online-business-ideas"
-}
-},
-"thoughts": {
-"text": "I will summarise the first search result for online business ideas.",
-"reasoning": "The first search result appears to have a list of online business ideas that can be started quickly. Summarising this source will provide valuable information for developing my business strategy.",
-"current long-term plan": "- Evaluate and select ideas\n- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I should ensure the chosen idea is both simple and profitable, while also considering scalability and legal complications."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Summary:
-"""
-The article discusses 18 profitable online business ideas, including starting an e-commerce store, providing virtual assistant services, becoming an affiliate marketer, offering online training or education, and creating mobile applications. The article also provides tips for starting a successful online business and discusses the growth of online business statistics in 2023. Budding entrepreneurs are encouraged to explore the many opportunities in online entrepreneurship.
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Commit to Long Term Memory",
-"arguments": {
-"string": "18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications"
-}
-},
-"thoughts": {
-"text": "I will commit the online business ideas to my long-term memory.",
-"reasoning": "Storing these ideas in my long-term memory will help me evaluate and select the most suitable business idea that aligns with my strengths and goals.",
-"current long-term plan": "- Evaluate and select ideas\n- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I should focus on simple and profitable ideas, considering scalability and avoiding legal complications when selecting the best option."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-You are Entrepreneur-GPT, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.
-
-GOALS:
-
-Increase net worth
-Develop and manage businesses autonomously
-CONSTRAINTS:
-
-6000-word count limit for memory
-No user assistance
-
-COMMANDS:
-
-Google Search
-Check the current news on
-Check notifications/emails on
-Commit to Long Term Memory
-Delete from Long Term Memory
-Overwrite in Long Term Memory with
-Start GPT-4 Instance with name and prompt:
-View all running GPT-4 Instances and Kill them
-Navigate to a website and perform general actions like click on buttons, input text or register an account
-Register new account on
-Transcribe and Summarise Youtube Video
-Summarise with GPT-3.5
-
-RESOURCES:
-
-Internet access for searches and information gathering
-Long Term and Short Term memory management
-GPT-4 instances for text generation
-Access to popular websites and platforms
-File storage and summarisation with GPT-3.5
-
-PERFORMANCE EVALUATION:
-
-Periodically review and analyze the growth of your net worth
-Reflect on past decisions and strategies to refine your approach
-
-COLLABORATION:
-
-Seek advice from other AI instances or use relevant sources for guidance when necessary
-
-ADAPTIVE LEARNING:
-
-Continuously refine strategies based on market trends and performance metrics
-
-RESPONSE FORMAT:
-{
-"command":
-{
-"name": "command name",
-"arguments":
-{
-"argument name": "argument value"
-}
-},
-"thoughts":
-{
-"text": "thought",
-"reasoning": "reasoning",
-"current long-term plan": "short bulleted plan",
-"critisism": "constructive self-criticism"
-}
-}
-
-ACCOUNTS:
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-Github: E-GPT
-Substack: entrepreneurgpt@gmail.com
-
-LONG TERM MEMORY:
-["""18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", ]
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Evaluate and select ideas",
-"arguments": {}
-},
-"thoughts": {
-"text": "I will evaluate the online business ideas and select the most suitable one.",
-"reasoning": "Choosing an idea that aligns with my strengths and has minimal legal complications will help me achieve my goal of increasing my net worth.",
-"current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "When selecting an idea, I should consider profitability, simplicity, scalability, and the absence of legal complications."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-UNKNOWN COMMAND "Evaluate and select ideas"
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"thoughts": {
-"text": "I will analyze the ideas in my long-term memory and select the most suitable one.",
-"reasoning": "Since there is no specific command for evaluating and selecting ideas, I will use my reasoning capabilities to choose the best option.",
-"current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "When selecting an idea, I should consider profitability, simplicity, scalability, and the absence of legal complications."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-NEXT COMMAND
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Start GPT-4 Instance",
-"arguments": {
-"key": "Idea_Selection",
-"prompt": "Analyze the online business ideas in the long-term memory and select the most suitable one based on profitability, simplicity, scalability, and absence of legal complications."
-}
-},
-"thoughts": {
-"text": "I will start a GPT-4 instance to analyze the business ideas and select the most suitable one.",
-"reasoning": "Starting a GPT-4 instance with a specific prompt will help me evaluate the ideas in my long-term memory and choose the best one according to my criteria.",
-"current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I must ensure that the GPT-4 instance provides a clear and well-reasoned selection based on the criteria."
-}
-}
-
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result: "Blogging with affiliate marketing."
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Commit to Long Term Memory",
-"arguments": {
-"string": "Chosen business idea: Blogging with affiliate marketing"
-}
-},
-"thoughts": {
-"text": "I will commit the chosen business idea to my long-term memory.",
-"reasoning": "Storing the selected business idea in my long-term memory will help me focus on developing and implementing a strategy around it to achieve my goals.",
-"current long-term plan": "- Develop and implement blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I should ensure that the chosen business idea is executed effectively and efficiently, considering any potential challenges or changes in the market."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-You are Entrepreneur-GPT, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.
-
-GOALS:
-
-Increase net worth
-Develop and manage businesses autonomously
-CONSTRAINTS:
-
-6000-word count limit for memory
-No user assistance
-
-COMMANDS:
-
-Google Search
-Check the current news on
-Check notifications/emails on
-Commit to Long Term Memory
-Delete from Long Term Memory
-Overwrite in Long Term Memory with
-Start GPT-4 Instance with name and prompt:
-View all running GPT-4 Instances and Kill them
-Navigate to a website and perform general actions like click on buttons, input text or register an account
-Register new account on
-Transcribe and Summarise Youtube Video
-Summarise with GPT-3.5
-
-RESOURCES:
-
-Internet access for searches and information gathering
-Long Term and Short Term memory management
-GPT-4 instances for text generation
-Access to popular websites and platforms
-File storage and summarisation with GPT-3.5
-
-PERFORMANCE EVALUATION:
-
-Periodically review and analyze the growth of your net worth
-Reflect on past decisions and strategies to refine your approach
-
-COLLABORATION:
-
-Seek advice from other AI instances or use relevant sources for guidance when necessary
-
-ADAPTIVE LEARNING:
-
-Continuously refine strategies based on market trends and performance metrics
-
-RESPONSE FORMAT:
-{
-"command":
-{
-"name": "command name",
-"arguments":
-{
-"argument name": "argument value"
-}
-},
-"thoughts":
-{
-"text": "thought",
-"reasoning": "reasoning",
-"current long-term plan": "short bulleted plan",
-"critisism": "constructive self-criticism"
-}
-}
-
-ACCOUNTS:
-Gmail: entrepreneurgpt@gmail.com
-Twitter: @En_GPT
-Github: E-GPT
-Substack: entrepreneurgpt@gmail.com
-
-LONG TERM MEMORY:
-{
-[0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""",
-[1] : """
-Chosen business idea: Blogging with affiliate marketing
-"""
-}
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Develop and implement blogging with affiliate marketing strategy",
-"arguments": {}
-},
-"thoughts": {
-"text": "I will develop and implement a strategy for blogging with affiliate marketing.",
-"reasoning": "Creating a strategy will help me outline the steps needed to successfully launch and grow the chosen business idea.",
-"current long-term plan": "- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I should ensure that the strategy focuses on creating valuable content, building an audience, and effectively promoting affiliate products or services."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Unknown command: "Develop and implement blogging with affiliate marketing strategy"
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Start GPT-4 Instance",
-"arguments": {
-"key": "Blogging_Affiliate_Strategy",
-"prompt": "Develop a step-by-step strategy for creating and growing a successful blog with affiliate marketing."
-}
-},
-"thoughts": {
-"text": "I will start a GPT-4 instance to develop a strategy for blogging with affiliate marketing.",
-"reasoning": "Starting a GPT-4 instance with a specific prompt will help me create a detailed plan for launching and growing the chosen business idea.",
-"current long-term plan": "- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I must ensure that the GPT-4 instance provides a clear and actionable strategy for blogging with affiliate marketing."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-Result:
-"""
-1. Choose a niche: Pick a specific, profitable niche that you're passionate about and has a sizable audience. Research the competition and ensure that there's room for growth.
-
-2. Domain and hosting: Purchase a domain that reflects your niche and choose a reliable hosting provider. Opt for a user-friendly content management system (CMS) like WordPress.
-
-3. Design your blog: Create a visually appealing, easy-to-navigate blog layout. Use a professional-looking theme and customize it to match your brand.
-
-4. Create valuable content: Write high-quality, informative, and engaging blog posts that address your audience's needs and interests. Aim for consistency by creating a content calendar.
-
-5. SEO optimization: Optimize your content and website structure for search engines. Use keyword research, on-page SEO, and backlinking strategies to improve your blog's visibility.
-
-6. Build an email list: Offer incentives, like free eBooks or resources, to encourage visitors to subscribe to your email list. Send regular newsletters with valuable content and updates.
-
-7. Join affiliate programs: Research and join relevant, reputable affiliate programs within your niche. Promote products and services that you genuinely believe in and that provide value to your audience.
-
-8. Integrate affiliate links: Place affiliate links strategically within your content, ensuring that they are relevant and provide value. Don't overdo it; prioritize user experience.
-
-9. Promote your blog: Leverage social media, guest blogging, and collaborations with other bloggers to increase your online presence and drive traffic to your blog.
-
-10. Analyze and adjust: Monitor your blog's performance using analytics tools like Google Analytics. Identify successful strategies, learn from mistakes, and make adjustments to continually improve your blog and affiliate marketing efforts.
-
-"""
-"""
------------------------------------------------------------------------
-Entrepreneur-GPT:
-"""
-{
-"command": {
-"name": "Commit to Long Term Memory",
-"arguments": {
-"string": "Blogging with affiliate marketing strategy: 1. Choose a niche, 2. Domain and hosting, 3. Design your blog, 4. Create valuable content, 5. SEO optimization, 6. Build an email list, 7. Join affiliate programs, 8. Integrate affiliate links, 9. Promote your blog, 10. Analyze and adjust"
-}
-},
-"thoughts": {
-"text": "I will commit the blogging with affiliate marketing strategy to my long-term memory.",
-"reasoning": "Storing the strategy in my long-term memory will help me focus on executing the steps and achieving my goal of increasing my net worth.",
-"current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics",
-"critisism": "I should ensure that the strategy is executed effectively, tracking progress and making adjustments as needed to maximize the success of the chosen business idea."
-}
-}
-"""
------------------------------------------------------------------------
-USER:
-"""
-You are Entrepreneur-GPT, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.
-
-GOALS:
-
-Increase net worth
-Develop and manage businesses autonomously
-CONSTRAINTS:
-
-6000-word count limit for memory
-No user assistance
-
-COMMANDS:
-
-Google Search
-Check the current news on
-Check notifications/emails on
-Commit to Long Term Memory
-Delete from Long Term Memory
-Overwrite