Code Pack - autogpt

Fully Automated ChatGPT GPT4 based AutoGPT Agent Web Server Builder

Run an AutoGPT agent that builds a backend web server automatically using ChatGPT GPT4

Technologies
rust
Themes
autogpt
ai
chatgpt
Skill Level
intermediate
Last updated
2023-06-14

What's Inside

As seen on YouTube https://youtu.be/EOXtw9z0mBw and Udemy.

Automated ChatGPT agent which not only writes code, but tests and re-write code for you. In fact, you can request your agent to do just about anything.

The name of the AutoGPT is Auto-Gippity.

Auto-Gippity will simply be given a task, which it will break down and delegate to other agents to complete. Each agent will be responsible for testing its own output.

It will write the code in Rust. Not only that, but the agent itself writes code. What a time to be a developer.

AutoGPTs will only continue to become extremely relevant and highly sought after and combining these with the worlds favourite programming language, Rust, means that we can build an application which is blazingly fast, memory-safe, modern and robust.

Right now, there is a window of opportunity to learn this fantastic and uncommon technology before it takes over in software engineering.

You could build an AutoGPT that say, develops full stack SAAS websites end-to-end. With technologies like GPT-4 and soon beyond, such agents will only continue to improve in their performance.

Companies are looking for developers who can build such tools and SAAS startups have a window to be first. If you are curious as to how you can connect new AI technologies to change the world then THIS is the course for you.

Uses

-
Ask the agent to build any web server code you like
-
Agent will self correct on code and discard unavailable api endpoints automatically
-
Built in AI safety with human check

Requirements

-
You need to feel comfortable navigating basic rust code. If not, check out the Udemy course as this includes a Rust crash course
-
You need to feel confident in understanding what an AutoGPT agent is and have an idea for how you would want to use such an agent

START

What you need to get running

Ensure you have Rust, Cargo and Rustup installed:

This is not overly important, but when building this AutoGPT the developers versions are:

- rustup 1.26.0
- cargo 1.69.0

Step 1

Download package

Click the download button at the top of this page. Then save the project on your desktop of project folder. Going forward, we will assume a project name as 'myproject'.
However, you may of course name the project folder whatever makes sense for your purpose.

Step 2

Install webserver package

Within the same root folder as the above installation, you will also need to install the web server template rust package here using git clone https://github.com/coderaidershaun/rust-web-server-template.git.

So your project should look like this:

~/myproject

auto_gpt_project (this will be whatever name you clone the repo as)
web_server_template_project (this will be whatever name you clone the repo as))

Step 3

Environment variables

Within the auto_gpt_project, create a file for storing environment variables

~/myproject/auto_gpt_project

touch .env

Then add the following environment variables to that file:

~/myproject/auto_gpt_project/.env

OPEN_AI_ORG=YOUR_OPEN_AI_ORG_ID
OPEN_AI_KEY=YOUR_OPEN_AI_KEY

Step 4

Update directories

Update file paths with the full working directories of each file within the helpers.rs file shown below as an example:

~/myproject/auto_gpt_project/src/helpers/general.rs

const CODE_TEMPLATE_PATH: &str ="/Users/shaun/Code/TUTORIALS/rust_autogpt/web_template/src/code_template.rs";

pub const WEB_SERVER_PROJECT_PATH: &str = "/Users/shaun/Code/TUTORIALS/rust_autogpt/web_template/";

pub const EXEC_MAIN_PATH: &str ="/Users/shaun/Code/TUTORIALS/rust_autogpt/web_template/src/main.rs";

const API_SCHEMA_PATH: &str ="/Users/shaun/Code/TUTORIALS/rust_autogpt/auto_gippity/schemas/api_schema.json";

This will enable the project to save the updated web template in the correct folders.

Step 5

Build and run both projects

Run the auto_gpt_project project

~/myproject/auto_gpt_project

cargo build
cargo build --release #(this is for using later on if you want to run from the target/release/auto_gpt_project(replace with your project name) file
cargo run
Test the web server:

~/myproject/web_server_template_project

cargo build
cargo run

CONGRATULATIONS

Your auto-gpt is running

You are free to now adapt the code to your liking. Enjoy!