Skip to content

Commit

Permalink
Merge branch 'master' into swiftyos/open-1601-paginated-listing-of-st…
Browse files Browse the repository at this point in the history
…ore-agents
  • Loading branch information
ntindle committed Aug 2, 2024
2 parents 8d343d6 + ec6bae0 commit d4beba2
Show file tree
Hide file tree
Showing 90 changed files with 2,798 additions and 407 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/autogpt-infra-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: TFLint
uses: pauloconnor/[email protected]
env:
Expand All @@ -31,3 +34,23 @@ jobs:
tflint_path: terraform/
tflint_recurse: true
tflint_changed_only: false

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.14.4

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
21 changes: 17 additions & 4 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ Welcome to the AutoGPT Documentation.

The AutoGPT project consists of four main components:

* The [Agent](#agent) – also known as just "AutoGPT"
* The [Benchmark](#benchmark) – AKA `agbenchmark`
* The [Forge](#forge)
* The [Frontend](#frontend)
- The [Server](#server) – known as the "AutoGPT Platform"
- The [Agent](#agent) – also known as just "AutoGPT"
- The [Benchmark](#benchmark) – AKA `agbenchmark`
- The [Forge](#forge)
- The [Frontend](#frontend)

To tie these together, we also have a [CLI] at the root of the project.

## 🌐 Server

<!-- Setup, then Advanced, then New Blocks -->

**[📖 Setup](server/setup.md)**
&ensp;|&ensp;
**[📖 Advanced Setup](server/advanced_setup.md)**
&ensp;|&ensp;
**[📖 Making New Blocks](server/new_blocks.md)**

The server is the backbone of the New AutoGPT project. It provides the infrastructure for the agents to run, and the UI for you to interact with them. It integrates with the Forge, Agent, and a bespoke UI to provide a seamless experience.

---

## 🤖 Agent
Expand Down
28 changes: 28 additions & 0 deletions docs/content/server/advanced_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,31 @@ my_secret_value
```

This is useful when running on docker so you can copy the secrets into the container without exposing them in the Dockerfile.

## Database selection

### SQLite

By default, the server uses SQLite as the database. SQLite is a file-based database that is easy to set up and use. However, it is not recommended for production usecases where auth is required because that subsystem requires Postgres.

### PostgreSQL

For production use, it is recommended to use PostgreSQL as the database. You will swap the commands you use to generate and run prisma to the following

```bash
poetry run prisma generate --schema postgres/schema.prisma
```

This will generate the Prisma client for PostgreSQL. You will also need to run the PostgreSQL database in a separate container. You can use the `docker-compose.yml` file in the `rnd` directory to run the PostgreSQL database.

```bash
cd rnd/
docker compose up -d
```

You can then run the migrations from the `autogpt_server` directory.

```bash
cd ../autogpt_server
prisma migrate dev --schema postgres/schema.prisma
```
71 changes: 70 additions & 1 deletion docs/content/server/new_blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Follow these steps to create and test a new block:
```python
def __init__(self):
super().__init__(
# Unique ID for the block
# Unique ID for the block, used across users for templates
# you can generate this with this python one liner
# print(__import__('uuid').uuid4())
id="h5e7f8g9-1b2c-3d4e-5f6g-7h8i9j0k1l2m",
Expand Down Expand Up @@ -147,3 +147,72 @@ This approach allows us to test the block's logic comprehensively without relyin
6. **Update tests when changing block behavior**: If you modify your block, ensure the tests are updated accordingly.

By following these steps, you can create new blocks that extend the functionality of the AutoGPT Agent Server.

## Blocks we want to see

Below is a list of blocks that we would like to see implemented in the AutoGPT Agent Server. If you're interested in contributing, feel free to pick one of these blocks or suggest your own by editing [docs/content/server/new_blocks.md](https://github.com/Significant-Gravitas/AutoGPT/edit/master/docs/content/server/new_blocks.md) and opening a pull request.

If you would like to implement one of these blocks, open a pull request and we will start the review process.

### Consumer Services/Platforms

- Google sheets - Read/Append [Read in Progress](https://github.com/Significant-Gravitas/AutoGPT/pull/7521)
- Email - Read/Send with Gmail, Outlook, Yahoo, Proton, etc
- Calendar - Read/Write with Google Calendar, Outlook Calendar, etc
- Home Assistant - Call Service, Get Status
- Dominos - Order Pizza, Track Order
- Uber - Book Ride, Track Ride
- Notion - Create/Read Page, Create/Append/Read DB
- Google drive - read/write/overwrite file/folder

### Social Media

- Twitter - Post, Reply, Get Replies, Get Comments, Get Followers, Get Following, Get Tweets, Get Mentions
- Instagram - Post, Reply, Get Comments, Get Followers, Get Following, Get Posts, Get Mentions, Get Trending Posts
- TikTok - Post, Reply, Get Comments, Get Followers, Get Following, Get Videos, Get Mentions, Get Trending Videos
- LinkedIn - Post, Reply, Get Comments, Get Followers, Get Following, Get Posts, Get Mentions, Get Trending Posts
- YouTube - Transcribe Videos/Shorts, Post Videos/Shorts, Read/Reply/React to Comments, Update Thumbnails, Update Description, Update Tags, Update Titles, Get Views, Get Likes, Get Dislikes, Get Subscribers, Get Comments, Get Shares, Get Watch Time, Get Revenue, Get Trending Videos, Get Top Videos, Get Top Channels
- Reddit - Post, Reply, Get Comments, Get Followers, Get Following, Get Posts, Get Mentions, Get Trending Posts
- Treatwell (and related Platforms) - Book, Cancel, Review, Get Recommendations
- Substack - Read/Subscribe/Unsubscribe, Post/Reply, Get Recommendations
- Discord - Read/Post/Reply, Moderation actions
- GoodReads - Read/Post/Reply, Get Recommendations

### E-commerce

- Airbnb - Book, Cancel, Review, Get Recommendations
- Amazon - Order, Track Order, Return, Review, Get Recommendations
- eBay - Order, Track Order, Return, Review, Get Recommendations
- Upwork - Post Jobs, Hire Freelancer, Review Freelancer, Fire Freelancer

### Business Tools

- External Agents - Call other agents similar to AutoGPT
- Trello - Create/Read/Update/Delete Cards, Lists, Boards
- Jira - Create/Read/Update/Delete Issues, Projects, Boards
- Linear - Create/Read/Update/Delete Issues, Projects, Boards
- Excel - Read/Write/Update/Delete Rows, Columns, Sheets
- Slack - Read/Post/Reply to Messages, Create Channels, Invite Users
- ERPNext - Create/Read/Update/Delete Invoices, Orders, Customers, Products
- Salesforce - Create/Read/Update/Delete Leads, Opportunities, Accounts
- HubSpot - Create/Read/Update/Delete Contacts, Deals, Companies
- Zendesk - Create/Read/Update/Delete Tickets, Users, Organizations
- Odoo - Create/Read/Update/Delete Sales Orders, Invoices, Customers
- Shopify - Create/Read/Update/Delete Products, Orders, Customers
- WooCommerce - Create/Read/Update/Delete Products, Orders, Customers
- Squarespace - Create/Read/Update/Delete Pages, Products, Orders

## Agent Templates we want to see


### Data/Information

- Summarize top news of today, of this week, this month via Apple News or other large media outlets BBC, TechCrunch, hackernews, etc
- Create, read, and summarize substack newsletters or any newsletters (blog writer vs blog reader)
- Get/read/summarize the most viral Twitter, Instagram, TikTok (general social media accounts) of the day, week, month
- Get/Read any LinkedIn posts or profile that mention AI Agents
- Read/Summarize discord (might not be able to do this because you need access)
- Read / Get most read books in a given month, year, etc from GoodReads or Amazon Books, etc
- Get dates for specific shows across all streaming services
- Suggest/Recommend/Get most watched shows in a given month, year, etc across all streaming platforms

37 changes: 37 additions & 0 deletions docs/content/server/ollama.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Running Ollama with AutoGPT

Follow these steps to set up and run Ollama and your AutoGPT project:

1. **Run Ollama**
- Open a terminal
- Execute the following command:
```
ollama run llama3
```
- Leave this terminal running
2. **Run the Backend**
- Open a new terminal
- Navigate to the backend directory in the AutoGPT project:
```
cd rnd/autogpt_server/
```
- Start the backend using Poetry:
```
poetry run app
```
3. **Run the Frontend**
- Open another terminal
- Navigate to the frontend directory in the AutoGPT project:
```
cd rnd/autogpt_builder/
```
- Start the frontend development server:
```
npm run dev
```
4. **Choose the Ollama Model**
- Add LLMBlock in the UI
- Choose the last option in the model selection dropdown
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ nav:
- Build your own Blocks: server/new_blocks.md
- Setup: server/setup.md
- Advanced Setup: server/advanced_setup.md
- Using Ollama: server/ollama.md

- AutoGPT Agent:
- Introduction: AutoGPT/index.md
Expand Down
Empty file added rnd/__init__.py
Empty file.
13 changes: 12 additions & 1 deletion rnd/autogpt_builder/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
AGPT_SERVER_URL=http://localhost:8000/api
AGPT_MARKETPLACE_URL=http://127.0.0.1:8001/market
NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://127.0.0.1:8001/market
NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://127.0.0.1:8001/market

## Supabase credentials
## YOU ONLY NEED THEM IF YOU WANT TO USE SUPABASE USER AUTHENTICATION
## If you're using self-hosted version then you most likely don't need to set this
# NEXT_PUBLIC_SUPABASE_URL=your-project-url
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

## OAuth Callback URL
## This should be {domain}/auth/callback
## Only used if you're using Supabase and OAuth
AUTH_CALLBACK_URL=http://localhost:3000/auth/callback
3 changes: 3 additions & 0 deletions rnd/autogpt_builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@supabase/ssr": "^0.4.0",
"@supabase/supabase-js": "^2.45.0",
"ajv": "^8.17.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand All @@ -32,6 +34,7 @@
"react-day-picker": "^8.10.1",
"react-dom": "^18",
"react-hook-form": "^7.52.1",
"react-icons": "^5.2.1",
"react-markdown": "^9.0.1",
"react-modal": "^3.16.1",
"reactflow": "^11.11.4",
Expand Down
34 changes: 34 additions & 0 deletions rnd/autogpt_builder/src/app/auth/auth-code-error/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use client";

import { useEffect, useState } from 'react';

export default function AuthErrorPage() {
const [errorType, setErrorType] = useState<string | null>(null);
const [errorCode, setErrorCode] = useState<string | null>(null);
const [errorDescription, setErrorDescription] = useState<string | null>(null);

useEffect(() => {
// This code only runs on the client side
if (typeof window !== 'undefined') {
const hash = window.location.hash.substring(1); // Remove the leading '#'
const params = new URLSearchParams(hash);

setErrorType(params.get('error'));
setErrorCode(params.get('error_code'));
setErrorDescription(params.get('error_description')?.replace(/\+/g, ' ') ?? null); // Replace '+' with space
}
}, []);

if (!errorType && !errorCode && !errorDescription) {
return <div>Loading...</div>;
}

return (
<div>
<h1>Authentication Error</h1>
{errorType && <p>Error Type: {errorType}</p>}
{errorCode && <p>Error Code: {errorCode}</p>}
{errorDescription && <p>Error Description: {errorDescription}</p>}
</div>
);
}
36 changes: 36 additions & 0 deletions rnd/autogpt_builder/src/app/auth/callback/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { NextResponse } from 'next/server'
import { createServerClient } from '@/lib/supabase/server'

// Handle the callback to complete the user session login
export async function GET(request: Request) {
const { searchParams, origin } = new URL(request.url)
const code = searchParams.get('code')
// if "next" is in param, use it as the redirect URL
const next = searchParams.get('next') ?? '/profile'

if (code) {
const supabase = createServerClient()

if (!supabase) {
return NextResponse.redirect(`${origin}/error`)
}

const { data, error } = await supabase.auth.exchangeCodeForSession(code)
// data.session?.refresh_token is available if you need to store it for later use
if (!error) {
const forwardedHost = request.headers.get('x-forwarded-host') // original origin before load balancer
const isLocalEnv = process.env.NODE_ENV === 'development'
if (isLocalEnv) {
// we can be sure that there is no load balancer in between, so no need to watch for X-Forwarded-Host
return NextResponse.redirect(`${origin}${next}`)
} else if (forwardedHost) {
return NextResponse.redirect(`https://${forwardedHost}${next}`)
} else {
return NextResponse.redirect(`${origin}${next}`)
}
}
}

// return the user to an error page with instructions
return NextResponse.redirect(`${origin}/auth/auth-code-error`)
}
33 changes: 33 additions & 0 deletions rnd/autogpt_builder/src/app/auth/confirm/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { type EmailOtpType } from '@supabase/supabase-js'
import { type NextRequest } from 'next/server'

import { redirect } from 'next/navigation'
import { createServerClient } from '@/lib/supabase/server'

// Email confirmation route
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url)
const token_hash = searchParams.get('token_hash')
const type = searchParams.get('type') as EmailOtpType | null
const next = searchParams.get('next') ?? '/'

if (token_hash && type) {
const supabase = createServerClient()

if (!supabase) {
redirect('/error')
}

const { error } = await supabase.auth.verifyOtp({
type,
token_hash,
})
if (!error) {
// redirect user to specified redirect URL or root of app
redirect(next)
}
}

// redirect the user to an error page with some instructions
redirect('/error')
}
3 changes: 3 additions & 0 deletions rnd/autogpt_builder/src/app/error/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ErrorPage() {
return <p>Sorry, something went wrong</p>
}
6 changes: 3 additions & 3 deletions rnd/autogpt_builder/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';
import type { Metadata } from "next";
import { Inter } from "next/font/google";

import "./globals.css";

import { Providers } from "@/app/providers";
import {NavBar} from "@/components/NavBar";
import {cn} from "@/lib/utils";

import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "NextGen AutoGPT",
description: "Your one stop shop to creating AI Agents",
};

export default function RootLayout({
children,
}: Readonly<{
Expand Down
Loading

0 comments on commit d4beba2

Please sign in to comment.