Skip to content

Commit

Permalink
Release v12 (#1206)
Browse files Browse the repository at this point in the history
Releasing v12 : Merging development to main

Features :

- Added support for user defined HTTP callback event triggers as webhooks.
- Added support for self-hosting SuperAGI with one-click docker deployment to Digital Ocean
- Added Tool Console and Knowledge Console
- Added menu options to publish Agent Template to Marketplace.

Tools:

- GitHub Fetch PR Tool
- GitHub Review PR Tool
  • Loading branch information
luciferlinx101 authored Sep 7, 2023
1 parent 701c91f commit 6ea5b8c
Show file tree
Hide file tree
Showing 76 changed files with 2,735 additions and 390 deletions.
76 changes: 76 additions & 0 deletions .do/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
databases:
- engine: PG
name: super-agi-main
num_nodes: 1
size: basic-xs
version: "12"
ingress:
rules:
- component:
name: superagi-backend
match:
path:
prefix: /api
name: superagi
services:
- dockerfile_path: DockerfileRedis
github:
branch: main
deploy_on_push: true
repo: TransformerOptimus/SuperAGI
internal_ports:
- 6379
instance_count: 1
instance_size_slug: basic-xs
source_dir: /
name: superagi-redis
- dockerfile_path: Dockerfile
envs:
- key: REDIS_URL
scope: RUN_TIME
value: superagi-redis:6379
- key: DB_URL
scope: RUN_TIME
value: ${super-agi-main.DATABASE_URL}
github:
branch: main
deploy_on_push: true
repo: TransformerOptimus/SuperAGI
http_port: 8001
instance_count: 1
instance_size_slug: basic-xs
run_command: /app/entrypoint.sh
source_dir: /
name: superagi-backend
- dockerfile_path: ./gui/DockerfileProd
github:
branch: main
deploy_on_push: true
repo: TransformerOptimus/SuperAGI
http_port: 3000
instance_count: 1
instance_size_slug: basic-xs
source_dir: ./gui
name: superagi-gui
workers:
- dockerfile_path: Dockerfile
envs:
- key: REDIS_URL
scope: RUN_TIME
value: superagi-redis:6379
- key: DB_URL
scope: RUN_TIME
value: ${super-agi-main.DATABASE_URL}
github:
branch: main
deploy_on_push: true
repo: TransformerOptimus/SuperAGI
instance_count: 1
instance_size_slug: basic-xs
run_command: celery -A superagi.worker worker --beat --loglevel=info
source_dir: /
name: superagi-celery

73 changes: 73 additions & 0 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
spec:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
databases:
- engine: PG
name: super-agi-main
num_nodes: 1
size: basic-xs
version: "12"
ingress:
rules:
- component:
name: superagi-backend
match:
path:
prefix: /api
name: superagi
services:
- dockerfile_path: DockerfileRedis
git:
branch: main
repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
internal_ports:
- 6379
instance_count: 1
instance_size_slug: basic-xs
source_dir: /
name: superagi-redis
- dockerfile_path: Dockerfile
envs:
- key: REDIS_URL
scope: RUN_TIME
value: superagi-redis:6379
- key: DB_URL
scope: RUN_TIME
value: ${super-agi-main.DATABASE_URL}
git:
branch: main
repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
http_port: 8001
instance_count: 1
instance_size_slug: basic-xs
run_command: /app/entrypoint.sh
source_dir: /
name: superagi-backend
- dockerfile_path: ./gui/DockerfileProd
git:
branch: main
repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
http_port: 3000
instance_count: 1
instance_size_slug: basic-xs
source_dir: ./gui
name: superagi-gui
workers:
- dockerfile_path: Dockerfile
envs:
- key: REDIS_URL
scope: RUN_TIME
value: superagi-redis:6379
- key: DB_URL
scope: RUN_TIME
value: ${super-agi-main.DATABASE_URL}
git:
branch: main
repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
instance_count: 1
instance_size_slug: basic-xs
run_command: celery -A superagi.worker worker --beat --loglevel=info
source_dir: /
name: superagi-celery

1 change: 1 addition & 0 deletions DockerfileRedis
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM redis/redis-stack-server:latest
5 changes: 4 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
<a href="https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=640182997&machine=basicLinux32gb&location=EastUs"> <img src="https://github.com/codespaces/badge.svg"></a><br>Not sure how to setup? <a href="https://youtu.be/yvmNthyWYCE">Learn here</a>
</p>

<br>
<p align="center">
<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/TransformerOptimus/SuperAGI/tree/main"> <img src="https://www.deploytodo.com/do-btn-blue.svg"></a><br>Deploy SuperAGI to DigitalOcean with one click.
</p>

### 💡 Features

Expand Down Expand Up @@ -129,7 +133,6 @@
- If you wish to change the port it's running on, open the `docker-compose.yml` file and update the `proxy` container port forwarding, for example: `"3000:80"`



<a id="architecture">

### 🌐 Architecture
Expand Down
3 changes: 2 additions & 1 deletion config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ MAX_MODEL_TOKEN_LIMIT: 4032 # set to 2048 for llama
#DATABASE INFO
# redis details
DB_NAME: super_agi_main
POSTGRES_URL: super__postgres
DB_HOST: super__postgres
DB_USERNAME: superagi
DB_PASSWORD: password
DB_URL: postgresql://superagi:password@super__postgres:5432/super_agi_main
REDIS_URL: "super__redis:6379"

#STORAGE TYPE ("FILE" or "S3")
Expand Down
22 changes: 8 additions & 14 deletions gui/pages/Content/APM/ApmDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,25 +250,19 @@ export default function ApmDashboard() {
<thead>
<tr style={{borderTop: 'none'}}>
<th className="table_header w_20">Agent Name</th>
<th className="table_header text_align_right w_10">Model <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_10">Model
</th>
<th className="table_header text_align_right w_12">Tokens Consumed <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_12">Tokens Consumed
</th>
<th className="table_header text_align_right w_6">Runs <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_6">Runs
</th>
<th className="table_header text_align_right w_12">Avg tokens per run <img
width={14} height={14} src="/images/arrow_downward.svg" alt="arrow_down"/></th>
<th className="table_header text_align_right w_20">Tools <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_12">Avg tokens per run
</th>
<th className="table_header text_align_right w_10">Calls <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_20">Tools
</th>
<th className="table_header text_align_right w_10">Avg Run Time <img width={14} height={14} src="/images/arrow_downward.svg"
alt="arrow_down"/>
<th className="table_header text_align_right w_10">Calls
</th>
<th className="table_header text_align_right w_10">Avg Run Time
</th>
</tr>
</thead>
Expand Down
113 changes: 79 additions & 34 deletions gui/pages/Content/Agents/AgentCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
updateExecution,
uploadFile,
getAgentDetails, addAgentRun, fetchModels,
getAgentWorkflows, validateOrAddModels
getAgentWorkflows, validateOrAddModels, publishTemplateToMarketplace
} from "@/pages/api/DashboardService";
import {
formatBytes,
Expand Down Expand Up @@ -119,6 +119,9 @@ export default function AgentCreate({
const [editModal, setEditModal] = useState(false)
const [editButtonClicked, setEditButtonClicked] = useState(false);

const [dropdown, setDropdown] = useState(false);
const [publishModal, setPublishModal] = useState(false);


useEffect(() => {
getOrganisationConfig(organisationId, "model_api_key")
Expand Down Expand Up @@ -502,30 +505,7 @@ export default function AgentCreate({

setCreateClickable(false);

let permission_type = permission;
if (permission.includes("RESTRICTED")) {
permission_type = "RESTRICTED";
}

const agentData = {
"name": agentName,
"project_id": selectedProjectId,
"description": agentDescription,
"goal": goals,
"instruction": instructions,
"agent_workflow": agentWorkflow,
"constraints": constraints,
"toolkits": [],
"tools": selectedTools,
"exit": exitCriterion,
"iteration_interval": stepTime,
"model": model,
"max_iterations": maxIterations,
"permission_type": permission_type,
"LTM_DB": longTermMemory ? database : null,
"user_timezone": getUserTimezone(),
"knowledge": toolNames.includes('Knowledge Search') ? selectedKnowledgeId : null,
};
const agentData = setAgentData()

const scheduleAgentData = {
"agent_config": agentData,
Expand Down Expand Up @@ -564,7 +544,34 @@ export default function AgentCreate({
});
}
};
const setAgentData= () => {
let permission_type = permission;
if (permission.includes("RESTRICTED")) {
permission_type = "RESTRICTED";
}

const agentData = {
"name": agentName,
"project_id": selectedProjectId,
"description": agentDescription,
"goal": goals,
"instruction": instructions,
"agent_workflow": agentWorkflow,
"constraints": constraints,
"toolkits": [],
"tools": selectedTools,
"exit": exitCriterion,
"iteration_interval": stepTime,
"model": model,
"max_iterations": maxIterations,
"permission_type": permission_type,
"LTM_DB": longTermMemory ? database : null,
"user_timezone": getUserTimezone(),
"knowledge": toolNames.includes('Knowledge Search') ? selectedKnowledgeId : null,
};

return agentData
}
const uploadResources = (agentId, name, executionId) => {
if (addResources && input.length > 0) {
const uploadPromises = input.map(fileData => {
Expand Down Expand Up @@ -877,6 +884,20 @@ export default function AgentCreate({
localStorage.setItem('marketplace_tab', 'market_models');
}

const handleAddToMarketplace = () => {
const agentData = setAgentData()
agentData.agent_template_id = template.id
publishTemplateToMarketplace(agentData)
.then((response) => {
setDropdown(false)
setPublishModal(true)
})
.catch((error) => {
toast.error("Error Publishing to marketplace")
console.error('Error Publishing to marketplace:', error);
});
}

return (<>
<div className="row" style={{overflowY: 'scroll', height: 'calc(100vh - 92px)'}}>
<div className="col-3"></div>
Expand Down Expand Up @@ -1158,7 +1179,7 @@ export default function AgentCreate({
<div style={{marginTop: '15px'}}>
<label className={styles.form_label}>Agent Workflow</label><br/>
<div className="dropdown_container_search" style={{width: '100%'}}>
<div className="custom_select_container" onClick={() => setAgentDropdown(!agentDropdown)}
<div className={`${"custom_select_container"} ${edit ? 'cursor_not_allowed' : ''}`} onClick={() => {setAgentDropdown(!edit ? !agentDropdown : false)}}
style={{width: '100%'}}>
{agentWorkflow}<Image width={20} height={21}
src={!agentDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
Expand Down Expand Up @@ -1318,17 +1339,24 @@ export default function AgentCreate({
}

<div style={{marginTop: '10px', display: 'flex', justifyContent: 'flex-end'}}>
<div className="display_flex_container position_relative mr_7">
<div>
{dropdown && (<div className={styles.dropdown_container_agent} onMouseOver={() => setDropdown(true)} onMouseOut={() => setDropdown(false)}>
<ul className="padding_0 margin_0">
<li className={`${styles.dropdown_item_agent} ${"dropdown_item"}`} onClick={() => updateTemplate()}>Update template</li>
{env === 'PROD' && <li className={`${styles.dropdown_item_agent} ${"dropdown_item"}`} onClick={() => handleAddToMarketplace()}>Publish to Marketplace</li>}
</ul>
</div>)}
</div>
{showButton && <div>
<button className="secondary_button padding_8" onClick={() => setDropdown(true)}>
<Image width={20} height={20} src="/images/three_dots.svg" alt="run-icon"/>
</button>
</div>}
</div>
<button style={{marginRight: '7px'}} className="secondary_button"
onClick={() => removeTab(-1, "new agent", "Create_Agent", internalId)}>Cancel
</button>
{showButton && (
<button style={{marginRight: '7px'}} className="secondary_button"
onClick={() => {
updateTemplate()
}}>
Update Template
</button>
)}
{!edit ? <div style={{display: 'flex', position: 'relative'}}>
{createDropdown && (<div className="create_agent_dropdown_options" onClick={() => {
setCreateModal(true);
Expand Down Expand Up @@ -1370,6 +1398,23 @@ export default function AgentCreate({
</div>
</div>)}

{publishModal && <div className="modal" onClick={() => {setPublishModal(false)}}>
<div className="modal-content w_35" onClick={preventDefault}>
<div className={styles.detail_name}>Template submitted successfully!</div>
<div>
<label className={styles.form_label}>Your template is under review. Please check the marketplace in 2-3 days. If your template is not visible on the marketplace, reach out to us on Discord&nbsp;
<a href="https://discord.com/channels/1107593006032355359/1143813784683692093" target="_blank" rel="noopener noreferrer">
#agent-templates-submission
</a> channel.</label>
</div>
<div className={styles.modal_buttons}>
<button className="primary_button" onClick={() => {setPublishModal(false)}}>
Okay
</button>
</div>
</div>
</div>}

</div>
</div>
<div className="col-3"></div>
Expand Down
Loading

0 comments on commit 6ea5b8c

Please sign in to comment.