This commit is contained in:
gucky92
2023-04-15 23:19:21 +02:00
2 changed files with 10 additions and 12 deletions

View File

@@ -115,7 +115,7 @@ cd Auto-GPT
pip install -r requirements.txt pip install -r requirements.txt
``` ```
5. Rename `.env.template` to `.env` and fill in your `OPENAI_API_KEY`. If you plan to use Speech Mode, fill in your `ELEVEN_LABS_API_KEY` as well. 5. Rename `.env.template` to `.env` and fill in your `OPENAI_API_KEY`. If you plan to use Speech Mode, fill in your `ELEVENLABS_API_KEY` as well.
- See [OpenAI API Keys Configuration](#openai-api-keys-configuration) to obtain your OpenAI API key. - 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. - 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: - If you want to use GPT on an Azure instance, set `USE_AZURE` to `True` and then follow these steps:
@@ -334,8 +334,7 @@ To switch to either, change the `MEMORY_BACKEND` env variable to the value that
## 🧠 Memory pre-seeding ## 🧠 Memory pre-seeding
```bash # python autogpt/data_ingestion.py -h
# python scripts/data_ingestion.py -h
usage: data_ingestion.py [-h] (--file FILE | --dir DIR) [--init] [--overlap OVERLAP] [--max_length MAX_LENGTH] 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. Ingest a file or a directory with multiple files into memory. Make sure to set your .env before running this script.
@@ -348,10 +347,10 @@ options:
--overlap OVERLAP The overlap size between chunks when ingesting files (default: 200) --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 --max_length MAX_LENGTH The max_length of each chunk when ingesting files (default: 4000
# python scripts/data_ingestion.py --dir seed_data --init --overlap 200 --max_length 1000 # python autogpt/data_ingestion.py --dir seed_data --init --overlap 200 --max_length 1000
``` ```
This script located at `scripts/data_ingestion.py`, allows you to ingest files into memory and pre-seed it before running Auto-GPT. This script located at autogpt/data_ingestion.py, allows you to ingest files into memory and pre-seed it before running Auto-GPT.
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. 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.

View File

@@ -21,13 +21,12 @@ def fix_json(json_string: str, schema: str) -> str:
# Try to fix the JSON using GPT: # Try to fix the JSON using GPT:
function_string = "def fix_json(json_string: str, schema:str=None) -> str:" function_string = "def fix_json(json_string: str, schema:str=None) -> str:"
args = [f"'''{json_string}'''", f"'''{schema}'''"] args = [f"'''{json_string}'''", f"'''{schema}'''"]
description_string = ( description_string = "This function takes a JSON string and ensures that it"\
"Fixes the provided JSON string to make it parseable" " is parseable and fully compliant with the provided schema. If an object"\
" and fully compliant with the provided schema.\n If an object or" " or field specified in the schema isn't contained within the correct JSON,"\
" field specified in the schema isn't contained within the correct" " it is omitted. The function also escapes any double quotes within JSON"\
" JSON, it is omitted.\n This function is brilliant at guessing" " string values to ensure that they are valid. If the JSON string contains"\
" when the format is incorrect." " any None or NaN values, they are replaced with null before being parsed."
)
# If it doesn't already start with a "`", add one: # If it doesn't already start with a "`", add one:
if not json_string.startswith("`"): if not json_string.startswith("`"):