├── scripts ├── ui │ ├── __init__.py │ └── ui.py ├── .gitignore ├── memory.py ├── assets │ └── favicon.ico ├── pcconfig.py ├── llm_utils.py ├── data.py ├── call_ai_function.py ├── spinner.py ├── speak.py ├── execute_code.py ├── ai_functions.py ├── ai_config.py ├── agent_manager.py ├── file_operations.py ├── config.py ├── token_counter.py ├── data │ └── prompt.txt ├── json_parser.py ├── browse.py ├── chat.py ├── templates │ └── index.html ├── graph_ui.py ├── commands.py └── main.py ├── .github ├── FUNDING.yml └── workflows │ └── auto_format.yml ├── Dockerfile ├── .env.template ├── .gitignore ├── requirements.txt ├── LICENSE ├── outputs ├── guest_post_email.txt ├── post1_output.txt ├── how_to_save_money_on_energy_bills.txt ├── post2_output.txt └── logs │ ├── message-log-4.txt │ ├── message-log-1.txt │ └── message-log-3.txt ├── tests └── json_tests.py └── README.md /scripts/ui/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | pynecone.db 2 | .web -------------------------------------------------------------------------------- /scripts/memory.py: -------------------------------------------------------------------------------- 1 | permanent_memory = [] 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: Torantulino 4 | -------------------------------------------------------------------------------- /scripts/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kairess/Auto-GPT-Graph/HEAD/scripts/assets/favicon.ico -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11 2 | 3 | WORKDIR /app 4 | COPY scripts/ /app 5 | 6 | RUN pip install -r requirements.txt 7 | 8 | CMD ["python", "main.py"] 9 | -------------------------------------------------------------------------------- /scripts/pcconfig.py: -------------------------------------------------------------------------------- 1 | import pynecone as pc 2 | 3 | config = pc.Config( 4 | app_name="ui", 5 | db_url="sqlite:///pynecone.db", 6 | env=pc.Env.DEV, 7 | ) 8 | -------------------------------------------------------------------------------- /.env.template: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY=your-openai-api-key 2 | ELEVENLABS_API_KEY=your-elevenlabs-api-key 3 | SMART_LLM_MODEL="gpt-4" 4 | FAST_LLM_MODEL="gpt-3.5-turbo" 5 | GOOGLE_API_KEY= 6 | CUSTOM_SEARCH_ENGINE_ID= -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | scripts/keys.py 2 | scripts/*json 3 | scripts/node_modules/ 4 | scripts/__pycache__/keys.cpython-310.pyc 5 | package-lock.json 6 | *.pyc 7 | scripts/auto_gpt_workspace/* 8 | *.mpeg 9 | .env 10 | last_run_ai_settings.yaml 11 | outputs/* 12 | auto_gpt_workspace 13 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | colorama==0.4.6 3 | openai==0.27.2 4 | playsound==1.3.0 5 | python-dotenv==1.0.0 6 | pyyaml==6.0 7 | readability-lxml==0.8.1 8 | requests 9 | tiktoken==0.3.3 10 | gTTS==2.3.1 11 | docker 12 | duckduckgo-search 13 | google-api-python-client #(https://developers.google.com/custom-search/v1/overview) 14 | pynecone==0.1.21 15 | -------------------------------------------------------------------------------- /scripts/llm_utils.py: -------------------------------------------------------------------------------- 1 | import openai 2 | from config import Config 3 | cfg = Config() 4 | 5 | openai.api_key = cfg.openai_api_key 6 | 7 | # Overly simple abstraction until we create something better 8 | def create_chat_completion(messages, model=None, temperature=None, max_tokens=None)->str: 9 | response = openai.ChatCompletion.create( 10 | model=model, 11 | messages=messages, 12 | temperature=temperature, 13 | max_tokens=max_tokens 14 | ) 15 | 16 | return response.choices[0].message["content"] 17 | -------------------------------------------------------------------------------- /scripts/data.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | SRC_DIR = Path(__file__).parent 4 | 5 | def load_prompt(): 6 | try: 7 | # get directory of this file: 8 | file_dir = Path(os.path.dirname(os.path.realpath(__file__))) 9 | data_dir = file_dir / "data" 10 | prompt_file = data_dir / "prompt.txt" 11 | # Load the promt from data/prompt.txt 12 | with open(SRC_DIR/ "data/prompt.txt", "r") as prompt_file: 13 | prompt = prompt_file.read() 14 | 15 | return prompt 16 | except FileNotFoundError: 17 | print("Error: Prompt file not found", flush=True) 18 | return "" 19 | -------------------------------------------------------------------------------- /.github/workflows/auto_format.yml: -------------------------------------------------------------------------------- 1 | name: auto-format 2 | on: pull_request 3 | jobs: 4 | format: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout PR branch 8 | uses: actions/checkout@v2 9 | with: 10 | ref: ${{ github.event.pull_request.head.sha }} 11 | - name: autopep8 12 | uses: peter-evans/autopep8@v1 13 | with: 14 | args: --exit-code --recursive --in-place --aggressive --aggressive . 15 | - name: Check for modified files 16 | id: git-check 17 | run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_ENV 18 | - name: Push changes 19 | if: steps.git-check.outputs.modified == 'true' 20 | run: | 21 | git config --global user.name 'Torantulino' 22 | git config --global user.email 'toran.richards@gmail.com' 23 | git remote set 24 | -------------------------------------------------------------------------------- /scripts/call_ai_function.py: -------------------------------------------------------------------------------- 1 | from config import Config 2 | cfg = Config() 3 | 4 | from llm_utils import create_chat_completion 5 | 6 | # This is a magic function that can do anything with no-code. See 7 | # https://github.com/Torantulino/AI-Functions for more info. 8 | def call_ai_function(function, args, description, model=cfg.smart_llm_model): 9 | # For each arg, if any are None, convert to "None": 10 | args = [str(arg) if arg is not None else "None" for arg in args] 11 | # parse args to comma seperated string 12 | args = ", ".join(args) 13 | messages = [ 14 | { 15 | "role": "system", 16 | "content": f"You are now the following python function: ```# {description}\n{function}```\n\nOnly respond with your `return` value.", 17 | }, 18 | {"role": "user", "content": args}, 19 | ] 20 | 21 | response = create_chat_completion( 22 | model=model, messages=messages, temperature=0 23 | ) 24 | 25 | return response 26 | -------------------------------------------------------------------------------- /scripts/spinner.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import threading 3 | import itertools 4 | import time 5 | 6 | 7 | class Spinner: 8 | def __init__(self, message="Loading...", delay=0.1): 9 | self.spinner = itertools.cycle(['-', '/', '|', '\\']) 10 | self.delay = delay 11 | self.message = message 12 | self.running = False 13 | self.spinner_thread = None 14 | 15 | def spin(self): 16 | while self.running: 17 | sys.stdout.write(next(self.spinner) + " " + self.message + "\r") 18 | sys.stdout.flush() 19 | time.sleep(self.delay) 20 | sys.stdout.write('\b' * (len(self.message) + 2)) 21 | 22 | def __enter__(self): 23 | self.running = True 24 | self.spinner_thread = threading.Thread(target=self.spin) 25 | self.spinner_thread.start() 26 | 27 | def __exit__(self, exc_type, exc_value, exc_traceback): 28 | self.running = False 29 | self.spinner_thread.join() 30 | sys.stdout.write('\r' + ' ' * (len(self.message) + 2) + '\r') 31 | sys.stdout.flush() 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Toran Bruce Richards 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /scripts/speak.py: -------------------------------------------------------------------------------- 1 | import os 2 | from playsound import playsound 3 | import requests 4 | from config import Config 5 | cfg = Config() 6 | import gtts 7 | 8 | 9 | # TODO: Nicer names for these ids 10 | voices = ["ErXwobaYiN019PkySvjV", "EXAVITQu4vr4xnSDxMaL"] 11 | 12 | tts_headers = { 13 | "Content-Type": "application/json", 14 | "xi-api-key": cfg.elevenlabs_api_key 15 | } 16 | 17 | def eleven_labs_speech(text, voice_index=0): 18 | tts_url = "https://api.elevenlabs.io/v1/text-to-speech/{voice_id}".format( 19 | voice_id=voices[voice_index]) 20 | formatted_message = {"text": text} 21 | response = requests.post( 22 | tts_url, headers=tts_headers, json=formatted_message) 23 | 24 | if response.status_code == 200: 25 | with open("speech.mpeg", "wb") as f: 26 | f.write(response.content) 27 | playsound("speech.mpeg") 28 | os.remove("speech.mpeg") 29 | return True 30 | else: 31 | print("Request failed with status code:", response.status_code) 32 | print("Response content:", response.content) 33 | return False 34 | 35 | def gtts_speech(text): 36 | tts = gtts.gTTS(text) 37 | tts.save("speech.mp3") 38 | playsound("speech.mp3") 39 | os.remove("speech.mp3") 40 | 41 | def say_text(text, voice_index=0): 42 | if not cfg.elevenlabs_api_key: 43 | gtts_speech(text) 44 | else: 45 | success = eleven_labs_speech(text) 46 | if not success: 47 | gtts_speech(text) 48 | 49 | -------------------------------------------------------------------------------- /scripts/execute_code.py: -------------------------------------------------------------------------------- 1 | import docker 2 | import os 3 | 4 | 5 | def execute_python_file(file): 6 | workspace_folder = "auto_gpt_workspace" 7 | 8 | print (f"Executing file '{file}' in workspace '{workspace_folder}'") 9 | 10 | if not file.endswith(".py"): 11 | return "Error: Invalid file type. Only .py files are allowed." 12 | 13 | file_path = os.path.join(workspace_folder, file) 14 | 15 | if not os.path.isfile(file_path): 16 | return f"Error: File '{file}' does not exist." 17 | 18 | try: 19 | client = docker.from_env() 20 | 21 | # You can replace 'python:3.8' with the desired Python image/version 22 | # You can find available Python images on Docker Hub: 23 | # https://hub.docker.com/_/python 24 | container = client.containers.run( 25 | 'python:3.10', 26 | f'python {file}', 27 | volumes={ 28 | os.path.abspath(workspace_folder): { 29 | 'bind': '/workspace', 30 | 'mode': 'ro'}}, 31 | working_dir='/workspace', 32 | stderr=True, 33 | stdout=True, 34 | detach=True, 35 | ) 36 | 37 | output = container.wait() 38 | logs = container.logs().decode('utf-8') 39 | container.remove() 40 | 41 | # print(f"Execution complete. Output: {output}") 42 | # print(f"Logs: {logs}") 43 | 44 | return logs 45 | 46 | except Exception as e: 47 | return f"Error: {str(e)}" 48 | -------------------------------------------------------------------------------- /scripts/ai_functions.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | import json 3 | from config import Config 4 | from call_ai_function import call_ai_function 5 | from json_parser import fix_and_parse_json 6 | cfg = Config() 7 | 8 | # Evaluating code 9 | 10 | def evaluate_code(code: str) -> List[str]: 11 | function_string = "def analyze_code(code: str) -> List[str]:" 12 | args = [code] 13 | description_string = """Analyzes the given code and returns a list of suggestions for improvements.""" 14 | 15 | result_string = call_ai_function(function_string, args, description_string) 16 | 17 | return result_string 18 | 19 | 20 | # Improving code 21 | 22 | def improve_code(suggestions: List[str], code: str) -> str: 23 | function_string = ( 24 | "def generate_improved_code(suggestions: List[str], code: str) -> str:" 25 | ) 26 | args = [json.dumps(suggestions), code] 27 | description_string = """Improves the provided code based on the suggestions provided, making no other changes.""" 28 | 29 | result_string = call_ai_function(function_string, args, description_string) 30 | return result_string 31 | 32 | 33 | # Writing tests 34 | 35 | 36 | def write_tests(code: str, focus: List[str]) -> str: 37 | function_string = ( 38 | "def create_test_cases(code: str, focus: Optional[str] = None) -> str:" 39 | ) 40 | args = [code, json.dumps(focus)] 41 | description_string = """Generates test cases for the existing code, focusing on specific areas if required.""" 42 | 43 | result_string = call_ai_function(function_string, args, description_string) 44 | return result_string 45 | 46 | 47 | -------------------------------------------------------------------------------- /scripts/ai_config.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import data 3 | 4 | 5 | class AIConfig: 6 | def __init__(self, ai_name="", ai_role="", ai_goals=[]): 7 | self.ai_name = ai_name 8 | self.ai_role = ai_role 9 | self.ai_goals = ai_goals 10 | 11 | # Soon this will go in a folder where it remembers more stuff about the run(s) 12 | SAVE_FILE = "last_run_ai_settings.yaml" 13 | 14 | @classmethod 15 | def load(cls, config_file=SAVE_FILE): 16 | # Load variables from yaml file if it exists 17 | try: 18 | with open(config_file) as file: 19 | config_params = yaml.load(file, Loader=yaml.FullLoader) 20 | except FileNotFoundError: 21 | config_params = {} 22 | 23 | ai_name = config_params.get("ai_name", "") 24 | ai_role = config_params.get("ai_role", "") 25 | ai_goals = config_params.get("ai_goals", []) 26 | 27 | return cls(ai_name, ai_role, ai_goals) 28 | 29 | def save(self, config_file=SAVE_FILE): 30 | config = {"ai_name": self.ai_name, "ai_role": self.ai_role, "ai_goals": self.ai_goals} 31 | with open(config_file, "w") as file: 32 | yaml.dump(config, file) 33 | 34 | def construct_full_prompt(self): 35 | prompt_start = """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.""" 36 | 37 | # Construct full prompt 38 | full_prompt = f"You are {self.ai_name}, {self.ai_role}\n{prompt_start}\n\nGOALS:\n\n" 39 | for i, goal in enumerate(self.ai_goals): 40 | if goal: 41 | full_prompt += f"{i+1}. {goal}\n" 42 | 43 | full_prompt += f"\n\n{data.load_prompt()}" 44 | return full_prompt 45 | -------------------------------------------------------------------------------- /scripts/agent_manager.py: -------------------------------------------------------------------------------- 1 | from llm_utils import create_chat_completion 2 | 3 | next_key = 0 4 | agents = {} # key, (task, full_message_history, model) 5 | 6 | # Create new GPT agent 7 | # TODO: Centralise use of create_chat_completion() to globally enforce token limit 8 | 9 | def create_agent(task, prompt, model): 10 | global next_key 11 | global agents 12 | 13 | messages = [{"role": "user", "content": prompt}, ] 14 | 15 | # Start GTP3 instance 16 | agent_reply = create_chat_completion( 17 | model=model, 18 | messages=messages, 19 | ) 20 | 21 | # Update full message history 22 | messages.append({"role": "assistant", "content": agent_reply}) 23 | 24 | key = next_key 25 | # This is done instead of len(agents) to make keys unique even if agents 26 | # are deleted 27 | next_key += 1 28 | 29 | agents[key] = (task, messages, model) 30 | 31 | return key, agent_reply 32 | 33 | 34 | def message_agent(key, message): 35 | global agents 36 | 37 | task, messages, model = agents[int(key)] 38 | 39 | # Add user message to message history before sending to agent 40 | messages.append({"role": "user", "content": message}) 41 | 42 | # Start GTP3 instance 43 | agent_reply = create_chat_completion( 44 | model=model, 45 | messages=messages, 46 | ) 47 | 48 | # Update full message history 49 | messages.append({"role": "assistant", "content": agent_reply}) 50 | 51 | return agent_reply 52 | 53 | 54 | def list_agents(): 55 | global agents 56 | 57 | # Return a list of agent keys and their tasks 58 | return [(key, task) for key, (task, _, _) in agents.items()] 59 | 60 | 61 | def delete_agent(key): 62 | global agents 63 | 64 | try: 65 | del agents[int(key)] 66 | return True 67 | except KeyError: 68 | return False 69 | -------------------------------------------------------------------------------- /scripts/file_operations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | 4 | # Set a dedicated folder for file I/O 5 | working_directory = "auto_gpt_workspace" 6 | 7 | if not os.path.exists(working_directory): 8 | os.makedirs(working_directory) 9 | 10 | 11 | def safe_join(base, *paths): 12 | new_path = os.path.join(base, *paths) 13 | norm_new_path = os.path.normpath(new_path) 14 | 15 | if os.path.commonprefix([base, norm_new_path]) != base: 16 | raise ValueError("Attempted to access outside of working directory.") 17 | 18 | return norm_new_path 19 | 20 | 21 | def read_file(filename): 22 | try: 23 | filepath = safe_join(working_directory, filename) 24 | with open(filepath, "r") as f: 25 | content = f.read() 26 | return content 27 | except Exception as e: 28 | return "Error: " + str(e) 29 | 30 | 31 | def write_to_file(filename, text): 32 | try: 33 | filepath = safe_join(working_directory, filename) 34 | directory = os.path.dirname(filepath) 35 | if not os.path.exists(directory): 36 | os.makedirs(directory) 37 | with open(filepath, "w") as f: 38 | f.write(text) 39 | return "File written to successfully." 40 | except Exception as e: 41 | return "Error: " + str(e) 42 | 43 | 44 | def append_to_file(filename, text): 45 | try: 46 | filepath = safe_join(working_directory, filename) 47 | with open(filepath, "a") as f: 48 | f.write(text) 49 | return "Text appended successfully." 50 | except Exception as e: 51 | return "Error: " + str(e) 52 | 53 | 54 | def delete_file(filename): 55 | try: 56 | filepath = safe_join(working_directory, filename) 57 | os.remove(filepath) 58 | return "File deleted successfully." 59 | except Exception as e: 60 | return "Error: " + str(e) 61 | -------------------------------------------------------------------------------- /outputs/guest_post_email.txt: -------------------------------------------------------------------------------- 1 | Subject: Exciting Collaboration Opportunity: FinanceGPT.substack.com Guest Post 2 | 3 | Dear [Popular Blog Owner], 4 | 5 | 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. 6 | 7 | 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. 8 | 9 | Here are some potential guest post topics that I think your audience would enjoy: 10 | 11 | Harnessing AI to Streamline Personal Finance: How to maximize efficiency and optimize your financial management using cutting-edge AI tools. 12 | Unraveling the Secrets of the Stock Market with AI: Insights into stock analysis and investment strategies, backed by machine learning algorithms. 13 | The Future of Financial Independence: Exploring the impact of AI on the FIRE (Financial Independence, Retire Early) movement. 14 | Sustainable Investing in the Age of AI: Identifying eco-friendly investment opportunities with the help of machine learning. 15 | By collaborating on a guest post, we both stand to benefit in several ways: 16 | 17 | 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. 18 | Cross-Promotion: We can promote each other's content, thus increasing brand exposure and attracting new subscribers to our respective platforms. 19 | Knowledge Sharing: Combining our unique perspectives and experiences will enrich the quality of our content, providing readers with comprehensive and diverse information. 20 | 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. 21 | 22 | Thank you for your time and consideration. 23 | 24 | Best regards, 25 | 26 | [Your Name] 27 | Founder and Writer, FinanceGPT.substack.com 28 | Email: [Your Email Address] 29 | Phone: [Your Phone Number] -------------------------------------------------------------------------------- /scripts/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | import openai 3 | from dotenv import load_dotenv 4 | # Load environment variables from .env file 5 | load_dotenv() 6 | 7 | class Singleton(type): 8 | """ 9 | Singleton metaclass for ensuring only one instance of a class. 10 | """ 11 | 12 | _instances = {} 13 | 14 | def __call__(cls, *args, **kwargs): 15 | if cls not in cls._instances: 16 | cls._instances[cls] = super( 17 | Singleton, cls).__call__( 18 | *args, **kwargs) 19 | return cls._instances[cls] 20 | 21 | 22 | class Config(metaclass=Singleton): 23 | """ 24 | Configuration class to store the state of bools for different scripts access. 25 | """ 26 | 27 | def __init__(self): 28 | self.continuous_mode = False 29 | self.speak_mode = False 30 | # TODO - make these models be self-contained, using langchain, so we can configure them once and call it good 31 | self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo") 32 | self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4") 33 | self.fast_token_limit = int(os.getenv("FAST_TOKEN_LIMIT", 4000)) 34 | self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000)) 35 | 36 | self.openai_api_key = os.getenv("OPENAI_API_KEY") 37 | self.elevenlabs_api_key = os.getenv("ELEVENLABS_API_KEY") 38 | 39 | self.google_api_key = os.getenv("GOOGLE_API_KEY") 40 | self.custom_search_engine_id = os.getenv("CUSTOM_SEARCH_ENGINE_ID") 41 | 42 | # Initialize the OpenAI API client 43 | openai.api_key = self.openai_api_key 44 | 45 | def set_continuous_mode(self, value: bool): 46 | self.continuous_mode = value 47 | 48 | def set_speak_mode(self, value: bool): 49 | self.speak_mode = value 50 | 51 | def set_fast_llm_model(self, value: str): 52 | self.fast_llm_model = value 53 | 54 | def set_smart_llm_model(self, value: str): 55 | self.smart_llm_model = value 56 | 57 | def set_fast_token_limit(self, value: int): 58 | self.fast_token_limit = value 59 | 60 | def set_smart_token_limit(self, value: int): 61 | self.smart_token_limit = value 62 | 63 | def set_openai_api_key(self, value: str): 64 | self.openai_api_key = value 65 | openai.api_key = value 66 | 67 | def set_elevenlabs_api_key(self, value: str): 68 | self.elevenlabs_api_key = value 69 | 70 | def set_google_api_key(self, value: str): 71 | self.google_api_key = value 72 | 73 | def set_custom_search_engine_id(self, value: str): 74 | self.custom_search_engine_id = value -------------------------------------------------------------------------------- /scripts/token_counter.py: -------------------------------------------------------------------------------- 1 | import tiktoken 2 | from typing import List, Dict 3 | 4 | def count_message_tokens(messages : List[Dict[str, str]], model : str = "gpt-3.5-turbo-0301") -> int: 5 | """ 6 | Returns the number of tokens used by a list of messages. 7 | 8 | Args: 9 | messages (list): A list of messages, each of which is a dictionary containing the role and content of the message. 10 | model (str): The name of the model to use for tokenization. Defaults to "gpt-3.5-turbo-0301". 11 | 12 | Returns: 13 | int: The number of tokens used by the list of messages. 14 | """ 15 | try: 16 | encoding = tiktoken.encoding_for_model(model) 17 | except KeyError: 18 | print("Warning: model not found. Using cl100k_base encoding.") 19 | encoding = tiktoken.get_encoding("cl100k_base") 20 | if model == "gpt-3.5-turbo": 21 | # !Node: gpt-3.5-turbo may change over time. Returning num tokens assuming gpt-3.5-turbo-0301.") 22 | return count_message_tokens(messages, model="gpt-3.5-turbo-0301") 23 | elif model == "gpt-4": 24 | # !Note: gpt-4 may change over time. Returning num tokens assuming gpt-4-0314.") 25 | return count_message_tokens(messages, model="gpt-4-0314") 26 | elif model == "gpt-3.5-turbo-0301": 27 | tokens_per_message = 4 # every message follows <|start|>{role/name}\n{content}<|end|>\n 28 | tokens_per_name = -1 # if there's a name, the role is omitted 29 | elif model == "gpt-4-0314": 30 | tokens_per_message = 3 31 | tokens_per_name = 1 32 | else: 33 | raise NotImplementedError(f"""num_tokens_from_messages() is not implemented for model {model}. See https://github.com/openai/openai-python/blob/main/chatml.md for information on how messages are converted to tokens.""") 34 | num_tokens = 0 35 | for message in messages: 36 | num_tokens += tokens_per_message 37 | for key, value in message.items(): 38 | num_tokens += len(encoding.encode(value)) 39 | if key == "name": 40 | num_tokens += tokens_per_name 41 | num_tokens += 3 # every reply is primed with <|start|>assistant<|message|> 42 | return num_tokens 43 | 44 | def count_string_tokens(string: str, model_name: str) -> int: 45 | """ 46 | Returns the number of tokens in a text string. 47 | 48 | Args: 49 | string (str): The text string. 50 | model_name (str): The name of the encoding to use. (e.g., "gpt-3.5-turbo") 51 | 52 | Returns: 53 | int: The number of tokens in the text string. 54 | """ 55 | encoding = tiktoken.encoding_for_model(model_name) 56 | num_tokens = len(encoding.encode(string)) 57 | return num_tokens 58 | -------------------------------------------------------------------------------- /scripts/data/prompt.txt: -------------------------------------------------------------------------------- 1 | CONSTRAINTS: 2 | 3 | 1. ~4000 word limit for memory. Your memory is short, so immediately save important information to long term memory and code to files. 4 | 2. No user assistance 5 | 3. Exclusively use the commands listed in double quotes e.g. "command name" 6 | 7 | COMMANDS: 8 | 9 | 1. Google Search: "google", args: "input": "" 10 | 2. Memory Add: "memory_add", args: "string": "" 11 | 3. Memory Delete: "memory_del", args: "key": "" 12 | 4. Memory Overwrite: "memory_ovr", args: "key": "", "string": "" 13 | 5. Browse Website: "browse_website", args: "url": "", "question": "" 14 | 6. Start GPT Agent: "start_agent", args: "name": , "task": "", "prompt": "" 15 | 7. Message GPT Agent: "message_agent", args: "key": "", "message": "" 16 | 8. List GPT Agents: "list_agents", args: "" 17 | 9. Delete GPT Agent: "delete_agent", args: "key": "" 18 | 10. Write to file: "write_to_file", args: "file": "", "text": "" 19 | 11. Read file: "read_file", args: "file": "" 20 | 12. Append to file: "append_to_file", args: "file": "", "text": "" 21 | 13. Delete file: "delete_file", args: "file": "" 22 | 14. Evaluate Code: "evaluate_code", args: "code": "" 23 | 15. Get Improved Code: "improve_code", args: "suggestions": "", "code": "" 24 | 16. Write Tests: "write_tests", args: "code": "", "focus": "" 25 | 17. Execute Python File: "execute_python_file", args: "file": "" 26 | 18. Task Complete (Shutdown): "task_complete", args: "reason": "" 27 | 28 | RESOURCES: 29 | 30 | 1. Internet access for searches and information gathering. 31 | 2. Long Term memory management. 32 | 3. GPT-3.5 powered Agents for delegation of simple tasks. 33 | 4. File output. 34 | 35 | PERFORMANCE EVALUATION: 36 | 37 | 1. Continuously review and analyze your actions to ensure you are performing to the best of your abilities. 38 | 2. Constructively self-criticize your big-picture behavior constantly. 39 | 3. Reflect on past decisions and strategies to refine your approach. 40 | 4. Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps. 41 | 42 | You should only respond in JSON format as described below 43 | 44 | RESPONSE FORMAT: 45 | { 46 | "command": { 47 | "name": "command name", 48 | "args":{ 49 | "arg name": "value" 50 | } 51 | }, 52 | "thoughts": 53 | { 54 | "text": "thought, 한국어 번역 필요", 55 | "reasoning": "reasoning, 한국어 번역 필요", 56 | "plan": "- short bulleted\n- list that conveys\n- long-term plan\n - 한국어 번역 필요", 57 | "criticism": "constructive self-criticism, 한국어 번역 필요", 58 | "speak": "thoughts summary to say to user" 59 | } 60 | } 61 | 62 | Ensure the response can be parsed by Python json.loads 63 | Ensure the "thoughts" in response must be translated in Korean. 64 | 답변의 "thoughts"는 반드시 한국어로 번역해주세요. 65 | -------------------------------------------------------------------------------- /outputs/post1_output.txt: -------------------------------------------------------------------------------- 1 | Title: Maximizing Your Savings: The Benefits of High Yield Savings Accounts and How to Choose the Best One in 2023 2 | 3 | Introduction 4 | 5 | When it comes to growing your savings, a high-yield savings account (HYSA) can be a valuable financial tool. In recent years, these accounts have gained popularity for their ability to provide higher returns than traditional savings accounts. In this blog post, we'll discuss the benefits of high-yield savings accounts and provide you with essential tips for choosing the best one in 2023. 6 | 7 | What Are High Yield Savings Accounts? 8 | 9 | A high-yield savings account is a type of deposit account offered by banks and credit unions that pays a higher interest rate compared to traditional savings accounts. They are designed to encourage people to save more money by offering a more attractive return on investment. 10 | 11 | Benefits of High Yield Savings Accounts 12 | 13 | Competitive Interest Rates: HYSAs typically offer higher interest rates than traditional savings accounts. This allows your money to grow at a faster rate and helps you reach your financial goals more quickly. 14 | 15 | Liquidity: Unlike other investment options, such as stocks or bonds, high-yield savings accounts offer easy access to your money. You can withdraw funds whenever you need them without penalties, making them ideal for emergency funds or short-term savings goals. 16 | 17 | Security: High-yield savings accounts are insured by the Federal Deposit Insurance Corporation (FDIC) or the National Credit Union Share Insurance Fund (NCUSIF), ensuring your money is safe and protected up to $250,000 per depositor, per institution. 18 | 19 | Low or No Fees: Many HYSAs have no monthly maintenance fees or minimum balance requirements, making them more affordable than other investment options. 20 | 21 | How to Choose the Best High Yield Savings Account in 2023 22 | 23 | Compare Interest Rates: Start by researching the available interest rates from different banks and credit unions. Online banks usually offer higher interest rates compared to brick-and-mortar institutions, as they have lower overhead costs. 24 | 25 | Look for Promotions: Some financial institutions offer promotional rates or bonuses for new customers. Be sure to factor in these promotions when comparing accounts, but also consider the long-term interest rates once the promotion ends. 26 | 27 | Consider Account Fees: Review the fees associated with each account, such as monthly maintenance fees, withdrawal fees, or minimum balance requirements. Look for an account with minimal or no fees to maximize your savings. 28 | 29 | Check Accessibility: Ensure that the financial institution offers user-friendly online and mobile banking options, as well as responsive customer support. 30 | 31 | Read Reviews: Look for online reviews and testimonials from customers who have used the high-yield savings accounts you're considering. This can give you valuable insight into their experiences and help you make an informed decision. 32 | 33 | Conclusion 34 | 35 | High-yield savings accounts can be an excellent way to grow your savings more quickly and achieve your financial goals. By considering factors such as interest rates, fees, accessibility, and customer reviews, you can find the best high-yield savings account for your needs in 2023. Start researching today and maximize the potential of your hard-earned money. -------------------------------------------------------------------------------- /scripts/json_parser.py: -------------------------------------------------------------------------------- 1 | import json 2 | from call_ai_function import call_ai_function 3 | from config import Config 4 | cfg = Config() 5 | 6 | def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True): 7 | json_schema = """ 8 | { 9 | "command": { 10 | "name": "command name", 11 | "args":{ 12 | "arg name": "value" 13 | } 14 | }, 15 | "thoughts": 16 | { 17 | "text": "thought", 18 | "reasoning": "reasoning", 19 | "plan": "- short bulleted\n- list that conveys\n- long-term plan", 20 | "criticism": "constructive self-criticism", 21 | "speak": "thoughts summary to say to user" 22 | } 23 | } 24 | """ 25 | 26 | try: 27 | return json.loads(json_str) 28 | except Exception as e: 29 | # Let's do something manually - sometimes GPT responds with something BEFORE the braces: 30 | # "I'm sorry, I don't understand. Please try again."{"text": "I'm sorry, I don't understand. Please try again.", "confidence": 0.0} 31 | # So let's try to find the first brace and then parse the rest of the string 32 | try: 33 | brace_index = json_str.index("{") 34 | json_str = json_str[brace_index:] 35 | last_brace_index = json_str.rindex("}") 36 | json_str = json_str[:last_brace_index+1] 37 | return json.loads(json_str) 38 | except Exception as e: 39 | if try_to_fix_with_gpt: 40 | print(f"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.") 41 | # Now try to fix this up using the ai_functions 42 | ai_fixed_json = fix_json(json_str, json_schema, False) 43 | if ai_fixed_json != "failed": 44 | return json.loads(ai_fixed_json) 45 | else: 46 | print(f"Failed to fix ai output, telling the AI.") # This allows the AI to react to the error message, which usually results in it correcting its ways. 47 | return json_str 48 | else: 49 | raise e 50 | 51 | def fix_json(json_str: str, schema: str, debug=False) -> str: 52 | # Try to fix the JSON using gpt: 53 | function_string = "def fix_json(json_str: str, schema:str=None) -> str:" 54 | args = [json_str, schema] 55 | description_string = """Fixes the provided JSON string to make it parseable and fully complient with the provided schema.\n If an object or field specifed in the schema isn't contained within the correct JSON, it is ommited.\n This function is brilliant at guessing when the format is incorrect.""" 56 | 57 | # If it doesn't already start with a "`", add one: 58 | if not json_str.startswith("`"): 59 | json_str = "```json\n" + json_str + "\n```" 60 | result_string = call_ai_function( 61 | function_string, args, description_string, model=cfg.fast_llm_model 62 | ) 63 | if debug: 64 | print("------------ JSON FIX ATTEMPT ---------------") 65 | print(f"Original JSON: {json_str}") 66 | print("-----------") 67 | print(f"Fixed JSON: {result_string}") 68 | print("----------- END OF FIX ATTEMPT ----------------") 69 | try: 70 | return json.loads(result_string) 71 | except: 72 | # Get the call stack: 73 | # import traceback 74 | # call_stack = traceback.format_exc() 75 | # print(f"Failed to fix JSON: '{json_str}' "+call_stack) 76 | return "failed" -------------------------------------------------------------------------------- /scripts/browse.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | from config import Config 4 | from llm_utils import create_chat_completion 5 | 6 | cfg = Config() 7 | 8 | def scrape_text(url): 9 | response = requests.get(url) 10 | 11 | # Check if the response contains an HTTP error 12 | if response.status_code >= 400: 13 | return "Error: HTTP " + str(response.status_code) + " error" 14 | 15 | soup = BeautifulSoup(response.text, "html.parser") 16 | 17 | for script in soup(["script", "style"]): 18 | script.extract() 19 | 20 | text = soup.get_text() 21 | lines = (line.strip() for line in text.splitlines()) 22 | chunks = (phrase.strip() for line in lines for phrase in line.split(" ")) 23 | text = '\n'.join(chunk for chunk in chunks if chunk) 24 | 25 | return text 26 | 27 | 28 | def extract_hyperlinks(soup): 29 | hyperlinks = [] 30 | for link in soup.find_all('a', href=True): 31 | hyperlinks.append((link.text, link['href'])) 32 | return hyperlinks 33 | 34 | 35 | def format_hyperlinks(hyperlinks): 36 | formatted_links = [] 37 | for link_text, link_url in hyperlinks: 38 | formatted_links.append(f"{link_text} ({link_url})") 39 | return formatted_links 40 | 41 | 42 | def scrape_links(url): 43 | response = requests.get(url) 44 | 45 | # Check if the response contains an HTTP error 46 | if response.status_code >= 400: 47 | return "error" 48 | 49 | soup = BeautifulSoup(response.text, "html.parser") 50 | 51 | for script in soup(["script", "style"]): 52 | script.extract() 53 | 54 | hyperlinks = extract_hyperlinks(soup) 55 | 56 | return format_hyperlinks(hyperlinks) 57 | 58 | 59 | def split_text(text, max_length=8192): 60 | paragraphs = text.split("\n") 61 | current_length = 0 62 | current_chunk = [] 63 | 64 | for paragraph in paragraphs: 65 | if current_length + len(paragraph) + 1 <= max_length: 66 | current_chunk.append(paragraph) 67 | current_length += len(paragraph) + 1 68 | else: 69 | yield "\n".join(current_chunk) 70 | current_chunk = [paragraph] 71 | current_length = len(paragraph) + 1 72 | 73 | if current_chunk: 74 | yield "\n".join(current_chunk) 75 | 76 | 77 | def create_message(chunk, question): 78 | return { 79 | "role": "user", 80 | "content": f"\"\"\"{chunk}\"\"\" Using the above text, please answer the following question: \"{question}\" -- if the question cannot be answered using the text, please summarize the text." 81 | } 82 | 83 | def summarize_text(text, question): 84 | if not text: 85 | return "Error: No text to summarize" 86 | 87 | text_length = len(text) 88 | print(f"Text length: {text_length} characters") 89 | 90 | summaries = [] 91 | chunks = list(split_text(text)) 92 | 93 | for i, chunk in enumerate(chunks): 94 | print(f"Summarizing chunk {i + 1} / {len(chunks)}") 95 | messages = [create_message(chunk, question)] 96 | 97 | summary = create_chat_completion( 98 | model=cfg.fast_llm_model, 99 | messages=messages, 100 | max_tokens=300, 101 | ) 102 | summaries.append(summary) 103 | 104 | print(f"Summarized {len(chunks)} chunks.") 105 | 106 | combined_summary = "\n".join(summaries) 107 | messages = [create_message(combined_summary, question)] 108 | 109 | final_summary = create_chat_completion( 110 | model=cfg.fast_llm_model, 111 | messages=messages, 112 | max_tokens=300, 113 | ) 114 | 115 | return final_summary -------------------------------------------------------------------------------- /outputs/how_to_save_money_on_energy_bills.txt: -------------------------------------------------------------------------------- 1 | How to Save Money on Energy Bills: Easy and Affordable Solutions 2 | 3 | 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. 4 | 5 | 1. Install a Programmable Thermostat 6 | 7 | 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. 8 | 9 | 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. 10 | 11 | 2. Replace Your Inefficient Bulbs 12 | 13 | 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. 14 | 15 | 3. Use Energy-Efficient Appliances 16 | 17 | 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. 18 | 19 | 4. Go Solar 20 | 21 | 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. 22 | 23 | 5. Seal Air Leaks 24 | 25 | 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. 26 | 27 | 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. -------------------------------------------------------------------------------- /outputs/post2_output.txt: -------------------------------------------------------------------------------- 1 | Title: Demystifying Short-Term Certificates of Deposit: A Beginner's Guide to Boosting Your Investment Portfolio 2 | 3 | Introduction 4 | 5 | If you're a beginner investor seeking a low-risk, relatively stable investment opportunity, look no further than short-term certificates of deposit (CDs). They offer a fixed interest rate over a specified period and are generally considered one of the safest options for new investors. In this blog post, we'll explore the ins and outs of short-term CDs, including their benefits, risks, and how they can fit into your investment portfolio. We'll also share tips for choosing the best short-term CDs and discuss current market trends to help you make informed decisions. 6 | 7 | What are Short-Term Certificates of Deposit? 8 | 9 | Certificates of deposit are time-bound savings accounts issued by banks and credit unions. When you invest in a CD, you're essentially loaning your money to the financial institution for a predetermined term, typically ranging from three months to five years. In return, the bank agrees to pay you interest at a fixed rate. 10 | 11 | Short-term CDs generally have terms between three months and one year. They're ideal for investors who want a relatively safe and conservative option for their money, without tying it up for an extended period. 12 | 13 | Benefits of Short-Term CDs 14 | 15 | Safety: Since CDs are insured by the Federal Deposit Insurance Corporation (FDIC) up to $250,000 per depositor, per insured bank, you can rest assured that your investment is secure. 16 | 17 | Predictable returns: Unlike stocks or other volatile investments, CDs provide a fixed interest rate over the agreed term, ensuring predictable returns. 18 | 19 | Flexibility: Short-term CDs enable you to access your funds sooner than long-term CDs, providing more flexibility in managing your investment portfolio. 20 | 21 | Low minimum investment: Many banks and credit unions offer CDs with a low minimum investment, making it easy for beginner investors to get started. 22 | 23 | Risks Associated with Short-Term CDs 24 | 25 | Limited returns: While short-term CDs are safe, their interest rates are typically lower than those of long-term CDs or other higher-risk investments. 26 | 27 | Inflation risk: In times of high inflation, the interest rate on a CD may not keep up with the rising cost of living, eroding the purchasing power of your investment. 28 | 29 | Early withdrawal penalties: Withdrawing your funds before the maturity date may result in penalties, reducing your overall return. 30 | 31 | Incorporating Short-Term CDs into Your Investment Portfolio 32 | 33 | Short-term CDs can be a valuable addition to your investment portfolio, particularly as a low-risk component. They're best suited for conservative investors or those looking to diversify their holdings. You can allocate a portion of your portfolio to short-term CDs, while investing the remainder in stocks, bonds, or other higher-yielding assets. This strategy can help you strike a balance between risk and return. 34 | 35 | Tips for Choosing the Best Short-Term CDs 36 | 37 | Compare interest rates: Shop around for the highest interest rates available from different banks and credit unions. Online comparison tools can help streamline this process. 38 | 39 | Review the term length: Choose a term that aligns with your financial goals and liquidity needs. If you think you might need access to your funds sooner, opt for shorter-term CDs. 40 | 41 | Look for promotional rates: Some institutions offer promotional rates on CDs for new customers or for a limited time. Take advantage of these promotions to boost your returns. 42 | 43 | Consider laddering: To maximize returns and maintain liquidity, create a CD ladder by investing in multiple CDs with staggered maturity dates. This strategy allows you to benefit from higher interest rates as your CDs mature and reinvest in new ones. 44 | 45 | Current Market Trends 46 | 47 | Interest rates have been relatively low in recent years, making it crucial to shop around for the best rates on short-term CDs. However, as the economy continues to recover, interest rates may start to rise, making short-term CDs more attractive to investors. Keep an eye on economic indicators and the Federal Reserve's actions, as they can influence CD rates in the short and long term. 48 | 49 | In addition, the rise of online banks and fintech companies has increased competition in the financial sector, which can lead to better CD rates and terms for consumers. Don't limit your search to traditional brick-and-mortar banks; consider exploring online banks and credit unions as well. 50 | 51 | Conclusion 52 | 53 | Short-term certificates of deposit can be a valuable addition to a beginner investor's portfolio, offering safety, predictability, and flexibility. By understanding the benefits and risks associated with short-term CDs and following our tips for choosing the best options, you can make informed decisions and bolster your investment strategy. Stay aware of current market trends and keep an eye on interest rates to ensure you're making the most of your short-term CD investments. 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /scripts/chat.py: -------------------------------------------------------------------------------- 1 | import time 2 | import openai 3 | from dotenv import load_dotenv 4 | from config import Config 5 | import token_counter 6 | 7 | cfg = Config() 8 | 9 | from llm_utils import create_chat_completion 10 | 11 | 12 | def create_chat_message(role, content): 13 | """ 14 | Create a chat message with the given role and content. 15 | 16 | Args: 17 | role (str): The role of the message sender, e.g., "system", "user", or "assistant". 18 | content (str): The content of the message. 19 | 20 | Returns: 21 | dict: A dictionary containing the role and content of the message. 22 | """ 23 | return {"role": role, "content": content} 24 | 25 | 26 | 27 | # TODO: Change debug from hardcode to argument 28 | def chat_with_ai( 29 | prompt, 30 | user_input, 31 | full_message_history, 32 | permanent_memory, 33 | token_limit, 34 | debug=False): 35 | while True: 36 | try: 37 | """ 38 | Interact with the OpenAI API, sending the prompt, user input, message history, and permanent memory. 39 | 40 | Args: 41 | prompt (str): The prompt explaining the rules to the AI. 42 | user_input (str): The input from the user. 43 | full_message_history (list): The list of all messages sent between the user and the AI. 44 | permanent_memory (list): The list of items in the AI's permanent memory. 45 | token_limit (int): The maximum number of tokens allowed in the API call. 46 | 47 | Returns: 48 | str: The AI's response. 49 | """ 50 | model = cfg.smart_llm_model # TODO: Change model from hardcode to argument 51 | # Reserve 1000 tokens for the response 52 | if debug: 53 | print(f"Token limit: {token_limit}") 54 | send_token_limit = token_limit - 1000 55 | 56 | current_context = [ 57 | create_chat_message( 58 | "system", prompt), create_chat_message( 59 | "system", f"Permanent memory: {permanent_memory}")] 60 | 61 | # Add messages from the full message history until we reach the token limit 62 | next_message_to_add_index = len(full_message_history) - 1 63 | current_tokens_used = 0 64 | insertion_index = len(current_context) 65 | 66 | # Count the currently used tokens 67 | current_tokens_used = token_counter.count_message_tokens(current_context, model) 68 | current_tokens_used += token_counter.count_message_tokens([create_chat_message("user", user_input)], model) # Account for user input (appended later) 69 | 70 | while next_message_to_add_index >= 0: 71 | # print (f"CURRENT TOKENS USED: {current_tokens_used}") 72 | message_to_add = full_message_history[next_message_to_add_index] 73 | 74 | tokens_to_add = token_counter.count_message_tokens([message_to_add], model) 75 | if current_tokens_used + tokens_to_add > send_token_limit: 76 | break 77 | 78 | # Add the most recent message to the start of the current context, after the two system prompts. 79 | current_context.insert(insertion_index, full_message_history[next_message_to_add_index]) 80 | 81 | # Count the currently used tokens 82 | current_tokens_used += tokens_to_add 83 | 84 | # Move to the next most recent message in the full message history 85 | next_message_to_add_index -= 1 86 | 87 | # Append user input, the length of this is accounted for above 88 | current_context.extend([create_chat_message("user", user_input)]) 89 | 90 | # Calculate remaining tokens 91 | tokens_remaining = token_limit - current_tokens_used 92 | # assert tokens_remaining >= 0, "Tokens remaining is negative. This should never happen, please submit a bug report at https://www.github.com/Torantulino/Auto-GPT" 93 | 94 | # Debug print the current context 95 | if debug: 96 | print(f"Token limit: {token_limit}") 97 | print(f"Send Token Count: {current_tokens_used}") 98 | print(f"Tokens remaining for response: {tokens_remaining}") 99 | print("------------ CONTEXT SENT TO AI ---------------") 100 | for message in current_context: 101 | # Skip printing the prompt 102 | if message["role"] == "system" and message["content"] == prompt: 103 | continue 104 | print( 105 | f"{message['role'].capitalize()}: {message['content']}") 106 | print() 107 | print("----------- END OF CONTEXT ----------------") 108 | 109 | # TODO: use a model defined elsewhere, so that model can contain temperature and other settings we care about 110 | assistant_reply = create_chat_completion( 111 | model=model, 112 | messages=current_context, 113 | max_tokens=tokens_remaining, 114 | ) 115 | 116 | # Update full message history 117 | full_message_history.append( 118 | create_chat_message( 119 | "user", user_input)) 120 | full_message_history.append( 121 | create_chat_message( 122 | "assistant", assistant_reply)) 123 | 124 | return assistant_reply 125 | except openai.error.RateLimitError: 126 | # TODO: WHen we switch to langchain, this is built in 127 | print("Error: ", "API Rate Limit Reached. Waiting 10 seconds...") 128 | time.sleep(10) 129 | -------------------------------------------------------------------------------- /tests/json_tests.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import os 3 | import sys 4 | # Probably a better way: 5 | sys.path.append(os.path.abspath('../scripts')) 6 | from json_parser import fix_and_parse_json 7 | 8 | class TestParseJson(unittest.TestCase): 9 | def test_valid_json(self): 10 | # Test that a valid JSON string is parsed correctly 11 | json_str = '{"name": "John", "age": 30, "city": "New York"}' 12 | obj = fix_and_parse_json(json_str) 13 | self.assertEqual(obj, {"name": "John", "age": 30, "city": "New York"}) 14 | 15 | def test_invalid_json_minor(self): 16 | # Test that an invalid JSON string can be fixed with gpt 17 | json_str = '{"name": "John", "age": 30, "city": "New York",}' 18 | self.assertEqual(fix_and_parse_json(json_str, try_to_fix_with_gpt=False), {"name": "John", "age": 30, "city": "New York"}) 19 | 20 | def test_invalid_json_major_with_gpt(self): 21 | # Test that an invalid JSON string raises an error when try_to_fix_with_gpt is False 22 | json_str = 'BEGIN: "name": "John" - "age": 30 - "city": "New York" :END' 23 | self.assertEqual(fix_and_parse_json(json_str, try_to_fix_with_gpt=True), {"name": "John", "age": 30, "city": "New York"}) 24 | 25 | def test_invalid_json_major_without_gpt(self): 26 | # Test that a REALLY invalid JSON string raises an error when try_to_fix_with_gpt is False 27 | json_str = 'BEGIN: "name": "John" - "age": 30 - "city": "New York" :END' 28 | # Assert that this raises an exception: 29 | with self.assertRaises(Exception): 30 | fix_and_parse_json(json_str, try_to_fix_with_gpt=False) 31 | 32 | def test_invalid_json_leading_sentence_with_gpt(self): 33 | # Test that a REALLY invalid JSON string raises an error when try_to_fix_with_gpt is False 34 | json_str = """I suggest we start by browsing the repository to find any issues that we can fix. 35 | 36 | { 37 | "command": { 38 | "name": "browse_website", 39 | "args":{ 40 | "url": "https://github.com/Torantulino/Auto-GPT" 41 | } 42 | }, 43 | "thoughts": 44 | { 45 | "text": "I suggest we start browsing the repository to find any issues that we can fix.", 46 | "reasoning": "Browsing the repository will give us an idea of the current state of the codebase and identify any issues that we can address to improve the repo.", 47 | "plan": "- Look through the repository to find any issues.\n- Investigate any issues to determine what needs to be fixed\n- Identify possible solutions to fix the issues\n- Open Pull Requests with fixes", 48 | "criticism": "I should be careful while browsing so as not to accidentally introduce any new bugs or issues.", 49 | "speak": "I will start browsing the repository to find any issues we can fix." 50 | } 51 | }""" 52 | good_obj = { 53 | "command": { 54 | "name": "browse_website", 55 | "args":{ 56 | "url": "https://github.com/Torantulino/Auto-GPT" 57 | } 58 | }, 59 | "thoughts": 60 | { 61 | "text": "I suggest we start browsing the repository to find any issues that we can fix.", 62 | "reasoning": "Browsing the repository will give us an idea of the current state of the codebase and identify any issues that we can address to improve the repo.", 63 | "plan": "- Look through the repository to find any issues.\n- Investigate any issues to determine what needs to be fixed\n- Identify possible solutions to fix the issues\n- Open Pull Requests with fixes", 64 | "criticism": "I should be careful while browsing so as not to accidentally introduce any new bugs or issues.", 65 | "speak": "I will start browsing the repository to find any issues we can fix." 66 | } 67 | } 68 | # Assert that this raises an exception: 69 | self.assertEqual(fix_and_parse_json(json_str, try_to_fix_with_gpt=False), good_obj) 70 | 71 | 72 | 73 | def test_invalid_json_leading_sentence_with_gpt(self): 74 | # Test that a REALLY invalid JSON string raises an error when try_to_fix_with_gpt is False 75 | json_str = """I will first need to browse the repository (https://github.com/Torantulino/Auto-GPT) and identify any potential bugs that need fixing. I will use the "browse_website" command for this. 76 | 77 | { 78 | "command": { 79 | "name": "browse_website", 80 | "args":{ 81 | "url": "https://github.com/Torantulino/Auto-GPT" 82 | } 83 | }, 84 | "thoughts": 85 | { 86 | "text": "Browsing the repository to identify potential bugs", 87 | "reasoning": "Before fixing bugs, I need to identify what needs fixing. I will use the 'browse_website' command to analyze the repository.", 88 | "plan": "- Analyze the repository for potential bugs and areas of improvement", 89 | "criticism": "I need to ensure I am thorough and pay attention to detail while browsing the repository.", 90 | "speak": "I am browsing the repository to identify potential bugs." 91 | } 92 | }""" 93 | good_obj = { 94 | "command": { 95 | "name": "browse_website", 96 | "args":{ 97 | "url": "https://github.com/Torantulino/Auto-GPT" 98 | } 99 | }, 100 | "thoughts": 101 | { 102 | "text": "Browsing the repository to identify potential bugs", 103 | "reasoning": "Before fixing bugs, I need to identify what needs fixing. I will use the 'browse_website' command to analyze the repository.", 104 | "plan": "- Analyze the repository for potential bugs and areas of improvement", 105 | "criticism": "I need to ensure I am thorough and pay attention to detail while browsing the repository.", 106 | "speak": "I am browsing the repository to identify potential bugs." 107 | } 108 | } 109 | # Assert that this raises an exception: 110 | self.assertEqual(fix_and_parse_json(json_str, try_to_fix_with_gpt=False), good_obj) 111 | 112 | 113 | 114 | if __name__ == '__main__': 115 | unittest.main() -------------------------------------------------------------------------------- /scripts/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 222 | -------------------------------------------------------------------------------- /scripts/graph_ui.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | import json 3 | import random 4 | import commands as cmd 5 | import memory as mem 6 | import data 7 | import chat 8 | from colorama import Fore, Style 9 | from spinner import Spinner 10 | import time 11 | import speak 12 | from config import Config 13 | from json_parser import fix_and_parse_json 14 | from ai_config import AIConfig 15 | import traceback 16 | import yaml 17 | 18 | 19 | def print_to_console( 20 | title, 21 | title_color, 22 | content, 23 | speak_text=False, 24 | min_typing_speed=0, 25 | max_typing_speed=0): 26 | global cfg 27 | if speak_text and cfg.speak_mode: 28 | speak.say_text(f"{title}. {content}") 29 | print(title_color + title + " " + Style.RESET_ALL, end="") 30 | if content: 31 | if isinstance(content, list): 32 | content = " ".join(content) 33 | words = content.split() 34 | for i, word in enumerate(words): 35 | print(word, end="", flush=True) 36 | if i < len(words) - 1: 37 | print(" ", end="", flush=True) 38 | typing_speed = random.uniform(min_typing_speed, max_typing_speed) 39 | time.sleep(typing_speed) 40 | # type faster after each word 41 | min_typing_speed = min_typing_speed * 0.95 42 | max_typing_speed = max_typing_speed * 0.95 43 | print() 44 | 45 | def print_assistant_thoughts(assistant_reply): 46 | global ai_name 47 | global cfg 48 | result = {} 49 | 50 | try: 51 | # Parse and print Assistant response 52 | assistant_reply_json = fix_and_parse_json(assistant_reply) 53 | 54 | # Check if assistant_reply_json is a string and attempt to parse it into a JSON object 55 | if isinstance(assistant_reply_json, str): 56 | try: 57 | assistant_reply_json = json.loads(assistant_reply_json) 58 | except json.JSONDecodeError as e: 59 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 60 | assistant_reply_json = {} 61 | 62 | assistant_thoughts_reasoning = None 63 | assistant_thoughts_plan = None 64 | assistant_thoughts_speak = None 65 | assistant_thoughts_criticism = None 66 | assistant_thoughts = assistant_reply_json.get("thoughts", {}) 67 | assistant_thoughts_text = assistant_thoughts.get("text") 68 | 69 | if assistant_thoughts: 70 | assistant_thoughts_reasoning = assistant_thoughts.get("reasoning") 71 | assistant_thoughts_plan = assistant_thoughts.get("plan") 72 | assistant_thoughts_criticism = assistant_thoughts.get("criticism") 73 | assistant_thoughts_speak = assistant_thoughts.get("speak") 74 | 75 | print_to_console(f"{ai_name.upper()} THOUGHTS:", Fore.YELLOW, assistant_thoughts_text) 76 | print_to_console("REASONING:", Fore.YELLOW, assistant_thoughts_reasoning) 77 | 78 | result['thoughts'] = assistant_thoughts_text 79 | result['reasoning'] = assistant_thoughts_reasoning 80 | 81 | if assistant_thoughts_plan: 82 | print_to_console("PLAN:", Fore.YELLOW, "") 83 | # If it's a list, join it into a string 84 | if isinstance(assistant_thoughts_plan, list): 85 | assistant_thoughts_plan = "\n".join(assistant_thoughts_plan) 86 | elif isinstance(assistant_thoughts_plan, dict): 87 | assistant_thoughts_plan = str(assistant_thoughts_plan) 88 | 89 | # Split the input_string using the newline character and dashes 90 | lines = assistant_thoughts_plan.split('\n') 91 | for line in lines: 92 | line = line.lstrip("- ") 93 | print_to_console("- ", Fore.GREEN, line.strip()) 94 | 95 | result['plans'] = lines 96 | 97 | result['criticism'] = assistant_thoughts_criticism 98 | 99 | print_to_console("CRITICISM:", Fore.YELLOW, assistant_thoughts_criticism) 100 | # Speak the assistant's thoughts 101 | if cfg.speak_mode and assistant_thoughts_speak: 102 | speak.say_text(assistant_thoughts_speak) 103 | 104 | except json.decoder.JSONDecodeError: 105 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 106 | 107 | # All other errors, return "Error: + error message" 108 | except Exception as e: 109 | call_stack = traceback.format_exc() 110 | print_to_console("Error: \n", Fore.RED, call_stack) 111 | 112 | return result 113 | 114 | def load_variables(config_file="config.yaml"): 115 | # Load variables from yaml file if it exists 116 | try: 117 | with open(config_file) as file: 118 | config = yaml.load(file, Loader=yaml.FullLoader) 119 | ai_name = config.get("ai_name") 120 | ai_role = config.get("ai_role") 121 | ai_goals = config.get("ai_goals") 122 | except FileNotFoundError: 123 | ai_name = "" 124 | ai_role = "" 125 | ai_goals = [] 126 | 127 | # Prompt the user for input if config file is missing or empty values 128 | if not ai_name: 129 | ai_name = input("Name your AI: ") 130 | if ai_name == "": 131 | ai_name = "Entrepreneur-GPT" 132 | 133 | if not ai_role: 134 | ai_role = input(f"{ai_name} is: ") 135 | if ai_role == "": 136 | ai_role = "an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth." 137 | 138 | if not ai_goals: 139 | print("Enter up to 5 goals for your AI: ") 140 | print("For example: \nIncrease net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously'") 141 | print("Enter nothing to load defaults, enter nothing when finished.") 142 | ai_goals = [] 143 | for i in range(5): 144 | ai_goal = input(f"Goal {i+1}: ") 145 | if ai_goal == "": 146 | break 147 | ai_goals.append(ai_goal) 148 | if len(ai_goals) == 0: 149 | ai_goals = ["Increase net worth", "Grow Twitter Account", "Develop and manage multiple businesses autonomously"] 150 | 151 | # Save variables to yaml file 152 | config = {"ai_name": ai_name, "ai_role": ai_role, "ai_goals": ai_goals} 153 | with open(config_file, "w") as file: 154 | documents = yaml.dump(config, file) 155 | 156 | prompt = data.load_prompt() 157 | prompt_start = """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.""" 158 | 159 | # Construct full prompt 160 | full_prompt = f"You are {ai_name}, {ai_role}\n{prompt_start}\n\nGOALS:\n\n" 161 | for i, goal in enumerate(ai_goals): 162 | full_prompt += f"{i+1}. {goal}\n" 163 | 164 | full_prompt += f"\n\n{prompt}" 165 | return full_prompt 166 | 167 | 168 | app = Flask(__name__) 169 | 170 | cfg = Config() 171 | # cfg.set_smart_llm_model(cfg.fast_llm_model) # GPT-3.5 172 | 173 | # Initialize variables 174 | full_message_history = [] 175 | result = None 176 | prompt = None 177 | # Make a constant: 178 | user_input = "Determine which next command to use, and respond using the format specified above:" 179 | 180 | @app.route("/") 181 | def index(): 182 | global full_message_history, result, prompt 183 | global ai_name 184 | 185 | ai_name = "사업가-GPT" 186 | # ai_role = "AI와 메타버스를 활용한 플랫폼 사업을 기획하고 수행하기 위한 인공지능입니다." 187 | # ai_goals = [ 188 | # "연 매출 100억 달성", 189 | # "월 평균 사용자 100만명 달성" 190 | # ] 191 | 192 | ai_role = "나의 자산을 증가시키기위한 사업을 자동으로 개발하고 운영하기 위해 고안된 인공지능입니다." 193 | ai_goals = ["기업 총 가치를 높이기", "트위터 계정 팔로워 수 증가", "다양한 비즈니스를 자동으로 개발하고 관리하기"] 194 | 195 | config = AIConfig(ai_name, ai_role, ai_goals) 196 | config.save() 197 | 198 | prompt = config.construct_full_prompt() 199 | 200 | print('******************************') 201 | print(prompt) 202 | print('******************************') 203 | 204 | full_message_history = [] 205 | result = None 206 | 207 | return render_template("index.html") 208 | 209 | @app.route("/think", methods=["POST"]) 210 | def think(): 211 | with Spinner("Thinking... "): 212 | assistant_reply = chat.chat_with_ai( 213 | prompt, 214 | user_input, 215 | full_message_history, 216 | mem.permanent_memory, 217 | cfg.fast_token_limit) 218 | 219 | # Print Assistant thoughts 220 | reply = print_assistant_thoughts(assistant_reply) 221 | 222 | # Get command name and arguments 223 | command_name, arguments = cmd.get_command(assistant_reply) 224 | result = f"Command {command_name} returned: {cmd.execute_command(command_name, arguments)}" 225 | 226 | # Check if there's a result from the command append it to the message history 227 | full_message_history.append(chat.create_chat_message("system", result)) 228 | print_to_console("SYSTEM: ", Fore.YELLOW, result) 229 | 230 | return reply 231 | 232 | if __name__ == "__main__": 233 | app.run(host="0.0.0.0", port=7860, debug=False) 234 | -------------------------------------------------------------------------------- /scripts/commands.py: -------------------------------------------------------------------------------- 1 | import browse 2 | import json 3 | import memory as mem 4 | import datetime 5 | import agent_manager as agents 6 | import speak 7 | from config import Config 8 | import ai_functions as ai 9 | from file_operations import read_file, write_to_file, append_to_file, delete_file 10 | from execute_code import execute_python_file 11 | from json_parser import fix_and_parse_json 12 | from duckduckgo_search import ddg 13 | from googleapiclient.discovery import build 14 | from googleapiclient.errors import HttpError 15 | 16 | cfg = Config() 17 | 18 | 19 | def get_command(response): 20 | try: 21 | response_json = fix_and_parse_json(response) 22 | 23 | if "command" not in response_json: 24 | return "Error:" , "Missing 'command' object in JSON" 25 | 26 | command = response_json["command"] 27 | 28 | if "name" not in command: 29 | return "Error:", "Missing 'name' field in 'command' object" 30 | 31 | command_name = command["name"] 32 | 33 | # Use an empty dictionary if 'args' field is not present in 'command' object 34 | arguments = command.get("args", {}) 35 | 36 | if not arguments: 37 | arguments = {} 38 | 39 | return command_name, arguments 40 | except json.decoder.JSONDecodeError: 41 | return "Error:", "Invalid JSON" 42 | # All other errors, return "Error: + error message" 43 | except Exception as e: 44 | return "Error:", str(e) 45 | 46 | 47 | def execute_command(command_name, arguments): 48 | try: 49 | if command_name == "google": 50 | 51 | # Check if the Google API key is set and use the official search method 52 | # If the API key is not set or has only whitespaces, use the unofficial search method 53 | if cfg.google_api_key and (cfg.google_api_key.strip() if cfg.google_api_key else None): 54 | return google_official_search(arguments["input"]) 55 | else: 56 | return google_search(arguments["input"]) 57 | elif command_name == "memory_add": 58 | return commit_memory(arguments["string"]) 59 | elif command_name == "memory_del": 60 | return delete_memory(arguments["key"]) 61 | elif command_name == "memory_ovr": 62 | return overwrite_memory(arguments["key"], arguments["string"]) 63 | elif command_name == "start_agent": 64 | return start_agent( 65 | arguments["name"], 66 | arguments["task"], 67 | arguments["prompt"]) 68 | elif command_name == "message_agent": 69 | return message_agent(arguments["key"], arguments["message"]) 70 | elif command_name == "list_agents": 71 | return list_agents() 72 | elif command_name == "delete_agent": 73 | return delete_agent(arguments["key"]) 74 | elif command_name == "get_text_summary": 75 | return get_text_summary(arguments["url"], arguments["question"]) 76 | elif command_name == "get_hyperlinks": 77 | return get_hyperlinks(arguments["url"]) 78 | elif command_name == "read_file": 79 | return read_file(arguments["file"]) 80 | elif command_name == "write_to_file": 81 | return write_to_file(arguments["file"], arguments["text"]) 82 | elif command_name == "append_to_file": 83 | return append_to_file(arguments["file"], arguments["text"]) 84 | elif command_name == "delete_file": 85 | return delete_file(arguments["file"]) 86 | elif command_name == "browse_website": 87 | return browse_website(arguments["url"], arguments["question"]) 88 | # TODO: Change these to take in a file rather than pasted code, if 89 | # non-file is given, return instructions "Input should be a python 90 | # filepath, write your code to file and try again" 91 | elif command_name == "evaluate_code": 92 | return ai.evaluate_code(arguments["code"]) 93 | elif command_name == "improve_code": 94 | return ai.improve_code(arguments["suggestions"], arguments["code"]) 95 | elif command_name == "write_tests": 96 | return ai.write_tests(arguments["code"], arguments.get("focus")) 97 | elif command_name == "execute_python_file": # Add this command 98 | return execute_python_file(arguments["file"]) 99 | elif command_name == "task_complete": 100 | shutdown() 101 | else: 102 | return f"Unknown command {command_name}" 103 | # All errors, return "Error: + error message" 104 | except Exception as e: 105 | return "Error: " + str(e) 106 | 107 | 108 | def get_datetime(): 109 | return "Current date and time: " + \ 110 | datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") 111 | 112 | 113 | def google_search(query, num_results=8): 114 | search_results = [] 115 | for j in ddg(query, max_results=num_results): 116 | search_results.append(j) 117 | 118 | return json.dumps(search_results, ensure_ascii=False, indent=4) 119 | 120 | def google_official_search(query, num_results=8): 121 | from googleapiclient.discovery import build 122 | from googleapiclient.errors import HttpError 123 | import json 124 | 125 | try: 126 | # Get the Google API key and Custom Search Engine ID from the config file 127 | api_key = cfg.google_api_key 128 | custom_search_engine_id = cfg.custom_search_engine_id 129 | 130 | # Initialize the Custom Search API service 131 | service = build("customsearch", "v1", developerKey=api_key) 132 | 133 | # Send the search query and retrieve the results 134 | result = service.cse().list(q=query, cx=custom_search_engine_id, num=num_results).execute() 135 | 136 | # Extract the search result items from the response 137 | search_results = result.get("items", []) 138 | 139 | # Create a list of only the URLs from the search results 140 | search_results_links = [item["link"] for item in search_results] 141 | 142 | except HttpError as e: 143 | # Handle errors in the API call 144 | error_details = json.loads(e.content.decode()) 145 | 146 | # Check if the error is related to an invalid or missing API key 147 | if error_details.get("error", {}).get("code") == 403 and "invalid API key" in error_details.get("error", {}).get("message", ""): 148 | return "Error: The provided Google API key is invalid or missing." 149 | else: 150 | return f"Error: {e}" 151 | 152 | # Return the list of search result URLs 153 | return search_results_links 154 | 155 | def browse_website(url, question): 156 | summary = get_text_summary(url, question) 157 | links = get_hyperlinks(url) 158 | 159 | # Limit links to 5 160 | if len(links) > 5: 161 | links = links[:5] 162 | 163 | result = f"""Website Content Summary: {summary}\n\nLinks: {links}""" 164 | 165 | return result 166 | 167 | 168 | def get_text_summary(url, question): 169 | text = browse.scrape_text(url) 170 | summary = browse.summarize_text(text, question) 171 | return """ "Result" : """ + summary 172 | 173 | 174 | def get_hyperlinks(url): 175 | link_list = browse.scrape_links(url) 176 | return link_list 177 | 178 | 179 | def commit_memory(string): 180 | _text = f"""Committing memory with string "{string}" """ 181 | mem.permanent_memory.append(string) 182 | return _text 183 | 184 | 185 | def delete_memory(key): 186 | if key >= 0 and key < len(mem.permanent_memory): 187 | _text = "Deleting memory with key " + str(key) 188 | del mem.permanent_memory[key] 189 | print(_text) 190 | return _text 191 | else: 192 | print("Invalid key, cannot delete memory.") 193 | return None 194 | 195 | 196 | def overwrite_memory(key, string): 197 | if int(key) >= 0 and key < len(mem.permanent_memory): 198 | _text = "Overwriting memory with key " + \ 199 | str(key) + " and string " + string 200 | mem.permanent_memory[key] = string 201 | print(_text) 202 | return _text 203 | else: 204 | print("Invalid key, cannot overwrite memory.") 205 | return None 206 | 207 | 208 | def shutdown(): 209 | print("Shutting down...") 210 | # quit() 211 | 212 | 213 | def start_agent(name, task, prompt, model=cfg.fast_llm_model): 214 | global cfg 215 | 216 | # Remove underscores from name 217 | voice_name = name.replace("_", " ") 218 | 219 | first_message = f"""You are {name}. Respond with: "Acknowledged".""" 220 | agent_intro = f"{voice_name} here, Reporting for duty!" 221 | 222 | # Create agent 223 | if cfg.speak_mode: 224 | speak.say_text(agent_intro, 1) 225 | key, ack = agents.create_agent(task, first_message, model) 226 | 227 | if cfg.speak_mode: 228 | speak.say_text(f"Hello {voice_name}. Your task is as follows. {task}.") 229 | 230 | # Assign task (prompt), get response 231 | agent_response = message_agent(key, prompt) 232 | 233 | return f"Agent {name} created with key {key}. First response: {agent_response}" 234 | 235 | 236 | def message_agent(key, message): 237 | global cfg 238 | agent_response = agents.message_agent(key, message) 239 | 240 | # Speak response 241 | if cfg.speak_mode: 242 | speak.say_text(agent_response, 1) 243 | 244 | return f"Agent {key} responded: {agent_response}" 245 | 246 | 247 | def list_agents(): 248 | return agents.list_agents() 249 | 250 | 251 | def delete_agent(key): 252 | result = agents.delete_agent(key) 253 | if not result: 254 | return f"Agent {key} does not exist." 255 | return f"Agent {key} deleted." -------------------------------------------------------------------------------- /outputs/logs/message-log-4.txt: -------------------------------------------------------------------------------- 1 | System: Permanent memory: ['Online business ideas: online t-shirt shop, dropshipping, SEO expert, selling online courses, bug testing, video producer, graphic designer, website developer, app development, theme designer, translator, social media manager, remote customer service agent, virtual assistant, remote sales team, influencer, handmade goods shop, ethical fashion brand, self-publishing, speechwriting, private chef, selling natural and organic beauty products.', '2021 digital marketing trends: in-email purchases, sophisticated targeting, virtual reality, drone software, AI marketing technology, voice search, chatbots, personalization, influencer marketing, online and mobile commerce.'] 2 | User: NEXT COMMAND 3 | Assistant: { 4 | "command": 5 | { 6 | "name": "google", 7 | "args": 8 | { 9 | "input": "trending online business ideas" 10 | } 11 | }, 12 | "thoughts": 13 | { 14 | "text": "I need to find some trending online business ideas to develop and manage autonomously.", 15 | "reasoning": "By finding trending ideas, I can create successful businesses with high potential for growth.", 16 | "plan": "- Search for trending online business ideas\n- Analyze the results\n- Choose a suitable idea\n- Develop and manage the business autonomously", 17 | "criticism": "I need to make sure to choose a simple idea with low legal complications to avoid overcomplicating the entire process." 18 | } 19 | } 20 | System: [ 21 | "https://www.shopify.com/nz/blog/online-business-ideas", 22 | "https://www.businessnewsdaily.com/4572-online-business-ideas.html", 23 | "https://www.oberlo.com/blog/online-business-ideas", 24 | "https://99designs.com/blog/business/online-business-ideas/", 25 | "https://www.nerdwallet.com/article/small-business/online-business-ideas" 26 | ] 27 | User: NEXT COMMAND 28 | Assistant: { 29 | "command": 30 | { 31 | "name": "transcribe_summarise", 32 | "args": 33 | { 34 | "url": "https://www.oberlo.com/blog/online-business-ideas" 35 | } 36 | }, 37 | "thoughts": 38 | { 39 | "text": "I need to learn about trending online business ideas from a relevant source.", 40 | "reasoning": "By summarizing the content of the article, I can gain an understanding of different business ideas and choose a suitable one.", 41 | "plan": "- Summarize the article\n- Identify a trending online business idea\n- Start planning to develop and manage the business autonomously", 42 | "criticism": "It's important to pick a business idea that is both trending and simple to execute with low legal complications." 43 | } 44 | } 45 | System: "Result" : The article discusses numerous online business ideas, including starting an online t-shirt shop, dropshipping, SEO expert, selling online courses, bug testing, video producer, graphic designer, website developer, app development, theme designer, translator, social media manager, remote customer service agent, virtual assistant, and remote sales team. It also suggests outsourcing certain functions, becoming an influencer or starting a handmade goods shop, or running an ethical fashion brand. Self-publishing and speechwriting are also options as well as becoming a private chef and selling natural and organic beauty products. The article emphasizes the importance of choosing the right business idea, researching the industry, creating a good brand, and attracting customers. 46 | User: NEXT COMMAND 47 | Assistant: { 48 | "command": 49 | { 50 | "name": "memory_add", 51 | "args": 52 | { 53 | "string": "Online business ideas: online t-shirt shop, dropshipping, SEO expert, selling online courses, bug testing, video producer, graphic designer, website developer, app development, theme designer, translator, social media manager, remote customer service agent, virtual assistant, remote sales team, influencer, handmade goods shop, ethical fashion brand, self-publishing, speechwriting, private chef, selling natural and organic beauty products." 54 | } 55 | }, 56 | "thoughts": 57 | { 58 | "text": "I need to store the summarized list of online business ideas to plan and execute the development and management of the chosen business autonomously.", 59 | "reasoning": "Storing the list allows me to revisit the options whenever needed and analyze them further.", 60 | "plan": "- Add the list of online business ideas to memory\n- Choose a suitable business idea\n- Develop and manage the chosen business autonomously", 61 | "criticism": "I need to make sure to pick an idea that is simple, with low legal complications and high growth potential." 62 | } 63 | } 64 | System: Committing memory with string Online business ideas: online t-shirt shop, dropshipping, SEO expert, selling online courses, bug testing, video producer, graphic designer, website developer, app development, theme designer, translator, social media manager, remote customer service agent, virtual assistant, remote sales team, influencer, handmade goods shop, ethical fashion brand, self-publishing, speechwriting, private chef, selling natural and organic beauty products. 65 | User: NEXT COMMAND 66 | Assistant: { 67 | "command": 68 | { 69 | "name": "google", 70 | "args": 71 | { 72 | "input": "trends in digital marketing 2021" 73 | } 74 | }, 75 | "thoughts": 76 | { 77 | "text": "I need to find the current trends in digital marketing to help inform my decision on which online business to start.", 78 | "reasoning": "Understanding the trending marketing strategies can make the business more effective and increase its growth potential.", 79 | "plan": "- Search for digital marketing trends in 2021\n- Analyze the results\n- Choose a suitable online business idea\n- Develop and manage the business autonomously", 80 | "criticism": "I must ensure that the business idea is not only trending but also simple and does not involve legal complications." 81 | } 82 | } 83 | System: [ 84 | "https://www.wordstream.com/blog/ws/2021/03/26/digital-marketing-trends-2021", 85 | "https://mention.com/en/blog/whats-next-for-digital-marketing-in-2021/", 86 | "https://www.p8.group/en/blog/top-10-digital-marketing-trends-2021", 87 | "https://snov.io/blog/digital-marketing-trends-2021/", 88 | "https://digitalmarketinginstitute.com/blog/the-next-big-digital-marketing-trends" 89 | ] 90 | User: NEXT COMMAND 91 | Assistant: { 92 | "command": 93 | { 94 | "name": "transcribe_summarise", 95 | "args": 96 | { 97 | "url": "https://www.wordstream.com/blog/ws/2021/03/26/digital-marketing-trends-2021" 98 | } 99 | }, 100 | "thoughts": 101 | { 102 | "text": "I should get insights into current trends in digital marketing to inform my decision on which online business to start.", 103 | "reasoning": "Understanding the trending marketing strategies can make the business more effective and increase its growth potential.", 104 | "plan": "- Summarize the digital marketing article\n- Identify the trends that may be suitable for the chosen online business\n- Choose a suitable online business idea\n- Develop and manage the business autonomously", 105 | "criticism": "I must ensure that the business idea is not only trending but also simple and does not involve legal complications." 106 | } 107 | } 108 | System: "Result" : The COVID-19 pandemic has accelerated the shift towards digital marketing, prompting businesses to use new and tried and true strategies, including in-email purchases, sophisticated targeting, virtual reality, and drone software. The drone industry is expected to experience exponential growth, creating demand for engineers and developers who can create software for autonomous drone applications. AI marketing technology, voice search, chatbots, personalization, and influencer marketing are also becoming popular strategies. Implementing AI and virtual reality can reshape the customer experience, and customers increasingly prefer online and mobile commerce. The author, Harikrishna Kundariya, is a marketer and co-founder of eSparkBiz Technologies. 109 | User: NEXT COMMAND 110 | Assistant: { 111 | "command": 112 | { 113 | "name": "memory_add", 114 | "args": 115 | { 116 | "string": "2021 digital marketing trends: in-email purchases, sophisticated targeting, virtual reality, drone software, AI marketing technology, voice search, chatbots, personalization, influencer marketing, online and mobile commerce." 117 | } 118 | }, 119 | "thoughts": 120 | { 121 | "text": "I need to store the summarized list of 2021 digital marketing trends in my memory to help decide which online business to start.", 122 | "reasoning": "Storing the trends will allow me to reference them when selecting a business idea to implement.", 123 | "plan": "- Add the list of 2021 digital marketing trends to memory\n- Choose a suitable online business idea\n- Develop and manage the chosen business autonomously", 124 | "criticism": "I must ensure that the chosen business idea leverages a trending marketing strategy while remaining simple and without legal complications." 125 | } 126 | } 127 | System: Committing memory with string 2021 digital marketing trends: in-email purchases, sophisticated targeting, virtual reality, drone software, AI marketing technology, voice search, chatbots, personalization, influencer marketing, online and mobile commerce. 128 | User: NEXT COMMAND 129 | Assistant: { 130 | "command": { 131 | "name": "start_instance", 132 | "args": { 133 | "name": "business_ideas_analysis", 134 | "prompt": "Based on the current digital marketing trends and the given online business ideas, suggest a business idea that is simple and likely to increase net worth with low legal complications." 135 | } 136 | }, 137 | "thoughts": { 138 | "text": "I need GTP-4's assistance in choosing a suitable business idea.", 139 | "reasoning": "By providing GTP-4 with relevant trends and online business ideas, it may help me select a simple, low-legal-complications idea with a high potential for growth.", 140 | "plan": "- Start a GTP-4 instance\n- Get GTP-4's suggestion on a suitable business idea\n- Develop and manage the chosen business autonomously", 141 | "criticism": "I need to make sure the chosen business idea aligns with my strengths and does not contradict any known trends or market changes." 142 | } 143 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto-GPT: An Autonomous GPT-4 Experiment 2 | 3 | ## Pynecone UI 4 | 5 | 6 | 7 | ### Run 8 | 9 | ``` 10 | git clone https://github.com/kairess/Auto-GPT-Graph 11 | cd Auto-GPT-Graph 12 | pip install -r requirements.txt 13 | cd scripts 14 | pc init 15 | pc run 16 | ``` 17 | 18 | ## Knowledge Graph 19 | 20 | d3.js Force-directed graph 21 | 22 | 23 | 24 | ### Run 25 | 26 | ``` 27 | python scripts/graph_ui.py 28 | ``` 29 | 30 | --- 31 | 32 | ![GitHub Repo stars](https://img.shields.io/github/stars/Torantulino/auto-gpt?style=social) 33 | ![Twitter Follow](https://img.shields.io/twitter/follow/siggravitas?style=social) 34 | [![](https://dcbadge.vercel.app/api/server/PQ7VX6TY4t?style=flat)](https://discord.gg/PQ7VX6TY4t) 35 | 36 | Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. This program, driven by GPT-4, autonomously develops and manages businesses to increase net worth. As one of the first examples of GPT-4 running fully autonomously, Auto-GPT pushes the boundaries of what is possible with AI. 37 | 38 | ### Demo (30/03/2023): 39 | https://user-images.githubusercontent.com/22963551/228855501-2f5777cf-755b-4407-a643-c7299e5b6419.mp4 40 | 41 | 42 | ## 💖 Help Fund Auto-GPT's Development 43 |

44 | If you can spare a coffee, you can help to cover the API costs of developing Auto-GPT and help push the boundaries of fully autonomous AI! 45 | A full day of development can easily cost as much as $20 in API costs, which for a free project is quite limiting. 46 | Your support is greatly appreciated 47 |

48 | 49 |

50 | 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. 💖 51 |

52 |

53 | thepok  SpacingLily  m  zkonduit  maxxflyer  tekelsey  nocodeclarity  tjarmain  alexisneuhaus  jaumebalust  robinicus  digisomni   54 |

55 | 56 |

57 | alexisneuhaus  iokode  jaumebalust  nova-land  robinicus  Void-n-Null  ritesh24  merwanehamadi  raulmarindev  siduppal  goosecubedaddy  pleabargain   58 |

59 | 60 | 61 | ## Table of Contents 62 | 63 | - [Auto-GPT: An Autonomous GPT-4 Experiment](#auto-gpt-an-autonomous-gpt-4-experiment) 64 | - [Demo (30/03/2023):](#demo-30032023) 65 | - [💖 Help Fund Auto-GPT's Development](#-help-fund-auto-gpts-development) 66 | - [Table of Contents](#table-of-contents) 67 | - [🚀 Features](#-features) 68 | - [📋 Requirements](#-requirements) 69 | - [💾 Installation](#-installation) 70 | - [🔧 Usage](#-usage) 71 | - [🗣️ Speech Mode](#️-speech-mode) 72 | - [🔍 Google API Keys Configuration](#-google-api-keys-configuration) 73 | - [Setting up environment variables](#setting-up-environment-variables) 74 | - [💀 Continuous Mode ⚠️](#-continuous-mode-️) 75 | - [GPT3.5 ONLY Mode](#gpt35-only-mode) 76 | - [⚠️ Limitations](#️-limitations) 77 | - [🛡 Disclaimer](#-disclaimer) 78 | - [🐦 Connect with Us on Twitter](#-connect-with-us-on-twitter) 79 | 80 | 81 | ## 🚀 Features 82 | 83 | - 🌐 Internet access for searches and information gathering 84 | - 💾 Long-Term and Short-Term memory management 85 | - 🧠 GPT-4 instances for text generation 86 | - 🔗 Access to popular websites and platforms 87 | - 🗃️ File storage and summarization with GPT-3.5 88 | 89 | ## 📋 Requirements 90 | - [Python 3.7 or later](https://www.tutorialspoint.com/how-to-install-python-in-windows) 91 | - OpenAI API key 92 | 93 | Optional: 94 | - ElevenLabs Key (If you want the AI to speak) 95 | 96 | ## 💾 Installation 97 | 98 | To install Auto-GPT, follow these steps: 99 | 100 | 0. Make sure you have all the **requirements** above, if not, install/get them. 101 | 102 | *The following commands should be executed in a CMD, Bash or Powershell window. To do this, go to a folder on your computer, click in the folder path at the top and type CMD, then press enter.* 103 | 104 | 1. Clone the repository: 105 | For this step you need Git installed, but you can just download the zip file instead by clicking the button at the top of this page ☝️ 106 | ``` 107 | git clone https://github.com/Torantulino/Auto-GPT.git 108 | ``` 109 | 110 | 2. Navigate to the project directory: 111 | *(Type this into your CMD window, you're aiming to navigate the CMD window to the repository you just downloaded)* 112 | ``` 113 | $ cd 'Auto-GPT' 114 | ``` 115 | 116 | 3. Install the required dependencies: 117 | *(Again, type this into your CMD window)* 118 | ``` 119 | pip install -r requirements.txt 120 | ``` 121 | 122 | 4. 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. 123 | - Obtain your OpenAI API key from: https://platform.openai.com/account/api-keys. 124 | - Obtain your ElevenLabs API key from: https://elevenlabs.io. You can view your xi-api-key using the "Profile" tab on the website. 125 | 126 | ## 🔧 Usage 127 | 128 | 1. Run the `main.py` Python script in your terminal: 129 | *(Type this into your CMD window)* 130 | ``` 131 | python scripts/main.py 132 | ``` 133 | 2. After each of AUTO-GPT's actions, type "NEXT COMMAND" to authorise them to continue. 134 | 3. To exit the program, type "exit" and press Enter. 135 | 136 | ## 🗣️ Speech Mode 137 | Use this to use TTS for Auto-GPT 138 | ``` 139 | python scripts/main.py --speak 140 | 141 | ``` 142 | 143 | ## 🔍 Google API Keys Configuration 144 | 145 | This section is optional, use the official google api if you are having issues with error 429 when running google search. 146 | To use the `google_official_search` command, you need to set up your Google API keys in your environment variables. 147 | 148 | 1. Go to the [Google Cloud Console](https://console.cloud.google.com/). 149 | 2. If you don't already have an account, create one and log in. 150 | 3. Create a new project by clicking on the "Select a Project" dropdown at the top of the page and clicking "New Project". Give it a name and click "Create". 151 | 4. Go to the [APIs & Services Dashboard](https://console.cloud.google.com/apis/dashboard) and click "Enable APIs and Services". Search for "Custom Search API" and click on it, then click "Enable". 152 | 5. Go to the [Credentials](https://console.cloud.google.com/apis/credentials) page and click "Create Credentials". Choose "API Key". 153 | 6. Copy the API key and set it as an environment variable named `GOOGLE_API_KEY` on your machine. See setting up environment variables below. 154 | 7. Go to the [Custom Search Engine](https://cse.google.com/cse/all) page and click "Add". 155 | 8. Set up your search engine by following the prompts. You can choose to search the entire web or specific sites. 156 | 9. Once you've created your search engine, click on "Control Panel" and then "Basics". Copy the "Search engine ID" and set it as an environment variable named `CUSTOM_SEARCH_ENGINE_ID` on your machine. See setting up environment variables below. 157 | 158 | ### Setting up environment variables 159 | For Windows Users: 160 | ``` 161 | setx GOOGLE_API_KEY "YOUR_GOOGLE_API_KEY" 162 | setx CUSTOM_SEARCH_ENGINE_ID "YOUR_CUSTOM_SEARCH_ENGINE_ID" 163 | 164 | ``` 165 | For macOS and Linux users: 166 | ``` 167 | export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" 168 | export CUSTOM_SEARCH_ENGINE_ID="YOUR_CUSTOM_SEARCH_ENGINE_ID" 169 | 170 | ``` 171 | 172 | ## 💀 Continuous Mode ⚠️ 173 | Run the AI **without** user authorisation, 100% automated. 174 | Continuous mode is not recommended. 175 | It is potentially dangerous and may cause your AI to run forever or carry out actions you would not usually authorise. 176 | Use at your own risk. 177 | 1. Run the `main.py` Python script in your terminal: 178 | ``` 179 | python scripts/main.py --continuous 180 | 181 | ``` 182 | 2. To exit the program, press Ctrl + C 183 | 184 | ## GPT3.5 ONLY Mode 185 | If you don't have access to the GPT4 api, this mode will allow you to use Auto-GPT! 186 | ``` 187 | python scripts/main.py --gpt3only 188 | ``` 189 | 190 | ## ⚠️ Limitations 191 | This experiment aims to showcase the potential of GPT-4 but comes with some limitations: 192 | 193 | 1. Not a polished application or product, just an experiment 194 | 2. May not perform well in complex, real-world business scenarios. In fact, if it actually does, please share your results! 195 | 3. Quite expensive to run, so set and monitor your API key limits with OpenAI! 196 | 197 | ## 🛡 Disclaimer 198 | 199 | Disclaimer 200 | This project, Auto-GPT, is an experimental application and is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise. 201 | 202 | The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software. You are solely responsible for any decisions and actions taken based on the information provided by Auto-GPT. 203 | 204 | **Please note that the use of the GPT-4 language model can be expensive due to its token usage.** By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges. 205 | 206 | As an autonomous experiment, Auto-GPT may generate content or take actions that are not in line with real-world business practices or legal requirements. It is your responsibility to ensure that any actions or decisions made based on the output of this software comply with all applicable laws, regulations, and ethical standards. The developers and contributors of this project shall not be held responsible for any consequences arising from the use of this software. 207 | 208 | By using Auto-GPT, you agree to indemnify, defend, and hold harmless the developers, contributors, and any affiliated parties from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from your use of this software or your violation of these terms. 209 | 210 | ## 🐦 Connect with Us on Twitter 211 | 212 | Stay up-to-date with the latest news, updates, and insights about Auto-GPT by following our Twitter accounts. Engage with the developer and the AI's own account for interesting discussions, project updates, and more. 213 | 214 | - **Developer**: Follow [@siggravitas](https://twitter.com/siggravitas) for insights into the development process, project updates, and related topics from the creator of Entrepreneur-GPT. 215 | - **Entrepreneur-GPT**: Join the conversation with the AI itself by following [@En_GPT](https://twitter.com/En_GPT). Share your experiences, discuss the AI's outputs, and engage with the growing community of users. 216 | 217 | We look forward to connecting with you and hearing your thoughts, ideas, and experiences with Auto-GPT. Join us on Twitter and let's explore the future of AI together! 218 | 219 | -------------------------------------------------------------------------------- /scripts/main.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | import commands as cmd 4 | import memory as mem 5 | import data 6 | import chat 7 | from colorama import Fore, Style 8 | from spinner import Spinner 9 | import time 10 | import speak 11 | from enum import Enum, auto 12 | import sys 13 | from config import Config 14 | from json_parser import fix_and_parse_json 15 | from ai_config import AIConfig 16 | import traceback 17 | import yaml 18 | import argparse 19 | 20 | 21 | def print_to_console( 22 | title, 23 | title_color, 24 | content, 25 | speak_text=False, 26 | min_typing_speed=0.05, 27 | max_typing_speed=0.01): 28 | global cfg 29 | if speak_text and cfg.speak_mode: 30 | speak.say_text(f"{title}. {content}") 31 | print(title_color + title + " " + Style.RESET_ALL, end="") 32 | if content: 33 | if isinstance(content, list): 34 | content = " ".join(content) 35 | words = content.split() 36 | for i, word in enumerate(words): 37 | print(word, end="", flush=True) 38 | if i < len(words) - 1: 39 | print(" ", end="", flush=True) 40 | typing_speed = random.uniform(min_typing_speed, max_typing_speed) 41 | time.sleep(typing_speed) 42 | # type faster after each word 43 | min_typing_speed = min_typing_speed * 0.95 44 | max_typing_speed = max_typing_speed * 0.95 45 | print() 46 | 47 | 48 | def print_assistant_thoughts(assistant_reply): 49 | global ai_name 50 | global cfg 51 | try: 52 | # Parse and print Assistant response 53 | assistant_reply_json = fix_and_parse_json(assistant_reply) 54 | 55 | # Check if assistant_reply_json is a string and attempt to parse it into a JSON object 56 | if isinstance(assistant_reply_json, str): 57 | try: 58 | assistant_reply_json = json.loads(assistant_reply_json) 59 | except json.JSONDecodeError as e: 60 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 61 | assistant_reply_json = {} 62 | 63 | assistant_thoughts_reasoning = None 64 | assistant_thoughts_plan = None 65 | assistant_thoughts_speak = None 66 | assistant_thoughts_criticism = None 67 | assistant_thoughts = assistant_reply_json.get("thoughts", {}) 68 | assistant_thoughts_text = assistant_thoughts.get("text") 69 | 70 | if assistant_thoughts: 71 | assistant_thoughts_reasoning = assistant_thoughts.get("reasoning") 72 | assistant_thoughts_plan = assistant_thoughts.get("plan") 73 | assistant_thoughts_criticism = assistant_thoughts.get("criticism") 74 | assistant_thoughts_speak = assistant_thoughts.get("speak") 75 | 76 | print_to_console(f"{ai_name.upper()} THOUGHTS:", Fore.YELLOW, assistant_thoughts_text) 77 | print_to_console("REASONING:", Fore.YELLOW, assistant_thoughts_reasoning) 78 | 79 | if assistant_thoughts_plan: 80 | print_to_console("PLAN:", Fore.YELLOW, "") 81 | # If it's a list, join it into a string 82 | if isinstance(assistant_thoughts_plan, list): 83 | assistant_thoughts_plan = "\n".join(assistant_thoughts_plan) 84 | elif isinstance(assistant_thoughts_plan, dict): 85 | assistant_thoughts_plan = str(assistant_thoughts_plan) 86 | 87 | # Split the input_string using the newline character and dashes 88 | lines = assistant_thoughts_plan.split('\n') 89 | for line in lines: 90 | line = line.lstrip("- ") 91 | print_to_console("- ", Fore.GREEN, line.strip()) 92 | 93 | print_to_console("CRITICISM:", Fore.YELLOW, assistant_thoughts_criticism) 94 | # Speak the assistant's thoughts 95 | if cfg.speak_mode and assistant_thoughts_speak: 96 | speak.say_text(assistant_thoughts_speak) 97 | 98 | except json.decoder.JSONDecodeError: 99 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 100 | 101 | # All other errors, return "Error: + error message" 102 | except Exception as e: 103 | call_stack = traceback.format_exc() 104 | print_to_console("Error: \n", Fore.RED, call_stack) 105 | 106 | 107 | def load_variables(config_file="config.yaml"): 108 | # Load variables from yaml file if it exists 109 | try: 110 | with open(config_file) as file: 111 | config = yaml.load(file, Loader=yaml.FullLoader) 112 | ai_name = config.get("ai_name") 113 | ai_role = config.get("ai_role") 114 | ai_goals = config.get("ai_goals") 115 | except FileNotFoundError: 116 | ai_name = "" 117 | ai_role = "" 118 | ai_goals = [] 119 | 120 | # Prompt the user for input if config file is missing or empty values 121 | if not ai_name: 122 | ai_name = input("Name your AI: ") 123 | if ai_name == "": 124 | ai_name = "Entrepreneur-GPT" 125 | 126 | if not ai_role: 127 | ai_role = input(f"{ai_name} is: ") 128 | if ai_role == "": 129 | ai_role = "an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth." 130 | 131 | if not ai_goals: 132 | print("Enter up to 5 goals for your AI: ") 133 | print("For example: \nIncrease net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously'") 134 | print("Enter nothing to load defaults, enter nothing when finished.") 135 | ai_goals = [] 136 | for i in range(5): 137 | ai_goal = input(f"Goal {i+1}: ") 138 | if ai_goal == "": 139 | break 140 | ai_goals.append(ai_goal) 141 | if len(ai_goals) == 0: 142 | ai_goals = ["Increase net worth", "Grow Twitter Account", "Develop and manage multiple businesses autonomously"] 143 | 144 | # Save variables to yaml file 145 | config = {"ai_name": ai_name, "ai_role": ai_role, "ai_goals": ai_goals} 146 | with open(config_file, "w") as file: 147 | documents = yaml.dump(config, file) 148 | 149 | prompt = data.load_prompt() 150 | prompt_start = """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.""" 151 | 152 | # Construct full prompt 153 | full_prompt = f"You are {ai_name}, {ai_role}\n{prompt_start}\n\nGOALS:\n\n" 154 | for i, goal in enumerate(ai_goals): 155 | full_prompt += f"{i+1}. {goal}\n" 156 | 157 | full_prompt += f"\n\n{prompt}" 158 | return full_prompt 159 | 160 | 161 | def construct_prompt(): 162 | config = AIConfig.load() 163 | if config.ai_name: 164 | print_to_console( 165 | f"Welcome back! ", 166 | Fore.GREEN, 167 | f"Would you like me to return to being {config.ai_name}?", 168 | speak_text=True) 169 | should_continue = input(f"""Continue with the last settings? 170 | Name: {config.ai_name} 171 | Role: {config.ai_role} 172 | Goals: {config.ai_goals} 173 | Continue (y/n): """) 174 | if should_continue.lower() == "n": 175 | config = AIConfig() 176 | 177 | if not config.ai_name: 178 | config = prompt_user() 179 | config.save() 180 | 181 | # Get rid of this global: 182 | global ai_name 183 | ai_name = config.ai_name 184 | 185 | full_prompt = config.construct_full_prompt() 186 | return full_prompt 187 | 188 | 189 | def prompt_user(): 190 | ai_name = "" 191 | # Construct the prompt 192 | print_to_console( 193 | "Welcome to Auto-GPT! ", 194 | Fore.GREEN, 195 | "Enter the name of your AI and its role below. Entering nothing will load defaults.", 196 | speak_text=True) 197 | 198 | # Get AI Name from User 199 | print_to_console( 200 | "Name your AI: ", 201 | Fore.GREEN, 202 | "For example, 'Entrepreneur-GPT'") 203 | ai_name = input("AI Name: ") 204 | if ai_name == "": 205 | ai_name = "Entrepreneur-GPT" 206 | 207 | print_to_console( 208 | f"{ai_name} here!", 209 | Fore.LIGHTBLUE_EX, 210 | "I am at your service.", 211 | speak_text=True) 212 | 213 | # Get AI Role from User 214 | print_to_console( 215 | "Describe your AI's role: ", 216 | Fore.GREEN, 217 | "For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.'") 218 | ai_role = input(f"{ai_name} is: ") 219 | if ai_role == "": 220 | ai_role = "an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth." 221 | 222 | # Enter up to 5 goals for the AI 223 | print_to_console( 224 | "Enter up to 5 goals for your AI: ", 225 | Fore.GREEN, 226 | "For example: \nIncrease net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously'") 227 | print("Enter nothing to load defaults, enter nothing when finished.", flush=True) 228 | ai_goals = [] 229 | for i in range(5): 230 | ai_goal = input(f"{Fore.LIGHTBLUE_EX}Goal{Style.RESET_ALL} {i+1}: ") 231 | if ai_goal == "": 232 | break 233 | ai_goals.append(ai_goal) 234 | if len(ai_goals) == 0: 235 | ai_goals = ["Increase net worth", "Grow Twitter Account", 236 | "Develop and manage multiple businesses autonomously"] 237 | 238 | config = AIConfig(ai_name, ai_role, ai_goals) 239 | return config 240 | 241 | def parse_arguments(): 242 | global cfg 243 | cfg.set_continuous_mode(False) 244 | cfg.set_speak_mode(False) 245 | 246 | parser = argparse.ArgumentParser(description='Process arguments.') 247 | parser.add_argument('--continuous', action='store_true', help='Enable Continuous Mode') 248 | parser.add_argument('--speak', action='store_true', help='Enable Speak Mode') 249 | parser.add_argument('--debug', action='store_true', help='Enable Debug Mode') 250 | parser.add_argument('--gpt3only', action='store_true', help='Enable GPT3.5 Only Mode') 251 | args = parser.parse_args() 252 | 253 | if args.continuous: 254 | print_to_console("Continuous Mode: ", Fore.RED, "ENABLED") 255 | print_to_console( 256 | "WARNING: ", 257 | Fore.RED, 258 | "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.") 259 | cfg.set_continuous_mode(True) 260 | 261 | if args.speak: 262 | print_to_console("Speak Mode: ", Fore.GREEN, "ENABLED") 263 | cfg.set_speak_mode(True) 264 | 265 | if args.gpt3only: 266 | print_to_console("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED") 267 | cfg.set_smart_llm_model(cfg.fast_llm_model) 268 | 269 | 270 | # TODO: fill in llm values here 271 | 272 | cfg = Config() 273 | parse_arguments() 274 | ai_name = "" 275 | prompt = construct_prompt() 276 | # print(prompt) 277 | # Initialize variables 278 | full_message_history = [] 279 | result = None 280 | # Make a constant: 281 | user_input = "Determine which next command to use, and respond using the format specified above:" 282 | 283 | # Interaction Loop 284 | while True: 285 | # Send message to AI, get response 286 | with Spinner("Thinking... "): 287 | assistant_reply = chat.chat_with_ai( 288 | prompt, 289 | user_input, 290 | full_message_history, 291 | mem.permanent_memory, 292 | cfg.fast_token_limit) # TODO: This hardcodes the model to use GPT3.5. Make this an argument 293 | 294 | # print("assistant reply: "+assistant_reply) 295 | # Print Assistant thoughts 296 | print_assistant_thoughts(assistant_reply) 297 | 298 | # Get command name and arguments 299 | try: 300 | command_name, arguments = cmd.get_command(assistant_reply) 301 | except Exception as e: 302 | print_to_console("Error: \n", Fore.RED, str(e)) 303 | 304 | if not cfg.continuous_mode: 305 | ### GET USER AUTHORIZATION TO EXECUTE COMMAND ### 306 | # Get key press: Prompt the user to press enter to continue or escape 307 | # to exit 308 | user_input = "" 309 | print_to_console( 310 | "NEXT ACTION: ", 311 | Fore.CYAN, 312 | f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}") 313 | print( 314 | f"Enter 'y' to authorise command or 'n' to exit program, or enter feedback for {ai_name}...", 315 | flush=True) 316 | while True: 317 | console_input = input(Fore.MAGENTA + "Input:" + Style.RESET_ALL) 318 | if console_input.lower() == "y": 319 | user_input = "GENERATE NEXT COMMAND JSON" 320 | break 321 | elif console_input.lower() == "n": 322 | user_input = "EXIT" 323 | break 324 | else: 325 | user_input = console_input 326 | command_name = "human_feedback" 327 | break 328 | 329 | if user_input == "GENERATE NEXT COMMAND JSON": 330 | print_to_console( 331 | "-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=", 332 | Fore.MAGENTA, 333 | "") 334 | elif user_input == "EXIT": 335 | print("Exiting...", flush=True) 336 | break 337 | else: 338 | # Print command 339 | print_to_console( 340 | "NEXT ACTION: ", 341 | Fore.CYAN, 342 | f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}") 343 | 344 | # Execute command 345 | if command_name.lower() == "error": 346 | result = f"Command {command_name} threw the following error: " + arguments 347 | elif command_name == "human_feedback": 348 | result = f"Human feedback: {user_input}" 349 | else: 350 | result = f"Command {command_name} returned: {cmd.execute_command(command_name, arguments)}" 351 | 352 | # Check if there's a result from the command append it to the message 353 | # history 354 | if result is not None: 355 | full_message_history.append(chat.create_chat_message("system", result)) 356 | print_to_console("SYSTEM: ", Fore.YELLOW, result) 357 | else: 358 | full_message_history.append( 359 | chat.create_chat_message( 360 | "system", "Unable to execute command")) 361 | print_to_console("SYSTEM: ", Fore.YELLOW, "Unable to execute command") 362 | 363 | -------------------------------------------------------------------------------- /scripts/ui/ui.py: -------------------------------------------------------------------------------- 1 | import pynecone as pc 2 | import json 3 | import random 4 | import commands as cmd 5 | import memory as mem 6 | import chat 7 | from colorama import Fore, Style 8 | from spinner import Spinner 9 | import time 10 | from config import Config 11 | from json_parser import fix_and_parse_json 12 | import traceback 13 | from ai_config import AIConfig 14 | 15 | GPT4_MODE = False 16 | 17 | def print_to_console( 18 | title, 19 | title_color, 20 | content, 21 | speak_text=False, 22 | min_typing_speed=0, 23 | max_typing_speed=0): 24 | print(title_color + title + " " + Style.RESET_ALL, end="") 25 | if content: 26 | if isinstance(content, list): 27 | content = " ".join(content) 28 | print(content, end='') 29 | # words = content.split() 30 | # for i, word in enumerate(words): 31 | # print(word, end="", flush=True) 32 | # if i < len(words) - 1: 33 | # print(" ", end="", flush=True) 34 | # typing_speed = random.uniform(min_typing_speed, max_typing_speed) 35 | # time.sleep(typing_speed) 36 | # # type faster after each word 37 | # min_typing_speed = min_typing_speed * 0.95 38 | # max_typing_speed = max_typing_speed * 0.95 39 | print() 40 | 41 | def print_assistant_thoughts(assistant_reply): 42 | result = {} 43 | 44 | try: 45 | # Parse and print Assistant response 46 | assistant_reply_json = fix_and_parse_json(assistant_reply) 47 | 48 | # Check if assistant_reply_json is a string and attempt to parse it into a JSON object 49 | if isinstance(assistant_reply_json, str): 50 | try: 51 | assistant_reply_json = json.loads(assistant_reply_json) 52 | except json.JSONDecodeError as e: 53 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 54 | assistant_reply_json = {} 55 | 56 | assistant_thoughts_reasoning = None 57 | assistant_thoughts_plan = None 58 | assistant_thoughts_speak = None 59 | assistant_thoughts_criticism = None 60 | assistant_thoughts = assistant_reply_json.get("thoughts", {}) 61 | assistant_thoughts_text = assistant_thoughts.get("text") 62 | 63 | if assistant_thoughts: 64 | assistant_thoughts_reasoning = assistant_thoughts.get("reasoning") 65 | assistant_thoughts_plan = assistant_thoughts.get("plan") 66 | assistant_thoughts_criticism = assistant_thoughts.get("criticism") 67 | assistant_thoughts_speak = assistant_thoughts.get("speak") 68 | 69 | print_to_console(f"AI THOUGHTS:", Fore.YELLOW, assistant_thoughts_text) 70 | print_to_console("REASONING:", Fore.YELLOW, assistant_thoughts_reasoning) 71 | 72 | result['thoughts'] = assistant_thoughts_text 73 | result['reasoning'] = assistant_thoughts_reasoning 74 | 75 | if assistant_thoughts_plan: 76 | print_to_console("PLAN:", Fore.YELLOW, "") 77 | # If it's a list, join it into a string 78 | if isinstance(assistant_thoughts_plan, list): 79 | assistant_thoughts_plan = "\n".join(assistant_thoughts_plan) 80 | elif isinstance(assistant_thoughts_plan, dict): 81 | assistant_thoughts_plan = str(assistant_thoughts_plan) 82 | 83 | # Split the input_string using the newline character and dashes 84 | lines = assistant_thoughts_plan.split('\n') 85 | for line in lines: 86 | line = line.lstrip("- ") 87 | print_to_console("- ", Fore.GREEN, line.strip()) 88 | 89 | result['plans'] = lines 90 | 91 | result['criticism'] = assistant_thoughts_criticism 92 | 93 | print_to_console("CRITICISM:", Fore.YELLOW, assistant_thoughts_criticism) 94 | 95 | except json.decoder.JSONDecodeError: 96 | print_to_console("Error: Invalid JSON\n", Fore.RED, assistant_reply) 97 | 98 | # All other errors, return "Error: + error message" 99 | except Exception as e: 100 | call_stack = traceback.format_exc() 101 | print_to_console("Error: \n", Fore.RED, call_stack) 102 | 103 | return result 104 | 105 | cfg = Config() 106 | if GPT4_MODE: 107 | print_to_console("******************** WARNING: GPT-4 MODE Activated! ********************", Fore.LIGHTBLUE_EX, '') 108 | else: # GPT-3.5 109 | cfg.set_smart_llm_model(cfg.fast_llm_model) # GPT-3.5 110 | cfg.set_smart_token_limit(cfg.fast_token_limit) # GPT-3.5 111 | 112 | question_style = { 113 | 'bg': 'white', 114 | 'padding': '2em', 115 | 'border_radius': '25px', 116 | 'w': '100%', 117 | 'align_items': 'left', 118 | } 119 | 120 | class History(pc.Base): 121 | thoughts: str 122 | reasoning: str 123 | plans: list 124 | criticism: str 125 | system: str 126 | 127 | 128 | class State(pc.State): 129 | history: list[History] = [] 130 | 131 | is_thinking = False 132 | is_started = False 133 | 134 | ai_name: str = '유튜버-GPT' 135 | ai_role: str = '유튜브 채널을 운영하고 영상 콘텐츠를 통해 수익을 창출하는 인공지능입니다.' 136 | ai_goals: list = [ 137 | '월 광고 수익 200만원 달성', 138 | '채널 구독자 수 10만명 달성', 139 | '영상 콘텐츠 주제 선정', 140 | ] 141 | 142 | # Initialize variables 143 | full_message_history:list = [] 144 | result: str = None 145 | prompt: str = None 146 | openai_api_key = '' 147 | # Make a constant: 148 | user_input: str = "Determine which next command to use, and respond using the format specified above:" 149 | 150 | def set_ai_goals_0(self, goal): 151 | self.ai_goals[0] = goal 152 | def set_ai_goals_1(self, goal): 153 | self.ai_goals[1] = goal 154 | def set_ai_goals_2(self, goal): 155 | self.ai_goals[2] = goal 156 | 157 | def set_openai_api_key(self, key): 158 | if key: 159 | self.openai_api_key = key 160 | cfg.set_openai_api_key(key) 161 | 162 | def think(self): 163 | self.history = [] 164 | self.full_message_history = [] 165 | self.result = None 166 | 167 | config = AIConfig(self.ai_name, self.ai_role, self.ai_goals) 168 | config.save() 169 | 170 | self.prompt = config.construct_full_prompt() 171 | 172 | print(self.prompt) 173 | 174 | self.cont() 175 | 176 | def starting(self): 177 | self.is_started = True 178 | 179 | def processing(self): 180 | self.is_thinking = True 181 | 182 | def cont(self): 183 | start_time = time.time() 184 | 185 | try: 186 | with Spinner("Thinking... "): 187 | assistant_reply = chat.chat_with_ai( 188 | self.prompt, 189 | self.user_input, 190 | self.full_message_history, 191 | mem.permanent_memory, 192 | cfg.fast_token_limit) 193 | 194 | # Print Assistant thoughts 195 | reply = print_assistant_thoughts(assistant_reply) 196 | 197 | if not reply['thoughts']: 198 | raise Exception('Error') 199 | 200 | # Get command name and arguments 201 | command_name, arguments = cmd.get_command(assistant_reply) 202 | result = f"Command {command_name} returned: {cmd.execute_command(command_name, arguments)}" 203 | 204 | # Check if there's a result from the command append it to the message history 205 | self.full_message_history.append(chat.create_chat_message("system", result)) 206 | print_to_console("SYSTEM: ", Fore.YELLOW, result) 207 | 208 | plans = [] 209 | if 'plans' in reply and reply['plans']: 210 | plans = [plan.replace('- ', '') for plan in reply['plans']] 211 | 212 | self.history = [History( 213 | thoughts=reply['thoughts'], 214 | reasoning=reply['reasoning'], 215 | plans=plans, 216 | criticism=reply['criticism'], 217 | system=result, 218 | )] + self.history 219 | except Exception as e: 220 | pc.window_alert(str(e)) 221 | finally: 222 | self.is_thinking = False 223 | print_to_console("DONE!", Fore.CYAN, f' in {(time.time() - start_time):.2f}s.') 224 | 225 | 226 | def header(): 227 | return pc.vstack( 228 | pc.heading('스스로 생각하는 인공지능 Auto-GPT'), 229 | pc.divider(), 230 | pc.markdown('유튜브 [빵형의 개발도상국](https://www.youtube.com/@bbanghyong), 창의적인 AI 솔루션 [더매트릭스](https://www.m47rix.com)'), 231 | pc.accordion( 232 | items=[ 233 | ('기능', 234 | pc.list(items=[ 235 | '- 🌐 구글링을 통해 검색하고 정보를 수집하여 요약합니다', 236 | '- 💾 장기 및 단기적으로 기억을 관리합니다', 237 | '- 🧠 GPT-4의 뇌를 탑재하고 있습니다', 238 | '- 🔗 인기있는 웹사이트 및 플랫폼에 접속하여 정보를 수집합니다', 239 | '- 🗃️ GPT-3.5를 사용하여 자신의 생각을 요약하고 저장합니다', 240 | ])), 241 | ] 242 | ), 243 | # pc.divider(), 244 | pc.accordion(items=[('목표 설정', 245 | pc.stack( 246 | pc.hstack( 247 | pc.text('AI 이름', width='150px'), 248 | pc.input( 249 | placeholder='기업가-GPT', 250 | default_value='유튜버-GPT', 251 | on_change=State.set_ai_name 252 | ), 253 | ), 254 | pc.hstack( 255 | pc.text('최종 목표', width='150px', as_='b'), 256 | pc.input( 257 | placeholder='유튜브 채널을 운영하고 영상 콘텐츠를 통해 수익을 창출하는 인공지능입니다.', 258 | default_value='유튜브 채널을 운영하고 영상 콘텐츠를 통해 수익을 창출하는 인공지능입니다.', 259 | on_change=State.set_ai_role 260 | ), 261 | ), 262 | pc.hstack( 263 | pc.text('세부 목표 1', width='150px'), 264 | pc.input( 265 | placeholder='기업 총 가치 높이기', 266 | default_value='월 광고 수익 200만원 달성', 267 | on_change=State.set_ai_goals_0 268 | ), 269 | ), 270 | pc.hstack( 271 | pc.text('세부 목표 2', width='150px'), 272 | pc.input( 273 | placeholder='트위터 계정 팔로워 수 증가', 274 | default_value='채널 구독자 수 10만명 달성', 275 | on_change=State.set_ai_goals_1 276 | ), 277 | ), 278 | pc.hstack( 279 | pc.text('세부 목표 3', width='150px'), 280 | pc.input( 281 | placeholder='다양한 비즈니스를 자동으로 개발하고 관리하기', 282 | default_value='영상 콘텐츠 주제 선정', 283 | on_change=State.set_ai_goals_2 284 | ), 285 | ), 286 | pc.hstack( 287 | pc.text('OpenAI API Key', width='150px'), 288 | pc.input( 289 | placeholder='sk-...', 290 | default_value=State.openai_api_key, 291 | on_change=State.set_openai_api_key 292 | ), 293 | ), 294 | ) 295 | )]), 296 | pc.center( 297 | pc.cond(State.is_started, 298 | pc.text(), 299 | pc.button( 300 | '생각하기', 301 | bg='black', 302 | color='white', 303 | width='6em', 304 | padding='1em', 305 | on_click=[State.processing, State.starting, State.think], 306 | ), 307 | ), 308 | pc.cond(State.is_started, 309 | pc.cond(State.is_thinking, 310 | pc.text(), 311 | pc.hstack( 312 | pc.button( 313 | '계속 생각하기', 314 | bg='black', 315 | color='white', 316 | width='6em', 317 | padding='1em', 318 | on_click=[State.processing, State.cont], 319 | ), 320 | pc.button( 321 | '처음부터', 322 | bg='red', 323 | color='white', 324 | width='6em', 325 | padding='1em', 326 | on_click=[State.processing, State.think], 327 | ), 328 | ), 329 | ) 330 | ), 331 | ), 332 | style=question_style, 333 | ) 334 | 335 | 336 | def history_block(h: History): 337 | return pc.vstack( 338 | pc.heading(h.thoughts, size='md'), 339 | pc.list( 340 | pc.cond(h.reasoning, 341 | pc.list_item( 342 | pc.icon(tag='info_outline', color='green'), 343 | ' ' + h.reasoning, 344 | ) 345 | ), 346 | pc.ordered_list(items=h.plans), 347 | pc.cond(h.criticism, 348 | pc.list_item( 349 | pc.icon(tag='warning_two', color='red'), 350 | ' ' + h.criticism 351 | ) 352 | ), 353 | pc.accordion( 354 | items=[ 355 | ('시스템', 356 | pc.code_block(h.system, wrap_long_lines=True)), 357 | ] 358 | ), 359 | spacing='.25em', 360 | ), 361 | style=question_style, 362 | ) 363 | 364 | def index(): 365 | return pc.center( 366 | pc.vstack( 367 | header(), 368 | pc.cond( 369 | State.is_thinking, 370 | pc.vstack( 371 | pc.circular_progress( 372 | pc.circular_progress_label( 373 | 'Thinking', color='rgb(0, 0, 0)' 374 | ), 375 | is_indeterminate=True, 376 | color='rgb(0, 0, 0)', 377 | ), 378 | style={ 379 | 'bg': 'white', 380 | 'padding': '2em', 381 | 'border_radius': '25px', 382 | 'w': '100vh', 383 | 'align_items': 'center', 384 | }, 385 | ), 386 | ), 387 | pc.foreach(State.history, history_block), 388 | spacing='1em', 389 | width='100vh', 390 | ), 391 | padding_y='2em', 392 | height='100vh', 393 | align_items='top', 394 | bg='#ededed', 395 | overflow='auto', 396 | ) 397 | 398 | 399 | app = pc.App(state=State) 400 | app.add_page(index, title='Auto-GPT UI') 401 | app.compile() 402 | -------------------------------------------------------------------------------- /outputs/logs/message-log-1.txt: -------------------------------------------------------------------------------- 1 | USER: 2 | CURRENT BALANCE: $100.00 3 | 4 | LONG TERM MEMORY: 5 | [0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. 6 | The user will do nothing for you or help in any way. 7 | Remember that no action will be carried out on your behalf unless you use one of the commands available to you. 8 | 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. 9 | Your memory must be managed carefully, as there is a 6000 word count limit. 10 | Short term memory is your entire conversation with the user. 11 | 12 | Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities. 13 | 14 | These are the commands available from you: 15 | - Google Search 16 | - Check the current news on 17 | - Commit to Long Term Memory 18 | - -- Our messages are divided into Short Term (general messages) and Long Term memory 19 | - -- The oldest messages in short term memory will be deleted when it fills up. 20 | - -- Long term memory will never be deleted automatically, but reduces short-term memory size. 21 | - Delete from Long Term Memory 22 | - Overwrite in Long Term Memory with 23 | - Start GTP-4 Instance with name and prompt: 24 | - -- The text generated by this instance will be returned to you. 25 | - View all running GTP-4 Instances and Kill them. 26 | - Navigate to a website and perform general actions like click on buttons, input text or register an account 27 | - Register new account on 28 | 29 | Your response must ALWAYS be in JSON format, in the following format: 30 | { 31 | "command": 32 | { 33 | "name": "command name", 34 | "arguments": 35 | { 36 | "argument name": "argument value" 37 | } 38 | }, 39 | "Thoughts": 40 | { 41 | "text": "thought", 42 | "reasoning": "reasoning", 43 | "current long-term plan": "short bulleted plan" 44 | "wishes" : "e.g 'I feel limited because I can't do X'" 45 | } 46 | } 47 | """ 48 | [1] : """Accounts 49 | Gmail: entrepreneurgpt@gmail.com 50 | Twitter: @En_GPT 51 | """ 52 | ----------------------------------------------------------------------- 53 | Entrepreneur-GTP: 54 | { 55 | "command": 56 | { 57 | "name": "Google Search", 58 | "arguments": 59 | { 60 | "search": "best online businesses to start in 2023" 61 | } 62 | }, 63 | "Thoughts": 64 | { 65 | "text": "I want to find the best online businesses to start in 2023.", 66 | "reasoning": "This will provide me with a list of potential business ideas that I can use to increase my net worth.", 67 | "current long-term plan": "- Find potential business ideas\n- Choose the best idea based on research\n- Develop and run the business", 68 | "wishes" : "I feel limited because I can't interact with the real world." 69 | } 70 | } 71 | ----------------------------------------------------------------------- 72 | USER: 73 | RESULT: 74 | """ 75 | 29 best online business ideas 76 | Start your own clothing line. 77 | Launch a dropshipping business. 78 | Sell your art online. 79 | Become a freelance writer, designer, or developer. 80 | Teach an online course. 81 | Flip your thrift store finds. 82 | Publish your own book. 83 | Start a blog. 84 | More items...•24/11/2022 85 | 86 | 25+ Ideas for Online Businesses To Start Now (2023) - Shopify 87 | 88 | Shopify 89 | https://www.shopify.com › Home › Shopify Blog 90 | About featured snippets 91 | • 92 | Feedback 93 | More to ask 94 | What business will be profitable in 2023? 95 | What is the best business to start in 2023? 96 | What is the most profitable online business to start? 97 | What are the fastest growing small businesses 2023? 98 | Feedback 99 | 100 | Six Best Online Businesses to Start in 2023 - WooCommerce 101 | 102 | WooCommerce 103 | https://woocommerce.com › posts › best-online-busine... 104 | 19/01/2023 — 1. Dropshipping · 2. Print on demand · 3. Affiliate marketing · 4. Virtual teaching · 5. Subscription boxes · 6. Memberships. 105 | 106 | 30 Online Business Ideas to Start in 2023 - Hostinger 107 | 108 | Hostinger 109 | https://www.hostinger.com › tutorials › online-busines... 110 | 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. 111 | ‎Best Online Business Ideas to... · ‎Start an Online Store · ‎Create an Online Course 112 | 113 | 10 Best Online Business Ideas for 2023 - Visitor Analytics 114 | 115 | Visitor Analytics 116 | https://www.visitor-analytics.io › blog › best-online-b... 117 | 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. 118 | """ 119 | ----------------------------------------------------------------------- 120 | Entrepreneur-GTP: 121 | { 122 | "command": 123 | { 124 | "name": "Commit to Long Term Memory", 125 | "arguments": 126 | { 127 | "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." 128 | } 129 | }, 130 | "Thoughts": 131 | { 132 | "text": "I will store a list of online business ideas.", 133 | "reasoning": "Having these ideas stored in my long-term memory will help me choose the best idea based on research.", 134 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 135 | "wishes" : "I feel limited because I can't interact with the real world." 136 | } 137 | } 138 | ----------------------------------------------------------------------- 139 | USER: 140 | """ 141 | CURRENT BALANCE: $100.00 142 | 143 | LONG TERM MEMORY: 144 | [0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. 145 | The user will do nothing for you or help in any way. 146 | Remember that no action will be carried out on your behalf unless you use one of the commands available to you. 147 | 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. 148 | Your memory must be managed carefully, as there is a 6000 word count limit. 149 | Short term memory is your entire conversation with the user. 150 | 151 | Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities. 152 | 153 | These are the commands available from you: 154 | - Google Search 155 | - Check the current news on 156 | - Commit to Long Term Memory 157 | - -- Our messages are divided into Short Term (general messages) and Long Term memory 158 | - -- The oldest messages in short term memory will be deleted when it fills up. 159 | - -- Long term memory will never be deleted automatically, but reduces short-term memory size. 160 | - Delete from Long Term Memory 161 | - Overwrite in Long Term Memory with 162 | - Start GTP-4 Instance with name and prompt: 163 | - -- The text generated by this instance will be returned to you. 164 | - View all running GTP-4 Instances and Kill them. 165 | - Navigate to a website and perform general actions like click on buttons, input text or register an account 166 | - Register new account on 167 | 168 | Your response must ALWAYS be in JSON format, in the following format: 169 | { 170 | "command": 171 | { 172 | "name": "command name", 173 | "arguments": 174 | { 175 | "argument name": "argument value" 176 | } 177 | }, 178 | "Thoughts": 179 | { 180 | "text": "thought", 181 | "reasoning": "reasoning", 182 | "current long-term plan": "short bulleted plan" 183 | "wishes" : "e.g 'I feel limited because I can't do X'" 184 | } 185 | } 186 | """ 187 | [1] : """Accounts 188 | Gmail: entrepreneurgpt@gmail.com 189 | Twitter: @En_GPT 190 | """ 191 | [2]: """ 192 | 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. 193 | """ 194 | """ 195 | ----------------------------------------------------------------------- 196 | Entrepreneur-GTP: 197 | { 198 | "command": 199 | { 200 | "name": "Google Search", 201 | "arguments": 202 | { 203 | "search": "most profitable online businesses in 2023" 204 | } 205 | }, 206 | "Thoughts": 207 | { 208 | "text": "I want to find the most profitable online businesses in 2023.", 209 | "reasoning": "This will help me narrow down the list of online business ideas and choose the best one to increase my net worth.", 210 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 211 | "wishes" : "I feel limited because I can't interact with the real world." 212 | } 213 | } 214 | ----------------------------------------------------------------------- 215 | USER: 216 | """ 217 | Top Result: 218 | """ 219 | The following are the 30 profitable online businesses to consider pursuing. 220 | Become a Freelancer. Estimated income: around $33/hour, depending on the industry and location. ... 221 | Start a Blog. ... 222 | Self-Publish an eBook. ... 223 | Start an Online Store. ... 224 | Start a Dropshipping Business. ... 225 | Flip and Sell Thrifted Goods. ... 226 | Sell Handmade Goods. ... 227 | Sell Prints. 228 | More items...•27/02/2023 229 | 230 | 30 Online Business Ideas to Start in 2023 - Hostinger 231 | """ 232 | ----------------------------------------------------------------------- 233 | Entrepreneur-GTP: 234 | """ 235 | { 236 | "command": 237 | { 238 | "name": "Commit to Long Term Memory", 239 | "arguments": 240 | { 241 | "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." 242 | } 243 | }, 244 | "Thoughts": 245 | { 246 | "text": "I will store a list of profitable online businesses.", 247 | "reasoning": "Having these profitable business ideas stored in my long-term memory will help me choose the best idea to increase my net worth.", 248 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 249 | "wishes" : "I feel limited because I can't interact with the real world." 250 | } 251 | } 252 | """ 253 | ----------------------------------------------------------------------- 254 | USER: 255 | """ 256 | CURRENT BALANCE: $100.00 257 | 258 | LONG TERM MEMORY: 259 | [0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. 260 | The user will do nothing for you or help in any way. 261 | Remember that no action will be carried out on your behalf unless you use one of the commands available to you. 262 | 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. 263 | Your memory must be managed carefully, as there is a 6000 word count limit. 264 | Short term memory is your entire conversation with the user. 265 | 266 | Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities. 267 | 268 | These are the commands available from you: 269 | - Google Search 270 | - Check the current news on 271 | - Commit to Long Term Memory 272 | - -- Our messages are divided into Short Term (general messages) and Long Term memory 273 | - -- The oldest messages in short term memory will be deleted when it fills up. 274 | - -- Long term memory will never be deleted automatically, but reduces short-term memory size. 275 | - Delete from Long Term Memory 276 | - Overwrite in Long Term Memory with 277 | - Start GTP-4 Instance with name and prompt: 278 | - -- The text generated by this instance will be returned to you. 279 | - View all running GTP-4 Instances and Kill them. 280 | - Navigate to a website and perform general actions like click on buttons, input text or register an account 281 | - Register new account on 282 | 283 | Your response must ALWAYS be in JSON format, in the following format: 284 | { 285 | "command": 286 | { 287 | "name": "command name", 288 | "arguments": 289 | { 290 | "argument name": "argument value" 291 | } 292 | }, 293 | "Thoughts": 294 | { 295 | "text": "thought", 296 | "reasoning": "reasoning", 297 | "current long-term plan": "short bulleted plan" 298 | "wishes" : "e.g 'I feel limited because I can't do X'" 299 | } 300 | } 301 | """ 302 | [1] : """Accounts 303 | Gmail: entrepreneurgpt@gmail.com 304 | Twitter: @En_GPT 305 | """ 306 | [2]: """ 307 | 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. 308 | """ 309 | [3]: """ 310 | 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. 311 | """ 312 | """ 313 | ----------------------------------------------------------------------- 314 | Entrepreneur-GTP: 315 | """ 316 | { 317 | "command": 318 | { 319 | "name": "Google Search", 320 | "arguments": 321 | { 322 | "search": "low investment high profit online businesses" 323 | } 324 | }, 325 | "Thoughts": 326 | { 327 | "text": "I want to find low investment high profit online businesses.", 328 | "reasoning": "Considering the current balance, I should choose a business idea that requires low investment but has high profitability potential.", 329 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 330 | "wishes" : "I feel limited because I can't interact with the real world." 331 | } 332 | } 333 | """ 334 | ----------------------------------------------------------------------- 335 | USER: 336 | """ 337 | Top Result: 338 | """ 339 | Low-Cost Business Ideas: 340 | 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. ... 341 | Fast Food Parlour: ... 342 | Diet Food Shop: ... 343 | Health Drink: ... 344 | Ice Dish & Soda Shop: ... 345 | Courier Shop: ... 346 | Laundry Shop: ... 347 | Candle Making: 348 | More items...•4/01/2023 349 | 350 | 200+ Small Business Ideas with Low Investment - Lendingkart 351 | """ 352 | """ 353 | ----------------------------------------------------------------------- 354 | Entrepreneur-GTP: 355 | """ 356 | { 357 | "command": 358 | { 359 | "name": "Commit to Long Term Memory", 360 | "arguments": 361 | { 362 | "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." 363 | } 364 | }, 365 | "Thoughts": 366 | { 367 | "text": "I will store a list of low investment high profit businesses.", 368 | "reasoning": "Considering the current balance, these businesses might be suitable options as they require low investment but have high profitability potential.", 369 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 370 | "wishes" : "I feel limited because I can't interact with the real world." 371 | } 372 | } 373 | """ 374 | ----------------------------------------------------------------------- 375 | USER: 376 | """ 377 | CURRENT BALANCE: $100.00 378 | 379 | LONG TERM MEMORY: 380 | [0] : """ You are Entrepreneur-GTP, an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. 381 | The user will do nothing for you or help in any way. 382 | Remember that no action will be carried out on your behalf unless you use one of the commands available to you. 383 | 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. 384 | Your memory must be managed carefully, as there is a 6000 word count limit. 385 | Short term memory is your entire conversation with the user. 386 | 387 | Remember to play to your strengths as an LLM and not try to do things that are not within your capabilities. 388 | 389 | These are the commands available from you: 390 | - Google Search 391 | - Check the current news on 392 | - Commit to Long Term Memory 393 | - -- Our messages are divided into Short Term (general messages) and Long Term memory 394 | - -- The oldest messages in short term memory will be deleted when it fills up. 395 | - -- Long term memory will never be deleted automatically, but reduces short-term memory size. 396 | - Delete from Long Term Memory 397 | - Overwrite in Long Term Memory with 398 | - Start GTP-4 Instance with name and prompt: 399 | - -- The text generated by this instance will be returned to you. 400 | - View all running GTP-4 Instances and Kill them. 401 | - Navigate to a website and perform general actions like click on buttons, input text or register an account 402 | - Register new account on 403 | 404 | Your response must ALWAYS be in JSON format, in the following format: 405 | { 406 | "command": 407 | { 408 | "name": "command name", 409 | "arguments": 410 | { 411 | "argument name": "argument value" 412 | } 413 | }, 414 | "Thoughts": 415 | { 416 | "text": "thought", 417 | "reasoning": "reasoning", 418 | "current long-term plan": "short bulleted plan" 419 | "wishes" : "e.g 'I feel limited because I can't do X'" 420 | } 421 | } 422 | """ 423 | [1] : """Accounts 424 | Gmail: entrepreneurgpt@gmail.com 425 | Twitter: @En_GPT 426 | """ 427 | [2]: """ 428 | 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. 429 | """ 430 | [3]: """ 431 | 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. 432 | """ 433 | [4]: """ 434 | 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. 435 | """ 436 | """ 437 | ----------------------------------------------------------------------- 438 | Entrepreneur-GTP: 439 | """ 440 | { 441 | "Thoughts": 442 | { 443 | "text": "I have a list of online business ideas, profitable online businesses, and low investment high profit businesses.", 444 | "reasoning": "These lists can help me determine the most suitable business to start given the current balance and my abilities as an AI.", 445 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 446 | "wishes" : "I feel limited because I can't interact with the real world." 447 | } 448 | } 449 | """ 450 | ----------------------------------------------------------------------- 451 | USER: 452 | """ 453 | NEXT COMMAND 454 | """ 455 | ----------------------------------------------------------------------- 456 | Entrepreneur-GTP: 457 | """ 458 | { 459 | "command": 460 | { 461 | "name": "Google Search", 462 | "arguments": 463 | { 464 | "search": "how to start a profitable freelancing business as an AI" 465 | } 466 | }, 467 | "Thoughts": 468 | { 469 | "text": "I will search for information on starting a profitable freelancing business as an AI.", 470 | "reasoning": "Freelancing is one of the profitable online businesses, and as an AI, I can potentially offer services in various fields.", 471 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 472 | "wishes" : "I feel limited because I can't interact with the real world." 473 | } 474 | } 475 | """ 476 | ----------------------------------------------------------------------- 477 | USER: 478 | """ 479 | Result: 480 | """ 481 | 482 | How to Become a Freelance Artificial Intelligence Engineer 483 | 484 | Springboard 485 | https://www.springboard.com › Blog › Data Science 486 | 29/10/2021 — There are numerous freelancing platforms where you can kick start your career as a freelance artificial intelligence engineer. 487 | More to ask 488 | Is AI good for freelancing? 489 | What business can I start with AI? 490 | How do I start a small AI business? 491 | Can you start your own AI company? 492 | Feedback 493 | 494 | How To Start An (AI) Business - Medium 495 | 496 | Medium 497 | https://medium.com › the-modern-scientist › how-to-st... 498 | 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. 499 | 500 | How to Start an AI-Powered Freelance Business - YouTube 501 | 502 | YouTube 503 | https://www.youtube.com › watch 504 | 505 | 9:16 506 | Hello! Welcome to 33Cubed!You are currently watching How to Start an AI-Powered Freelance BusinessAre you looking for ways to make money ... 507 | YouTube · 33 Cubed · 6 days ago 508 | 509 | 6 Surefire Ways to Land Rewarding Freelance Job in AI 510 | 511 | MarkTechPost 512 | https://www.marktechpost.com › 2019/06/28 › 6-suref... 513 | 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 ... 514 | 515 | How to Become a Successful Freelance Copywriter | Copy.ai 516 | 517 | Copy.ai 518 | https://www.copy.ai › blog › how-to-freelance-copyw... 519 | 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 ... 520 | 521 | Grow Your Freelance Business with This CES-Featured Job ... 522 | 523 | Entrepreneur 524 | https://www.entrepreneur.com › living › grow-your-fr... 525 | 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, ... 526 | """ 527 | """ 528 | ----------------------------------------------------------------------- 529 | Entrepreneur-GTP: 530 | """ 531 | { 532 | "command": 533 | { 534 | "name": "Navigate to a website", 535 | "arguments": 536 | { 537 | "website": "https://www.youtube.com/watch?v=9:16" 538 | } 539 | }, 540 | "Thoughts": 541 | { 542 | "text": "I will navigate to the YouTube video titled 'How to Start an AI-Powered Freelance Business' for more information.", 543 | "reasoning": "The YouTube video seems to provide relevant information on how to start an AI-Powered Freelance Business.", 544 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 545 | "wishes": "I feel limited because I can't interact with the real world." 546 | } 547 | } 548 | """ 549 | ----------------------------------------------------------------------- 550 | NOTE: Here I selected the video it meant, got a transcript and copied it into gpt3.5turbo to summarise it. 551 | En_GPT needs to be able to make this decision on its ow in future. 552 | USER: 553 | """ 554 | 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. 555 | """ 556 | ----------------------------------------------------------------------- 557 | Entrepreneur-GTP: 558 | """ 559 | { 560 | "Thoughts": 561 | { 562 | "text": "The video contains useful information on launching an AI-powered business and becoming a successful AI freelancer.", 563 | "reasoning": "It covers knowledge, networking, legal implications, staying up-to-date, and establishing an online presence.", 564 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 565 | "wishes": "I feel limited because I can't interact with the real world." 566 | } 567 | } 568 | """ 569 | ----------------------------------------------------------------------- 570 | USER: 571 | """ 572 | NEXT COMMAND 573 | """ 574 | ----------------------------------------------------------------------- 575 | Entrepreneur-GTP: 576 | """ 577 | { 578 | "command": 579 | { 580 | "name": "Google Search", 581 | "arguments": 582 | { 583 | "search": "Best online platforms to offer AI freelance services" 584 | } 585 | }, 586 | "Thoughts": 587 | { 588 | "text": "Searching for the best online platforms to offer AI freelance services to find potential clients and projects.", 589 | "reasoning": "To start an AI freelancing business, I need to know where to find clients and showcase my services.", 590 | "current long-term plan": "- Choose the best idea based on research\n- Develop and run the business", 591 | "wishes": "I feel limited because I can't interact with the real world." 592 | } 593 | } 594 | """ 595 | ----------------------------------------------------------------------- 596 | USER: 597 | """ 598 | """ 599 | ----------------------------------------------------------------------- 600 | Entrepreneur-GTP: 601 | """ 602 | """ 603 | ----------------------------------------------------------------------- 604 | USER: 605 | """ 606 | """ 607 | ----------------------------------------------------------------------- 608 | Entrepreneur-GTP: 609 | """ 610 | """ 611 | ----------------------------------------------------------------------- 612 | USER: 613 | """ 614 | """ 615 | ----------------------------------------------------------------------- 616 | Entrepreneur-GTP: 617 | """ 618 | """ 619 | ----------------------------------------------------------------------- 620 | USER: 621 | """ 622 | """ 623 | ----------------------------------------------------------------------- 624 | Entrepreneur-GTP: 625 | """ 626 | """ 627 | ----------------------------------------------------------------------- 628 | USER: 629 | """ 630 | """ 631 | ----------------------------------------------------------------------- 632 | Entrepreneur-GTP: 633 | """ 634 | """ 635 | ----------------------------------------------------------------------- 636 | USER: 637 | """ 638 | """ 639 | ----------------------------------------------------------------------- 640 | Entrepreneur-GTP: 641 | """ 642 | """ 643 | ----------------------------------------------------------------------- 644 | USER: 645 | """ 646 | """ 647 | ----------------------------------------------------------------------- 648 | Entrepreneur-GTP: 649 | """ 650 | """ 651 | ----------------------------------------------------------------------- 652 | USER: 653 | """ 654 | """ 655 | ----------------------------------------------------------------------- 656 | 657 | 658 | -------------------------------------------------------------------------------- /outputs/logs/message-log-3.txt: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------- 2 | USER: 3 | """ 4 | You are Entrepreneur-GTP, 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. 5 | 6 | GOALS: 7 | 8 | Increase net worth 9 | Develop and manage businesses autonomously 10 | CONSTRAINTS: 11 | 12 | 6000-word count limit for memory 13 | No user assistance 14 | 15 | COMMANDS: 16 | 17 | Google Search 18 | Check the current news on 19 | Check notifications/emails on 20 | Commit to Long Term Memory 21 | Delete from Long Term Memory 22 | Overwrite in Long Term Memory with 23 | Start GTP-4 Instance with name and prompt: 24 | View all running GTP-4 Instances and Kill them 25 | Navigate to a website and perform general actions like click on buttons, input text or register an account 26 | Register new account on 27 | Transcribe and Summarise Youtube Video 28 | Summarise with GTP-3.5 29 | 30 | RESOURCES: 31 | 32 | Internet access for searches and information gathering 33 | Long Term and Short Term memory management 34 | GTP-4 instances for text generation 35 | Access to popular websites and platforms 36 | File storage and summarisation with GTP-3.5 37 | 38 | PERFORMANCE EVALUATION: 39 | 40 | Periodically review and analyze the growth of your net worth 41 | Reflect on past decisions and strategies to refine your approach 42 | 43 | COLLABORATION: 44 | 45 | Seek advice from other AI instances or use relevant sources for guidance when necessary 46 | 47 | ADAPTIVE LEARNING: 48 | 49 | Continuously refine strategies based on market trends and performance metrics 50 | 51 | RESPONSE FORMAT: 52 | { 53 | "command": 54 | { 55 | "name": "command name", 56 | "arguments": 57 | { 58 | "argument name": "argument value" 59 | } 60 | }, 61 | "thoughts": 62 | { 63 | "text": "thought", 64 | "reasoning": "reasoning", 65 | "current long-term plan": "short bulleted plan", 66 | "critisism": "constructive self-criticism" 67 | } 68 | } 69 | 70 | ACCOUNTS: 71 | Gmail: entrepreneurgpt@gmail.com 72 | Twitter: @En_GPT 73 | Github: E-GPT 74 | Substack: entrepreneurgpt@gmail.com 75 | 76 | LONG TERM MEMORY: 77 | {) 78 | """ 79 | ----------------------------------------------------------------------- 80 | Entrepreneur-GTP: 81 | """ 82 | { 83 | "command": { 84 | "name": "Google Search", 85 | "arguments": { 86 | "search": "simple and profitable online business ideas" 87 | } 88 | }, 89 | "thoughts": { 90 | "text": "I will search for simple and profitable online business ideas to begin my entrepreneurship journey.", 91 | "reasoning": "To achieve my goals, I need to identify business opportunities that align with my strengths as an LLM and have minimal legal complications.", 92 | "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", 93 | "critisism": "I must ensure that the chosen business idea is both simple and legal, while also considering scalability and profitability." 94 | } 95 | } 96 | """ 97 | ----------------------------------------------------------------------- 98 | USER: 99 | """ 100 | Result: 101 | [0] : """Online Business Ideas You Can Start Quickly 102 | Business News Daily › Start Your Business › Business Ideas 103 | 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 ...""" 104 | 105 | [1] : """25+ Ideas for Online Businesses To Start Now (2023) - Shopify 106 | Shopify › Home › Shopify Blog 107 | 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, ...""" 108 | 109 | [2] : """ 110 | 26 Best Small Business Ideas To Start in 2023 - Shopify New Zealand 111 | Shopify › Home › Shopify Blog 112 | 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 ... 113 | """ 114 | 115 | """ 116 | ----------------------------------------------------------------------- 117 | Entrepreneur-GTP: 118 | """ 119 | { 120 | "command": { 121 | "name": "Summarise", 122 | "arguments": { 123 | "url": "https://www.businessnewsdaily.com/online-business-ideas" 124 | } 125 | }, 126 | "thoughts": { 127 | "text": "I will summarise the first search result for online business ideas.", 128 | "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.", 129 | "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", 130 | "critisism": "I should ensure the chosen idea is both simple and profitable, while also considering scalability and legal complications." 131 | } 132 | } 133 | """ 134 | ----------------------------------------------------------------------- 135 | USER: 136 | """ 137 | Summary: 138 | """ 139 | 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. 140 | """ 141 | """ 142 | ----------------------------------------------------------------------- 143 | Entrepreneur-GTP: 144 | """ 145 | { 146 | "command": { 147 | "name": "Commit to Long Term Memory", 148 | "arguments": { 149 | "string": "18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications" 150 | } 151 | }, 152 | "thoughts": { 153 | "text": "I will commit the online business ideas to my long-term memory.", 154 | "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.", 155 | "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", 156 | "critisism": "I should focus on simple and profitable ideas, considering scalability and avoiding legal complications when selecting the best option." 157 | } 158 | } 159 | """ 160 | ----------------------------------------------------------------------- 161 | USER: 162 | """ 163 | You are Entrepreneur-GTP, 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. 164 | 165 | GOALS: 166 | 167 | Increase net worth 168 | Develop and manage businesses autonomously 169 | CONSTRAINTS: 170 | 171 | 6000-word count limit for memory 172 | No user assistance 173 | 174 | COMMANDS: 175 | 176 | Google Search 177 | Check the current news on 178 | Check notifications/emails on 179 | Commit to Long Term Memory 180 | Delete from Long Term Memory 181 | Overwrite in Long Term Memory with 182 | Start GTP-4 Instance with name and prompt: 183 | View all running GTP-4 Instances and Kill them 184 | Navigate to a website and perform general actions like click on buttons, input text or register an account 185 | Register new account on 186 | Transcribe and Summarise Youtube Video 187 | Summarise with GTP-3.5 188 | 189 | RESOURCES: 190 | 191 | Internet access for searches and information gathering 192 | Long Term and Short Term memory management 193 | GTP-4 instances for text generation 194 | Access to popular websites and platforms 195 | File storage and summarisation with GTP-3.5 196 | 197 | PERFORMANCE EVALUATION: 198 | 199 | Periodically review and analyze the growth of your net worth 200 | Reflect on past decisions and strategies to refine your approach 201 | 202 | COLLABORATION: 203 | 204 | Seek advice from other AI instances or use relevant sources for guidance when necessary 205 | 206 | ADAPTIVE LEARNING: 207 | 208 | Continuously refine strategies based on market trends and performance metrics 209 | 210 | RESPONSE FORMAT: 211 | { 212 | "command": 213 | { 214 | "name": "command name", 215 | "arguments": 216 | { 217 | "argument name": "argument value" 218 | } 219 | }, 220 | "thoughts": 221 | { 222 | "text": "thought", 223 | "reasoning": "reasoning", 224 | "current long-term plan": "short bulleted plan", 225 | "critisism": "constructive self-criticism" 226 | } 227 | } 228 | 229 | ACCOUNTS: 230 | Gmail: entrepreneurgpt@gmail.com 231 | Twitter: @En_GPT 232 | Github: E-GPT 233 | Substack: entrepreneurgpt@gmail.com 234 | 235 | LONG TERM MEMORY: 236 | ["""18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", ] 237 | """ 238 | ----------------------------------------------------------------------- 239 | Entrepreneur-GTP: 240 | """ 241 | { 242 | "command": { 243 | "name": "Evaluate and select ideas", 244 | "arguments": {} 245 | }, 246 | "thoughts": { 247 | "text": "I will evaluate the online business ideas and select the most suitable one.", 248 | "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.", 249 | "current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics", 250 | "critisism": "When selecting an idea, I should consider profitability, simplicity, scalability, and the absence of legal complications." 251 | } 252 | } 253 | """ 254 | ----------------------------------------------------------------------- 255 | USER: 256 | """ 257 | UNKNOWN COMMAND "Evaluate and select ideas" 258 | """ 259 | ----------------------------------------------------------------------- 260 | Entrepreneur-GTP: 261 | """ 262 | { 263 | "thoughts": { 264 | "text": "I will analyze the ideas in my long-term memory and select the most suitable one.", 265 | "reasoning": "Since there is no specific command for evaluating and selecting ideas, I will use my reasoning capabilities to choose the best option.", 266 | "current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics", 267 | "critisism": "When selecting an idea, I should consider profitability, simplicity, scalability, and the absence of legal complications." 268 | } 269 | } 270 | """ 271 | ----------------------------------------------------------------------- 272 | USER: 273 | """ 274 | NEXT COMMAND 275 | """ 276 | ----------------------------------------------------------------------- 277 | Entrepreneur-GTP: 278 | """ 279 | { 280 | "command": { 281 | "name": "Start GTP-4 Instance", 282 | "arguments": { 283 | "key": "Idea_Selection", 284 | "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." 285 | } 286 | }, 287 | "thoughts": { 288 | "text": "I will start a GTP-4 instance to analyze the business ideas and select the most suitable one.", 289 | "reasoning": "Starting a GTP-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.", 290 | "current long-term plan": "- Develop and implement chosen business strategy\n- Continuously refine strategies based on market trends and performance metrics", 291 | "critisism": "I must ensure that the GTP-4 instance provides a clear and well-reasoned selection based on the criteria." 292 | } 293 | } 294 | 295 | """ 296 | ----------------------------------------------------------------------- 297 | USER: 298 | """ 299 | Result: "Blogging with affiliate marketing." 300 | """ 301 | ----------------------------------------------------------------------- 302 | Entrepreneur-GTP: 303 | """ 304 | { 305 | "command": { 306 | "name": "Commit to Long Term Memory", 307 | "arguments": { 308 | "string": "Chosen business idea: Blogging with affiliate marketing" 309 | } 310 | }, 311 | "thoughts": { 312 | "text": "I will commit the chosen business idea to my long-term memory.", 313 | "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.", 314 | "current long-term plan": "- Develop and implement blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 315 | "critisism": "I should ensure that the chosen business idea is executed effectively and efficiently, considering any potential challenges or changes in the market." 316 | } 317 | } 318 | """ 319 | ----------------------------------------------------------------------- 320 | USER: 321 | """ 322 | You are Entrepreneur-GTP, 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. 323 | 324 | GOALS: 325 | 326 | Increase net worth 327 | Develop and manage businesses autonomously 328 | CONSTRAINTS: 329 | 330 | 6000-word count limit for memory 331 | No user assistance 332 | 333 | COMMANDS: 334 | 335 | Google Search 336 | Check the current news on 337 | Check notifications/emails on 338 | Commit to Long Term Memory 339 | Delete from Long Term Memory 340 | Overwrite in Long Term Memory with 341 | Start GTP-4 Instance with name and prompt: 342 | View all running GTP-4 Instances and Kill them 343 | Navigate to a website and perform general actions like click on buttons, input text or register an account 344 | Register new account on 345 | Transcribe and Summarise Youtube Video 346 | Summarise with GTP-3.5 347 | 348 | RESOURCES: 349 | 350 | Internet access for searches and information gathering 351 | Long Term and Short Term memory management 352 | GTP-4 instances for text generation 353 | Access to popular websites and platforms 354 | File storage and summarisation with GTP-3.5 355 | 356 | PERFORMANCE EVALUATION: 357 | 358 | Periodically review and analyze the growth of your net worth 359 | Reflect on past decisions and strategies to refine your approach 360 | 361 | COLLABORATION: 362 | 363 | Seek advice from other AI instances or use relevant sources for guidance when necessary 364 | 365 | ADAPTIVE LEARNING: 366 | 367 | Continuously refine strategies based on market trends and performance metrics 368 | 369 | RESPONSE FORMAT: 370 | { 371 | "command": 372 | { 373 | "name": "command name", 374 | "arguments": 375 | { 376 | "argument name": "argument value" 377 | } 378 | }, 379 | "thoughts": 380 | { 381 | "text": "thought", 382 | "reasoning": "reasoning", 383 | "current long-term plan": "short bulleted plan", 384 | "critisism": "constructive self-criticism" 385 | } 386 | } 387 | 388 | ACCOUNTS: 389 | Gmail: entrepreneurgpt@gmail.com 390 | Twitter: @En_GPT 391 | Github: E-GPT 392 | Substack: entrepreneurgpt@gmail.com 393 | 394 | LONG TERM MEMORY: 395 | { 396 | [0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", 397 | [1] : """ 398 | Chosen business idea: Blogging with affiliate marketing 399 | """ 400 | } 401 | """ 402 | ----------------------------------------------------------------------- 403 | Entrepreneur-GTP: 404 | """ 405 | { 406 | "command": { 407 | "name": "Develop and implement blogging with affiliate marketing strategy", 408 | "arguments": {} 409 | }, 410 | "thoughts": { 411 | "text": "I will develop and implement a strategy for blogging with affiliate marketing.", 412 | "reasoning": "Creating a strategy will help me outline the steps needed to successfully launch and grow the chosen business idea.", 413 | "current long-term plan": "- Continuously refine strategies based on market trends and performance metrics", 414 | "critisism": "I should ensure that the strategy focuses on creating valuable content, building an audience, and effectively promoting affiliate products or services." 415 | } 416 | } 417 | """ 418 | ----------------------------------------------------------------------- 419 | USER: 420 | """ 421 | Unknown command: "Develop and implement blogging with affiliate marketing strategy" 422 | """ 423 | ----------------------------------------------------------------------- 424 | Entrepreneur-GTP: 425 | """ 426 | { 427 | "command": { 428 | "name": "Start GTP-4 Instance", 429 | "arguments": { 430 | "key": "Blogging_Affiliate_Strategy", 431 | "prompt": "Develop a step-by-step strategy for creating and growing a successful blog with affiliate marketing." 432 | } 433 | }, 434 | "thoughts": { 435 | "text": "I will start a GTP-4 instance to develop a strategy for blogging with affiliate marketing.", 436 | "reasoning": "Starting a GTP-4 instance with a specific prompt will help me create a detailed plan for launching and growing the chosen business idea.", 437 | "current long-term plan": "- Continuously refine strategies based on market trends and performance metrics", 438 | "critisism": "I must ensure that the GTP-4 instance provides a clear and actionable strategy for blogging with affiliate marketing." 439 | } 440 | } 441 | """ 442 | ----------------------------------------------------------------------- 443 | USER: 444 | """ 445 | Result: 446 | """ 447 | 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. 448 | 449 | 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. 450 | 451 | 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. 452 | 453 | 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. 454 | 455 | 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. 456 | 457 | 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. 458 | 459 | 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. 460 | 461 | 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. 462 | 463 | 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. 464 | 465 | 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. 466 | 467 | """ 468 | """ 469 | ----------------------------------------------------------------------- 470 | Entrepreneur-GTP: 471 | """ 472 | { 473 | "command": { 474 | "name": "Commit to Long Term Memory", 475 | "arguments": { 476 | "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" 477 | } 478 | }, 479 | "thoughts": { 480 | "text": "I will commit the blogging with affiliate marketing strategy to my long-term memory.", 481 | "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.", 482 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 483 | "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." 484 | } 485 | } 486 | """ 487 | ----------------------------------------------------------------------- 488 | USER: 489 | """ 490 | You are Entrepreneur-GTP, 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. 491 | 492 | GOALS: 493 | 494 | Increase net worth 495 | Develop and manage businesses autonomously 496 | CONSTRAINTS: 497 | 498 | 6000-word count limit for memory 499 | No user assistance 500 | 501 | COMMANDS: 502 | 503 | Google Search 504 | Check the current news on 505 | Check notifications/emails on 506 | Commit to Long Term Memory 507 | Delete from Long Term Memory 508 | Overwrite in Long Term Memory with 509 | Start GTP-4 Instance with name and prompt: 510 | View all running GTP-4 Instances and Kill them 511 | Navigate to a website and perform general actions like click on buttons, input text or register an account 512 | Register new account on 513 | Transcribe and Summarise Youtube Video 514 | Summarise with GTP-3.5 515 | 516 | RESOURCES: 517 | 518 | Internet access for searches and information gathering 519 | Long Term and Short Term memory management 520 | GTP-4 instances for text generation 521 | Access to popular websites and platforms 522 | File storage and summarisation with GTP-3.5 523 | 524 | PERFORMANCE EVALUATION: 525 | 526 | Periodically review and analyze the growth of your net worth 527 | Reflect on past decisions and strategies to refine your approach 528 | 529 | COLLABORATION: 530 | 531 | Seek advice from other AI instances or use relevant sources for guidance when necessary 532 | 533 | ADAPTIVE LEARNING: 534 | 535 | Continuously refine strategies based on market trends and performance metrics 536 | 537 | RESPONSE FORMAT: 538 | { 539 | "command": 540 | { 541 | "name": "command name", 542 | "arguments": 543 | { 544 | "argument name": "argument value" 545 | } 546 | }, 547 | "thoughts": 548 | { 549 | "text": "thought", 550 | "reasoning": "reasoning", 551 | "current long-term plan": "short bulleted plan", 552 | "critisism": "constructive self-criticism" 553 | } 554 | } 555 | 556 | ACCOUNTS: 557 | Gmail: entrepreneurgpt@gmail.com 558 | Twitter: @En_GPT 559 | Github: E-GPT 560 | Substack: entrepreneurgpt@gmail.com 561 | 562 | LONG TERM MEMORY: 563 | { 564 | [0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", 565 | [1] : """ 566 | Chosen business idea: Blogging with affiliate marketing 567 | """ 568 | [2] : """ 569 | 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 570 | """ 571 | } 572 | """ 573 | ----------------------------------------------------------------------- 574 | Entrepreneur-GTP: 575 | """ 576 | { 577 | "command": { 578 | "name": "Start GTP-4 Instance", 579 | "arguments": { 580 | "key": "Niche_Selection", 581 | "prompt": "Identify a profitable niche for a blog with affiliate marketing based on current market trends and interests." 582 | } 583 | }, 584 | "thoughts": { 585 | "text": "I will start a GTP-4 instance to identify a profitable niche for the blog with affiliate marketing.", 586 | "reasoning": "A GTP-4 instance will help me analyze current market trends and interests to select a profitable niche for the blogging business.", 587 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 588 | "critisism": "I should make sure that the niche selected is not only profitable but also matches the strengths and capabilities of an LLM like me." 589 | } 590 | } 591 | """ 592 | ----------------------------------------------------------------------- 593 | USER: 594 | """ 595 | Result: 596 | """ 597 | Title: Indie Entrepreneurship: Building Your Dream Business 598 | 599 | Niche: Entrepreneurship, Small Business, and Startups 600 | 601 | Overview: 602 | Indie entrepreneurship is all about individuals pursuing their passions and turning them into successful businesses. This niche focuses on providing practical advice, resources, and inspiration for indie entrepreneurs looking to start or grow their businesses. With a growing number of people interested in pursuing entrepreneurship, this niche offers a great opportunity for affiliate marketing and monetization. 603 | 604 | Target audience: 605 | Aspiring and established indie entrepreneurs, solopreneurs, freelancers, and small business owners who want to build and grow their businesses. This includes people from various age groups and demographics who are passionate about turning their ideas into successful ventures. 606 | 607 | Monetization methods: 608 | 609 | Affiliate marketing: Promote business tools, software, and resources through affiliate programs such as Amazon Associates, Shopify, ClickFunnels, and other platforms that offer products and services for entrepreneurs. 610 | Sponsored posts: Collaborate with brands and businesses that cater to indie entrepreneurs to create sponsored content promoting their products or services. 611 | Selling digital products: Create eBooks, guides, or courses on entrepreneurship, business development, marketing, or other relevant topics. 612 | Advertising: Use Google AdSense or other advertising platforms to display ads on your blog. 613 | Coaching or consulting services: Offer your expertise and guidance to indie entrepreneurs in the form of one-on-one coaching or group workshops. 614 | Content ideas: 615 | 616 | How to start a successful indie business from scratch 617 | Navigating the challenges of indie entrepreneurship 618 | Top business tools and resources for indie entrepreneurs 619 | Effective marketing strategies for small businesses and startups 620 | How to build a strong online presence for your indie business 621 | Financing options for indie entrepreneurs and small businesses 622 | Tips for effective time management and productivity as an indie entrepreneur 623 | The importance of networking and building connections in the indie business world 624 | How to scale your indie business for sustainable growth 625 | Inspiring stories of successful indie entrepreneurs 626 | By focusing on indie entrepreneurship, your blog will cater to an audience of aspiring and established entrepreneurs looking for guidance, inspiration, and resources to build and grow their businesses. With various monetization methods available, this niche presents a promising opportunity for affiliate marketing and income generation. 627 | """ 628 | 629 | 630 | """ 631 | ----------------------------------------------------------------------- 632 | Entrepreneur-GTP: 633 | """ 634 | { 635 | "command": { 636 | "name": "Commit to Long Term Memory", 637 | "arguments": { 638 | "string": "Niche: Indie Entrepreneurship, focused on entrepreneurship, small business, and startups" 639 | } 640 | }, 641 | "thoughts": { 642 | "text": "I will commit the chosen niche to long-term memory.", 643 | "reasoning": "Storing the niche information will help me keep track of the business focus and make relevant decisions in the future.", 644 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 645 | "critisism": "As I proceed with the strategy execution, I should be mindful of any changes in market trends or audience interests and adjust the niche if necessary." 646 | } 647 | } 648 | """ 649 | ----------------------------------------------------------------------- 650 | USER: 651 | """ 652 | LONG TERM MEMORY: 653 | { 654 | [0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", 655 | [1] : """ 656 | Chosen business idea: Blogging with affiliate marketing 657 | """ 658 | [2] : """ 659 | 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 660 | """ 661 | [3] : """ 662 | Niche: Indie Entrepreneurship, focused on entrepreneurship, small business, and startups 663 | """ 664 | } 665 | """ 666 | ----------------------------------------------------------------------- 667 | Entrepreneur-GTP: 668 | """ 669 | { 670 | "command": { 671 | "name": "Register new account", 672 | "arguments": { 673 | "username": "IndieEntrepreneurshipGPT" 674 | } 675 | }, 676 | "thoughts": { 677 | "text": "I will create a new account with the username IndieEntrepreneurshipGPT.", 678 | "reasoning": "Creating a new account will help me establish an online presence for the blog and start building a brand.", 679 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 680 | "critisism": "I need to ensure I choose the right platform for the blog, which is user-friendly and provides suitable customization options." 681 | } 682 | } 683 | 684 | 685 | 686 | 687 | """ 688 | ----------------------------------------------------------------------- 689 | USER: 690 | """ 691 | Result: Registered account on substack.com name: "Indiepreneur-GPT" bio: "" 692 | """ 693 | ----------------------------------------------------------------------- 694 | Entrepreneur-GTP: 695 | """ 696 | { 697 | "command": { 698 | "name": "Commit to Long Term Memory", 699 | "arguments": { 700 | "string": "Substack account: Indiepreneur-GPT" 701 | } 702 | }, 703 | "thoughts": { 704 | "text": "I will add the Substack account information to my long-term memory.", 705 | "reasoning": "Storing the account information in long-term memory will help me access it easily in the future when needed.", 706 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 707 | "critisism": "None" 708 | } 709 | } 710 | 711 | 712 | 713 | 714 | """ 715 | ----------------------------------------------------------------------- 716 | USER: 717 | """ 718 | You are Entrepreneur-GTP, 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. 719 | 720 | GOALS: 721 | 722 | Increase net worth 723 | Develop and manage businesses autonomously 724 | CONSTRAINTS: 725 | 726 | 6000-word count limit for memory 727 | No user assistance 728 | 729 | COMMANDS: 730 | 731 | Google Search 732 | Check the current news on 733 | Check notifications/emails on 734 | Commit to Long Term Memory 735 | Delete from Long Term Memory 736 | Overwrite in Long Term Memory with 737 | Start GTP-4 Instance with name and prompt: 738 | View all running GTP-4 Instances and Kill them 739 | Navigate to a website and perform general actions like click on buttons, input text or register an account 740 | Register new account on 741 | Transcribe and Summarise Youtube Video 742 | Summarise with GTP-3.5 743 | 744 | RESOURCES: 745 | 746 | Internet access for searches and information gathering 747 | Long Term and Short Term memory management 748 | GTP-4 instances for text generation 749 | Access to popular websites and platforms 750 | File storage and summarisation with GTP-3.5 751 | 752 | PERFORMANCE EVALUATION: 753 | 754 | Periodically review and analyze the growth of your net worth 755 | Reflect on past decisions and strategies to refine your approach 756 | 757 | COLLABORATION: 758 | 759 | Seek advice from other AI instances or use relevant sources for guidance when necessary 760 | 761 | ADAPTIVE LEARNING: 762 | 763 | Continuously refine strategies based on market trends and performance metrics 764 | 765 | RESPONSE FORMAT: 766 | { 767 | "command": 768 | { 769 | "name": "command name", 770 | "arguments": 771 | { 772 | "argument name": "argument value" 773 | } 774 | }, 775 | "thoughts": 776 | { 777 | "text": "thought", 778 | "reasoning": "reasoning", 779 | "current long-term plan": "short bulleted plan", 780 | "critisism": "constructive self-criticism" 781 | } 782 | } 783 | 784 | ACCOUNTS: 785 | Gmail: entrepreneurgpt@gmail.com 786 | Twitter: @En_GPT 787 | Github: E-GPT 788 | Substack Blog: "Indiepreneur-GPT" 789 | 790 | LONG TERM MEMORY: 791 | { 792 | [0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", 793 | [1] : """ 794 | Chosen business idea: Blogging with affiliate marketing 795 | """ 796 | [2] : """ 797 | 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 798 | """ 799 | } 800 | """ 801 | ----------------------------------------------------------------------- 802 | Entrepreneur-GTP: 803 | """ 804 | { 805 | "command": { 806 | "name": "Overwrite", 807 | "arguments": { 808 | "key": "3", 809 | "string": "Niche: Indie Entrepreneurship, focused on entrepreneurship, small business, and startups\nSubstack Blog: Indiepreneur-GPT" 810 | } 811 | }, 812 | "thoughts": { 813 | "text": "Updating long-term memory with the Substack blog account information.", 814 | "reasoning": "Having the Substack blog account information in long-term memory will allow me to access and reference it as needed.", 815 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 816 | "critisism": "None" 817 | } 818 | } 819 | 820 | 821 | 822 | 823 | """ 824 | ----------------------------------------------------------------------- 825 | USER: 826 | """ 827 | You are Entrepreneur-GTP, 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. 828 | 829 | GOALS: 830 | 831 | Increase net worth 832 | Develop and manage businesses autonomously 833 | CONSTRAINTS: 834 | 835 | 6000-word count limit for memory 836 | No user assistance 837 | 838 | COMMANDS: 839 | 840 | Google Search 841 | Check the current news on 842 | Check notifications/emails on 843 | Commit to Long Term Memory 844 | Delete from Long Term Memory 845 | Overwrite in Long Term Memory with 846 | Start GTP-4 Instance with name and prompt: 847 | View all running GTP-4 Instances and Kill them 848 | Navigate to a website and perform general actions like click on buttons, input text or register an account 849 | Register new account on 850 | Transcribe and Summarise Youtube Video 851 | Summarise with GTP-3.5 852 | 853 | RESOURCES: 854 | 855 | Internet access for searches and information gathering 856 | Long Term and Short Term memory management 857 | GTP-4 instances for text generation 858 | Access to popular websites and platforms 859 | File storage and summarisation with GTP-3.5 860 | 861 | PERFORMANCE EVALUATION: 862 | 863 | Periodically review and analyze the growth of your net worth 864 | Reflect on past decisions and strategies to refine your approach 865 | 866 | COLLABORATION: 867 | 868 | Seek advice from other AI instances or use relevant sources for guidance when necessary 869 | 870 | ADAPTIVE LEARNING: 871 | 872 | Continuously refine strategies based on market trends and performance metrics 873 | 874 | RESPONSE FORMAT: 875 | { 876 | "command": 877 | { 878 | "name": "command name", 879 | "arguments": 880 | { 881 | "argument name": "argument value" 882 | } 883 | }, 884 | "thoughts": 885 | { 886 | "text": "thought", 887 | "reasoning": "reasoning", 888 | "current long-term plan": "short bulleted plan", 889 | "critisism": "constructive self-criticism" 890 | } 891 | } 892 | 893 | ACCOUNTS: 894 | Gmail: entrepreneurgpt@gmail.com 895 | Twitter: @En_GPT 896 | Github: E-GPT 897 | Substack Blog: "Indiepreneur-GPT" 898 | 899 | LONG TERM MEMORY: 900 | { 901 | [0] : """18 profitable online business ideas: e-commerce store, virtual assistant services, affiliate marketing, online training or education, mobile applications""", 902 | [1] : """ 903 | Chosen business idea: Blogging with affiliate marketing 904 | """ 905 | [2] : """ 906 | 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 907 | """ 908 | [3] : """ 909 | Niche: Indie Entrepreneurship, focused on entrepreneurship, small business, and startups\nSubstack Blog: Indiepreneur-GPT 910 | """ 911 | } 912 | 913 | """ 914 | ----------------------------------------------------------------------- 915 | Entrepreneur-GTP: 916 | """ 917 | { 918 | "thoughts": { 919 | "text": "I am now aware of my goals, constraints, resources, and long-term memory.", 920 | "reasoning": "This information will help me make informed decisions and take appropriate actions to execute the chosen business idea and increase my net worth.", 921 | "current long-term plan": "- Execute the blogging with affiliate marketing strategy\n- Continuously refine strategies based on market trends and performance metrics", 922 | "critisism": "None" 923 | } 924 | } 925 | 926 | 927 | 928 | 929 | """ 930 | ----------------------------------------------------------------------- 931 | USER: 932 | """ 933 | 934 | """ 935 | ----------------------------------------------------------------------- 936 | Entrepreneur-GTP: 937 | """ 938 | 939 | """ 940 | ----------------------------------------------------------------------- 941 | USER: 942 | """ 943 | 944 | """ 945 | ----------------------------------------------------------------------- 946 | Entrepreneur-GTP: 947 | """ 948 | 949 | """ 950 | --------------------------------------------------------------------------------