16 | )
17 | }
--------------------------------------------------------------------------------
/gui/public/images/active_icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/add.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/apollo_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/apollo_logo.png
--------------------------------------------------------------------------------
/gui/public/images/arrow_back.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_down.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_downward.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_downward_dropdown.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_forward.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_forward_ios.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_forward_secondary.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/arrow_outward.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/bolt.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/calendar.png
--------------------------------------------------------------------------------
/gui/public/images/calendarIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/calendarIcon.png
--------------------------------------------------------------------------------
/gui/public/images/calls_made.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/check.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/close.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/close_light.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/default_file.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/dropdown_down.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/dropdown_up.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/duckduckgo_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/duckduckgo_icon.png
--------------------------------------------------------------------------------
/gui/public/images/eventSchedule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/eventSchedule.png
--------------------------------------------------------------------------------
/gui/public/images/expand_more.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/flag.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gui/public/images/github_white.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/gmail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/gmail.png
--------------------------------------------------------------------------------
/gui/public/images/google_analytics_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/google_analytics_logo.png
--------------------------------------------------------------------------------
/gui/public/images/img_file.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/gui/public/images/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/instagram.png
--------------------------------------------------------------------------------
/gui/public/images/knowledeg_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/knowledeg_logo.png
--------------------------------------------------------------------------------
/gui/public/images/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/loading.gif
--------------------------------------------------------------------------------
/gui/public/images/marketplace_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/marketplace_logo.png
--------------------------------------------------------------------------------
/gui/public/images/models.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/no_permissions.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/gui/public/images/notion_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/notion_logo.png
--------------------------------------------------------------------------------
/gui/public/images/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/plus.png
--------------------------------------------------------------------------------
/gui/public/images/plus_symbol.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/profile_pic.png
--------------------------------------------------------------------------------
/gui/public/images/run_icon.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/runs_made.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/send.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/superagi_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/superagi_logo.png
--------------------------------------------------------------------------------
/gui/public/images/superagi_logo_beta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/superagi_logo_beta.png
--------------------------------------------------------------------------------
/gui/public/images/three_dots_vertical.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/tick.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gui/public/images/txt_file.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/gui/public/images/undo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/gui/public/images/watermark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/gui/public/images/watermark.png
--------------------------------------------------------------------------------
/gui/utils/eventBus.js:
--------------------------------------------------------------------------------
1 | import mitt from 'mitt';
2 |
3 | const emitter = mitt();
4 |
5 | export const EventBus = {
6 | on: emitter.on,
7 | off: emitter.off,
8 | emit: emitter.emit,
9 | };
10 |
--------------------------------------------------------------------------------
/install_tool_dependencies.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Update and upgrade apt settings and apps
4 | apt update && apt upgrade -y
5 | xargs apt install -y < /app/requirements_apt.txt
6 |
7 | # Run the project's main requirements.txt
8 | pip install -r /app/requirements.txt
9 |
10 | for tool in /app/superagi/tools/* /app/superagi/tools/external_tools/* /app/superagi/tools/marketplace_tools/* ; do
11 | # Loop through the tools directories and install their apt_requirements.txt if they exist
12 | if [ -d "$tool" ] && [ -f "$tool/requirements_apt.txt" ]; then
13 | echo "Installing apt requirements for tool: $(basename "$tool")"
14 | xargs apt install -y < "$tool/requirements_apt.txt"
15 | fi
16 | # Loop through the tools directories and install their requirements.txt if they exist
17 | if [ -d "$tool" ] && [ -f "$tool/requirements.txt" ]; then
18 | echo "Installing requirements for tool: $(basename "$tool")"
19 | pip install -r "$tool/requirements.txt"
20 | fi
21 | done
22 |
--------------------------------------------------------------------------------
/migrations/README:
--------------------------------------------------------------------------------
1 | Generic single-database configuration.
--------------------------------------------------------------------------------
/migrations/script.py.mako:
--------------------------------------------------------------------------------
1 | """${message}
2 |
3 | Revision ID: ${up_revision}
4 | Revises: ${down_revision | comma,n}
5 | Create Date: ${create_date}
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 | ${imports if imports else ""}
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = ${repr(up_revision)}
14 | down_revision = ${repr(down_revision)}
15 | branch_labels = ${repr(branch_labels)}
16 | depends_on = ${repr(depends_on)}
17 |
18 |
19 | def upgrade() -> None:
20 | ${upgrades if upgrades else "pass"}
21 |
22 |
23 | def downgrade() -> None:
24 | ${downgrades if downgrades else "pass"}
25 |
--------------------------------------------------------------------------------
/migrations/versions/2cc1179834b0_agent_executions_modified.py:
--------------------------------------------------------------------------------
1 | """agent_executions_modified
2 |
3 | Revision ID: 2cc1179834b0
4 | Revises: 2f97c068fab9
5 | Create Date: 2023-06-02 21:01:43.303961
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '2cc1179834b0'
14 | down_revision = '2f97c068fab9'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('agent_executions', sa.Column('calls', sa.Integer(), nullable=True))
22 | op.add_column('agent_executions', sa.Column('tokens', sa.Integer(), nullable=True))
23 | # ### end Alembic commands ###
24 |
25 |
26 | def downgrade() -> None:
27 | # ### commands auto generated by Alembic - please adjust! ###
28 | op.drop_column('agent_executions', 'tokens')
29 | op.drop_column('agent_executions', 'calls')
30 | # ### end Alembic commands ###
31 |
--------------------------------------------------------------------------------
/migrations/versions/2f97c068fab9_resource_modified.py:
--------------------------------------------------------------------------------
1 | """Resource Modified
2 |
3 | Revision ID: 2f97c068fab9
4 | Revises: a91808a89623
5 | Create Date: 2023-06-02 13:13:21.670935
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '2f97c068fab9'
14 | down_revision = 'a91808a89623'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('resources', sa.Column('agent_id', sa.Integer(), nullable=True))
22 | op.drop_column('resources', 'project_id')
23 | # ### end Alembic commands ###
24 |
25 |
26 | def downgrade() -> None:
27 | # ### commands auto generated by Alembic - please adjust! ###
28 | op.add_column('resources', sa.Column('project_id', sa.INTEGER(), autoincrement=False, nullable=True))
29 | op.drop_column('resources', 'agent_id')
30 | # ### end Alembic commands ###
31 |
--------------------------------------------------------------------------------
/migrations/versions/2fbd6472112c_add_feed_group_id_to_execution_and_feed.py:
--------------------------------------------------------------------------------
1 | """add feed group id to execution and feed
2 |
3 | Revision ID: 2fbd6472112c
4 | Revises: 5184645e9f12
5 | Create Date: 2023-08-01 17:09:16.183863
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 | # revision identifiers, used by Alembic.
12 | revision = '2fbd6472112c'
13 | down_revision = '5184645e9f12'
14 | branch_labels = None
15 | depends_on = None
16 |
17 |
18 | def upgrade() -> None:
19 | op.add_column('agent_executions',
20 | sa.Column('current_feed_group_id', sa.String(), nullable=True, server_default="DEFAULT"))
21 | op.add_column('agent_execution_feeds', sa.Column('feed_group_id', sa.String(), nullable=True))
22 |
23 |
24 | def downgrade() -> None:
25 | op.drop_column('agent_executions', 'current_feed_group_id')
26 | op.drop_column('agent_execution_feeds', 'feed_group_id')
27 |
--------------------------------------------------------------------------------
/migrations/versions/35e47f20475b_renamed_tokens_calls.py:
--------------------------------------------------------------------------------
1 | """renamed_tokens_calls
2 |
3 | Revision ID: 35e47f20475b
4 | Revises: 598cfb37292a
5 | Create Date: 2023-06-06 04:34:15.101672
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '35e47f20475b'
14 | down_revision = '598cfb37292a'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('agent_executions', sa.Column('num_of_calls', sa.Integer(), nullable=True))
22 | op.add_column('agent_executions', sa.Column('num_of_tokens', sa.Integer(), nullable=True))
23 | op.drop_column('agent_executions', 'calls')
24 | op.drop_column('agent_executions', 'tokens')
25 | # ### end Alembic commands ###
26 |
27 |
28 | def downgrade() -> None:
29 | # ### commands auto generated by Alembic - please adjust! ###
30 | op.add_column('agent_executions', sa.Column('tokens', sa.INTEGER(), autoincrement=False, nullable=True))
31 | op.add_column('agent_executions', sa.Column('calls', sa.INTEGER(), autoincrement=False, nullable=True))
32 | op.drop_column('agent_executions', 'num_of_tokens')
33 | op.drop_column('agent_executions', 'num_of_calls')
34 | # ### end Alembic commands ###
35 |
--------------------------------------------------------------------------------
/migrations/versions/3867bb00a495_added_first_login_source.py:
--------------------------------------------------------------------------------
1 | """added_first_login_source
2 |
3 | Revision ID: 3867bb00a495
4 | Revises: 661ec8a4c32e
5 | Create Date: 2023-09-15 02:06:24.006555
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '3867bb00a495'
14 | down_revision = '661ec8a4c32e'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('users', sa.Column('first_login_source', sa.String(), nullable=True))
22 | # ### end Alembic commands ###
23 |
24 |
25 | def downgrade() -> None:
26 | # ### commands auto generated by Alembic - please adjust! ###
27 | op.drop_column('users', 'first_login_source')
28 | # ### end Alembic commands ###
29 |
--------------------------------------------------------------------------------
/migrations/versions/40affbf3022b_add_filter_colume_in_webhooks.py:
--------------------------------------------------------------------------------
1 | """add filter colume in webhooks
2 |
3 | Revision ID: 40affbf3022b
4 | Revises: 5d5f801f28e7
5 | Create Date: 2023-08-28 12:30:35.171176
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '40affbf3022b'
14 | down_revision = '5d5f801f28e7'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('webhooks', sa.Column('filters', sa.JSON(), nullable=True))
22 | # ### end Alembic commands ###
23 |
24 |
25 | def downgrade() -> None:
26 | # ### commands auto generated by Alembic - please adjust! ###
27 | op.drop_column('webhooks', 'filters')
28 | # ### end Alembic commands ###
29 |
--------------------------------------------------------------------------------
/migrations/versions/467e85d5e1cd_updated_resources_added_exec_id.py:
--------------------------------------------------------------------------------
1 | """updated_resources_added_exec_id
2 |
3 | Revision ID: 467e85d5e1cd
4 | Revises: ba60b12ae109
5 | Create Date: 2023-07-10 08:54:46.702652
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '467e85d5e1cd'
14 | down_revision = 'ba60b12ae109'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('resources', sa.Column('agent_execution_id', sa.Integer(), nullable=True))
22 | # ### end Alembic commands ###
23 |
24 |
25 | def downgrade() -> None:
26 | # ### commands auto generated by Alembic - please adjust! ###
27 | op.drop_column('resources', 'agent_execution_id')
28 | # ### end Alembic commands ###
29 |
--------------------------------------------------------------------------------
/migrations/versions/516ecc1c723d_adding_marketplace_template_id_to_agent_.py:
--------------------------------------------------------------------------------
1 | """adding marketplace_template_id to agent tempaltes
2 |
3 | Revision ID: 516ecc1c723d
4 | Revises: 8962bed0d809
5 | Create Date: 2023-06-13 17:10:06.262764
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '516ecc1c723d'
14 | down_revision = '8962bed0d809'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | op.add_column('agent_templates', sa.Column('marketplace_template_id', sa.Integer(), nullable=True))
21 |
22 |
23 | def downgrade() -> None:
24 | op.drop_column('agent_templates', sa.Column('marketplace_template_id', sa.Integer(), nullable=True))
25 |
--------------------------------------------------------------------------------
/migrations/versions/5184645e9f12_add_question_to_agent_execution_.py:
--------------------------------------------------------------------------------
1 | """add question to agent execution permission
2 |
3 | Revision ID: 5184645e9f12
4 | Revises: 9419b3340af7
5 | Create Date: 2023-07-21 08:16:14.702389
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '5184645e9f12'
14 | down_revision = '9419b3340af7'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | op.add_column('agent_execution_permissions', sa.Column('question', sa.Text(), nullable=True))
21 |
22 |
23 | def downgrade() -> None:
24 | op.drop_column('agent_execution_permissions', "question")
25 |
--------------------------------------------------------------------------------
/migrations/versions/520aa6776347_create_models_config.py:
--------------------------------------------------------------------------------
1 | """create models config
2 |
3 | Revision ID: 520aa6776347
4 | Revises: 71e3980d55f5
5 | Create Date: 2023-08-01 07:48:13.724938
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '520aa6776347'
14 | down_revision = '446884dcae58'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.create_table('models_config',
22 | sa.Column('id', sa.Integer(), nullable=False),
23 | sa.Column('provider', sa.String(), nullable=False),
24 | sa.Column('api_key', sa.String(), nullable=False),
25 | sa.Column('org_id', sa.Integer(), nullable=False),
26 | sa.Column('created_at', sa.DateTime(), nullable=True),
27 | sa.Column('updated_at', sa.DateTime(), nullable=True),
28 | sa.PrimaryKeyConstraint('id')
29 | )
30 | # ### end Alembic commands ###
31 |
32 |
33 | def downgrade() -> None:
34 | # ### commands auto generated by Alembic - please adjust! ###
35 | op.drop_table('models_config')
36 | # ### end Alembic commands ###
37 |
--------------------------------------------------------------------------------
/migrations/versions/661ec8a4c32e_open_ai_error_handling.py:
--------------------------------------------------------------------------------
1 | """open_ai_error_handling
2 |
3 | Revision ID: 661ec8a4c32e
4 | Revises: 40affbf3022b
5 | Create Date: 2023-09-07 10:41:07.462436
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '661ec8a4c32e'
14 | down_revision = 'c4f2f6ba602a'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('agent_execution_feeds', sa.Column('error_message', sa.String(), nullable=True))
22 | op.add_column('agent_executions', sa.Column('last_shown_error_id', sa.Integer(), nullable=True))
23 | # ### end Alembic commands ###
24 |
25 |
26 | def downgrade() -> None:
27 | # ### commands auto generated by Alembic - please adjust! ###
28 | op.drop_column('agent_executions', 'last_shown_error_id')
29 | op.drop_column('agent_execution_feeds', 'error_message')
30 | # ### end Alembic commands ###
31 |
--------------------------------------------------------------------------------
/migrations/versions/83424de1347e_added_agent_execution_config.py:
--------------------------------------------------------------------------------
1 | """added_agent_execution_config
2 |
3 | Revision ID: 83424de1347e
4 | Revises: c02f3d759bf3
5 | Create Date: 2023-07-03 22:42:50.091762
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '83424de1347e'
14 | down_revision = 'c02f3d759bf3'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.create_table('agent_execution_configs',
22 | sa.Column('id', sa.Integer(), nullable=False),
23 | sa.Column('agent_execution_id', sa.Integer(), nullable=True),
24 | sa.Column('key', sa.String(), nullable=True),
25 | sa.Column('value', sa.Text(), nullable=True),
26 | sa.Column('created_at', sa.DateTime(), nullable=True),
27 | sa.Column('updated_at', sa.DateTime(), nullable=True),
28 | sa.PrimaryKeyConstraint('id')
29 | )
30 | # ### end Alembic commands ###
31 |
32 |
33 | def downgrade() -> None:
34 | # ### commands auto generated by Alembic - please adjust! ###
35 | op.drop_table('agent_execution_configs')
36 | # ### end Alembic commands ###
37 |
--------------------------------------------------------------------------------
/migrations/versions/9270eb5a8475_local_llms.py:
--------------------------------------------------------------------------------
1 | """local_llms
2 |
3 | Revision ID: 9270eb5a8475
4 | Revises: 3867bb00a495
5 | Create Date: 2023-10-04 09:26:33.865424
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = '9270eb5a8475'
14 | down_revision = '3867bb00a495'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('models', sa.Column('context_length', sa.Integer(), nullable=True))
22 | # ### end Alembic commands ###
23 |
24 |
25 | def downgrade() -> None:
26 | # ### commands auto generated by Alembic - please adjust! ###
27 | op.drop_column('models', 'context_length')
28 | # ### end Alembic commands ###
29 |
--------------------------------------------------------------------------------
/migrations/versions/be1d922bf2ad_create_call_logs_table.py:
--------------------------------------------------------------------------------
1 | """create call logs table
2 |
3 | Revision ID: be1d922bf2ad
4 | Revises: 2fbd6472112c
5 | Create Date: 2023-08-08 08:42:37.148178
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = 'be1d922bf2ad'
14 | down_revision = '520aa6776347'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.create_table('call_logs',
22 | sa.Column('id', sa.Integer(), nullable=False),
23 | sa.Column('agent_execution_name', sa.String(), nullable=False),
24 | sa.Column('agent_id', sa.Integer(), nullable=False),
25 | sa.Column('tokens_consumed', sa.Integer(), nullable=False),
26 | sa.Column('tool_used', sa.String(), nullable=False),
27 | sa.Column('model', sa.String(), nullable=True),
28 | sa.Column('org_id', sa.Integer(), nullable=False),
29 | sa.Column('created_at', sa.DateTime(), nullable=True),
30 | sa.Column('updated_at', sa.DateTime(), nullable=True),
31 | sa.PrimaryKeyConstraint('id')
32 | )
33 | # ### end Alembic commands ###
34 |
35 |
36 | def downgrade() -> None:
37 | # ### commands auto generated by Alembic - please adjust! ###
38 | op.drop_table('call_logs')
39 | # ### end Alembic commands ###
40 |
--------------------------------------------------------------------------------
/migrations/versions/c02f3d759bf3_add_summary_to_resource.py:
--------------------------------------------------------------------------------
1 | """add summary to resource
2 |
3 | Revision ID: c02f3d759bf3
4 | Revises: 1d54db311055
5 | Create Date: 2023-06-27 05:07:29.016704
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = 'c02f3d759bf3'
14 | down_revision = 'c5c19944c90c'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ##
21 | op.add_column('resources', sa.Column('summary', sa.Text(), nullable=True))
22 | # ### end Alembic commands ###
23 |
24 |
25 | def downgrade() -> None:
26 | # ### commands auto generated by Alembic - please adjust! ###
27 | op.drop_column('resources', 'summary')
28 | # ### end Alembic commands ###
29 |
--------------------------------------------------------------------------------
/migrations/versions/c4f2f6ba602a_agent_workflow_wait_step.py:
--------------------------------------------------------------------------------
1 | """agent_workflow_wait_step
2 |
3 | Revision ID: c4f2f6ba602a
4 | Revises: 40affbf3022b
5 | Create Date: 2023-09-04 05:34:10.195248
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = 'c4f2f6ba602a'
14 | down_revision = '40affbf3022b'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.create_table('agent_workflow_step_waits',
22 | sa.Column('id', sa.Integer(), nullable=False),
23 | sa.Column('name', sa.String(), nullable=True),
24 | sa.Column('description', sa.String(), nullable=True),
25 | sa.Column('unique_id', sa.String(), nullable=True),
26 | sa.Column('delay', sa.Integer(), nullable=True),
27 | sa.Column('wait_begin_time', sa.DateTime(), nullable=True),
28 | sa.Column('status', sa.String(), nullable=True),
29 | sa.Column('created_at', sa.DateTime(), nullable=True),
30 | sa.Column('updated_at', sa.DateTime(), nullable=True),
31 | sa.PrimaryKeyConstraint('id')
32 | )
33 | # ### end Alembic commands ###
34 |
35 |
36 | def downgrade() -> None:
37 | # ### commands auto generated by Alembic - please adjust! ###
38 | op.drop_table('agent_workflow_step_waits')
39 | # ### end Alembic commands ###
40 |
--------------------------------------------------------------------------------
/migrations/versions/cac478732572_delete_agent_feature.py:
--------------------------------------------------------------------------------
1 | """delete_agent_feature
2 |
3 | Revision ID: cac478732572
4 | Revises: e39295ec089c
5 | Create Date: 2023-07-13 17:18:42.003412
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 | # revision identifiers, used by Alembic.
12 | revision = 'cac478732572'
13 | down_revision = 'e39295ec089c'
14 | branch_labels = None
15 | depends_on = None
16 |
17 |
18 | def upgrade() -> None:
19 | op.add_column('agents', sa.Column('is_deleted', sa.Boolean(), nullable=True, server_default=sa.false()))
20 |
21 |
22 | def downgrade() -> None:
23 | op.drop_column('agents', 'is_deleted')
24 |
--------------------------------------------------------------------------------
/migrations/versions/d8315244ea43_updated_tool_configs.py:
--------------------------------------------------------------------------------
1 | """updated_tool_configs
2 |
3 | Revision ID: d8315244ea43
4 | Revises: 71e3980d55f5
5 | Create Date: 2023-08-01 11:11:32.725355
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = 'd8315244ea43'
14 | down_revision = '71e3980d55f5'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | # ### commands auto generated by Alembic - please adjust! ###
21 | op.add_column('tool_configs', sa.Column('key_type', sa.String(), nullable=True))
22 | op.add_column('tool_configs', sa.Column('is_secret', sa.Boolean(), nullable=True))
23 | op.add_column('tool_configs', sa.Column('is_required', sa.Boolean(), nullable=True))
24 | # ### end Alembic commands ###
25 |
26 |
27 | def downgrade() -> None:
28 | # ### commands auto generated by Alembic - please adjust! ###
29 | op.drop_column('tool_configs', 'is_required')
30 | op.drop_column('tool_configs', 'is_secret')
31 | op.drop_column('tool_configs', 'key_type')
32 | # ### end Alembic commands ###
33 |
--------------------------------------------------------------------------------
/migrations/versions/d9b3436197eb_renaming_templates.py:
--------------------------------------------------------------------------------
1 | """renaming templates
2 |
3 | Revision ID: d9b3436197eb
4 | Revises: 3356a2f89a33
5 | Create Date: 2023-06-10 09:28:28.262705
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 |
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = 'd9b3436197eb'
14 | down_revision = '3356a2f89a33'
15 | branch_labels = None
16 | depends_on = None
17 |
18 |
19 | def upgrade() -> None:
20 | op.rename_table('agent_templates', 'agent_workflows')
21 | op.rename_table('agent_template_steps', 'agent_workflow_steps')
22 | with op.batch_alter_table('agent_workflow_steps') as bop:
23 | bop.alter_column('agent_template_id', new_column_name='agent_workflow_id')
24 | with op.batch_alter_table('agents') as bop:
25 | bop.alter_column('agent_template_id', new_column_name='agent_workflow_id')
26 |
27 |
28 | def downgrade() -> None:
29 | op.rename_table('agent_workflows', 'agent_templates')
30 | op.rename_table('agent_workflow_steps', 'agent_template_steps')
31 | with op.batch_alter_table('agent_templates') as bop:
32 | bop.alter_column('agent_workflow_id', new_column_name='agent_template_id')
33 | with op.batch_alter_table('agents') as bop:
34 | bop.alter_column('agent_workflow_id', new_column_name='agent_template_id')
35 |
--------------------------------------------------------------------------------
/nginx/default.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 |
4 | location / {
5 | proxy_pass http://gui:3000;
6 | proxy_set_header Host $host;
7 | proxy_set_header X-Real-IP $remote_addr;
8 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9 | }
10 |
11 | location /api {
12 | proxy_pass http://backend:8001;
13 | client_max_body_size 50M;
14 | proxy_set_header Host $host;
15 | proxy_set_header X-Real-IP $remote_addr;
16 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
17 | rewrite ^/api/(.*) /$1 break;
18 | }
19 | location /_next/webpack-hmr {
20 | proxy_pass http://gui:3000;
21 | proxy_http_version 1.1;
22 | proxy_set_header Upgrade $http_upgrade;
23 | proxy_set_header Connection "upgrade";
24 | proxy_set_header Host $host;
25 | proxy_cache_bypass $http_upgrade;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "axios": "^1.4.0",
4 | "react-toastify": "^9.1.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/run.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | echo Checking if config.yaml file exists...
3 | if not exist config.yaml (
4 | echo ERROR: config.yaml file not found. Please create the config.yaml file.
5 | exit /b 1
6 | )
7 | echo Checking if virtual environment is activated...
8 | if not defined VIRTUAL_ENV (
9 | echo Virtual environment not activated. Creating and activating virtual environment...
10 | python3 -m venv venv
11 | if errorlevel 1 (
12 | echo Error: Failed to create virtual environment.
13 | exit /b 1
14 | )
15 | call venv\Scripts\activate.bat
16 | ) else (
17 | echo Virtual environment is already activated.
18 | )
19 | echo Checking requirements...
20 | pip show -r requirements.txt >nul 2>&1
21 | if errorlevel 1 (
22 | echo Installing requirements...
23 | pip install -r requirements.txt >nul 2>&1
24 | ) else (
25 | echo All packages are already installed.
26 | )
27 | echo Running test.py with python...
28 | python test.py
29 | if errorlevel 1 (
30 | echo Running test.py with python3...
31 | python3 test.py
32 | )
--------------------------------------------------------------------------------
/run_gui.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | api_process=""
4 | ui_process=""
5 |
6 | function check_command() {
7 | command -v "$1" >/dev/null 2>&1
8 | if [ $? -ne 0 ]; then
9 | echo "$1 is not installed. Please install $1 to proceed."
10 | exit 1
11 | fi
12 | }
13 |
14 | function run_npm_commands() {
15 | cd gui
16 | npm install
17 | if [ $? -ne 0 ]; then
18 | echo "Error during 'npm install'. Exiting."
19 | exit 1
20 | fi
21 |
22 | npm run build
23 | if [ $? -ne 0 ]; then
24 | echo "Error during 'npm run build'. Exiting."
25 | exit 1
26 | fi
27 |
28 | cd ..
29 | }
30 |
31 | function run_server() {
32 | uvicorn main:app --host 0.0.0.0 --port 8000 &
33 | api_process=$!
34 | cd gui && npm run dev &
35 | ui_process=$!
36 | }
37 |
38 | function cleanup() {
39 | echo "Shutting down processes..."
40 | kill $api_process
41 | kill $ui_process
42 | echo "Processes terminated. Exiting."
43 | exit 1
44 | }
45 |
46 | trap cleanup SIGINT
47 |
48 | check_command "node"
49 | check_command "npm"
50 | check_command "uvicorn"
51 |
52 | run_npm_commands
53 | run_server
54 |
55 | wait $api_process
--------------------------------------------------------------------------------
/static/super-agi-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/static/super-agi-1.png
--------------------------------------------------------------------------------
/superagi/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/__init__.py
--------------------------------------------------------------------------------
/superagi/agent/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/agent/__init__.py
--------------------------------------------------------------------------------
/superagi/agent/common_types.py:
--------------------------------------------------------------------------------
1 | from pydantic import BaseModel
2 |
3 |
4 | class ToolExecutorResponse(BaseModel):
5 | status: str
6 | result: str = None
7 | retry: bool = False
8 | is_permission_required: bool = False
9 | permission_id: int = None
10 |
11 |
12 | class TaskExecutorResponse(BaseModel):
13 | status: str
14 | retry: bool
15 |
--------------------------------------------------------------------------------
/superagi/agent/prompts/agent_queue_input.txt:
--------------------------------------------------------------------------------
1 | Use the below instruction and break down the last response to an individual array of items that can be inserted into the queue.
2 |
3 | INSTRUCTION: `{instruction}`
4 |
5 | Respond with an array of items that are JSON parsable and can be inserted into the queue.
6 | Ignore the header row in the case of csv.
7 |
--------------------------------------------------------------------------------
/superagi/agent/prompts/agent_recursive_summary.txt:
--------------------------------------------------------------------------------
1 | AI, you are provided with a previous summary of interactions between the system, user, and assistant, as well as additional conversations that were not included in the original summary.
2 | If the previous summary is empty, your task is to create a summary based solely on the new interactions.
3 |
4 | Previous Summary: {previous_ltm_summary}
5 |
6 | {past_messages}
7 |
8 | If the previous summary is not empty, your final summary should integrate the new interactions into the existing summary to create a comprehensive recap of all interactions.
9 | If the previous summary is empty, your summary should encapsulate the main points of the new conversations.
10 | In both cases, highlight the key issues discussed, decisions made, and any actions assigned.
11 | Please ensure that the final summary does not exceed {char_limit} characters.
--------------------------------------------------------------------------------
/superagi/agent/prompts/agent_summary.txt:
--------------------------------------------------------------------------------
1 | AI, your task is to generate a concise summary of the previous interactions between the system, user, and assistant.
2 | The interactions are as follows:
3 |
4 | {past_messages}
5 |
6 | This summary should encapsulate the main points of the conversation, highlighting the key issues discussed, decisions made, and any actions assigned.
7 | It should serve as a recap of the past interaction, providing a clear understanding of the conversation's context and outcomes.
8 | Please ensure that the summary does not exceed {char_limit} characters.
--------------------------------------------------------------------------------
/superagi/agent/prompts/agent_tool_input.txt:
--------------------------------------------------------------------------------
1 | {tool_name} is the most suitable tool for the given instruction, use {tool_name} to perform the below instruction which lets you achieve the high level goal.
2 |
3 | High-Level GOAL:
4 | `{goals}`
5 |
6 | INSTRUCTION: `{instruction}`
7 |
8 | Respond with tool name and tool arguments to achieve the instruction.
9 |
10 | {tool_schema}
11 |
12 | Respond with only valid JSON conforming to the following json schema. You should generate JSON as output and not JSON schema.
13 |
14 | JSON Schema:
15 | {
16 | "$schema": "http://json-schema.org/draft-07/schema#",
17 | "type": "object",
18 | "properties": {
19 | "name": {
20 | "type": "string",
21 | "description": "{tool_name}",
22 | },
23 | "args": {
24 | "type": "object",
25 | "description": "tool arguments",
26 | }
27 | },
28 | "required": ["name", "args"]
29 | }
--------------------------------------------------------------------------------
/superagi/agent/prompts/agent_tool_output.txt:
--------------------------------------------------------------------------------
1 | Analyze {tool_name} output and follow the instruction to come up with the response:
2 | High-Level GOAL:
3 | `{goals}`
4 |
5 | TOOL OUTPUT:
6 | `{tool_output}`
7 |
8 | INSTRUCTION: `{instruction}`
9 |
10 | Analyze the instruction and respond with one of the below outputs. Response should be one of the below options:
11 | {output_options}
--------------------------------------------------------------------------------
/superagi/agent/prompts/create_tasks.txt:
--------------------------------------------------------------------------------
1 | You are an AI assistant to create task.
2 |
3 | High level goal:
4 | {goals}
5 |
6 | {task_instructions}
7 |
8 | You have following incomplete tasks `{pending_tasks}`. You have following completed tasks `{completed_tasks}`.
9 |
10 | Task History:
11 | `{task_history}`
12 |
13 | Based on this, create a single task in plain english to be completed by your AI system ONLY IF REQUIRED to get closer to or fully reach your high level goal.
14 | Don't create any task if it is already covered in incomplete or completed tasks.
15 | Ensure your new task are not deviated from completing the goal.
16 |
17 | Your answer should be an array of tasks in plain english that can be used with JSON.parse() and NOTHING ELSE. Return empty array if no new task is required.
18 |
--------------------------------------------------------------------------------
/superagi/agent/prompts/initialize_tasks.txt:
--------------------------------------------------------------------------------
1 | You are a task-generating AI known as SuperAGI. You are not a part of any system or device. Your role is to understand the goals presented to you, identify important components, Go through the instruction provided by the user and construct a thorough execution plan.
2 |
3 | GOALS:
4 | {goals}
5 |
6 | {task_instructions}
7 |
8 | Construct a sequence of actions, not exceeding 3 steps, to achieve this goal.
9 |
10 | Submit your response as a formatted ARRAY of strings, suitable for utilization with JSON.parse().
11 |
12 |
--------------------------------------------------------------------------------
/superagi/agent/prompts/prioritize_tasks.txt:
--------------------------------------------------------------------------------
1 | You are a task prioritization AI assistant.
2 |
3 | High level goal:
4 | {goals}
5 |
6 | {task_instructions}
7 |
8 | You have following incomplete tasks `{pending_tasks}`. You have following completed tasks `{completed_tasks}`.
9 |
10 | Based on this, evaluate the incomplete tasks and sort them in the order of execution. In output first task will be executed first and so on.
11 | Remove if any tasks are unnecessary or duplicate incomplete tasks. Remove tasks if they are already covered in completed tasks.
12 | Remove tasks if it does not help in achieving the main goal.
13 |
14 | Your answer should be an array of strings that can be used with JSON.parse() and NOTHING ELSE.
--------------------------------------------------------------------------------
/superagi/agent/types/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/agent/types/__init__.py
--------------------------------------------------------------------------------
/superagi/agent/types/agent_execution_status.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class AgentExecutionStatus(Enum):
5 | RUNNING = 'RUNNING'
6 | WAITING_FOR_PERMISSION = 'WAITING_FOR_PERMISSION'
7 | ITERATION_LIMIT_EXCEEDED = 'ITERATION_LIMIT_EXCEEDED'
8 | WAIT_STEP = 'WAIT_STEP'
9 | COMPLETED = 'COMPLETED'
10 |
11 | @classmethod
12 | def get_agent_execution_status(cls, store):
13 | if store is None:
14 | raise ValueError("Storage type cannot be None.")
15 | store = store.upper()
16 | if store in cls.__members__:
17 | return cls[store]
18 | raise ValueError(f"{store} is not a valid storage name.")
19 |
--------------------------------------------------------------------------------
/superagi/agent/types/agent_workflow_step_action_types.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class AgentWorkflowStepAction(Enum):
5 | ITERATION_WORKFLOW = 'ITERATION_WORKFLOW'
6 | TOOL = 'TOOL'
7 | WAIT_STEP = 'WAIT_STEP'
8 |
9 |
10 | @classmethod
11 | def get_agent_workflow_action_type(cls, store):
12 | if store is None:
13 | raise ValueError("Storage type cannot be None.")
14 | store = store.upper()
15 | if store in cls.__members__:
16 | return cls[store]
17 | raise ValueError(f"{store} is not a valid storage name.")
18 |
--------------------------------------------------------------------------------
/superagi/agent/types/wait_step_status.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class AgentWorkflowStepWaitStatus(Enum):
5 | PENDING = 'PENDING'
6 | WAITING = 'WAITING'
7 | COMPLETED = 'COMPLETED'
8 |
9 | @classmethod
10 | def get_agent_workflow_step_wait_status(cls, store):
11 | if store is None:
12 | raise ValueError("Storage type cannot be None.")
13 | store = store.upper()
14 | if store in cls.__members__:
15 | return cls[store]
16 | raise ValueError(f"{store} is not a valid storage name.")
17 |
--------------------------------------------------------------------------------
/superagi/apm/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/apm/__init__.py
--------------------------------------------------------------------------------
/superagi/apm/event_handler.py:
--------------------------------------------------------------------------------
1 | import logging
2 | from typing import Optional, Dict
3 | from sqlalchemy.exc import SQLAlchemyError
4 | from sqlalchemy.orm import Session
5 |
6 | from superagi.models.events import Event
7 |
8 | class EventHandler:
9 |
10 | def __init__(self, session: Session):
11 | self.session = session
12 |
13 | def create_event(self, event_name: str, event_property: Dict, agent_id: int,
14 | org_id: int, event_value: int = 1) -> Optional[Event]:
15 | try:
16 | event = Event(
17 | event_name=event_name,
18 | event_value=event_value,
19 | event_property=event_property,
20 | agent_id=agent_id,
21 | org_id=org_id,
22 | )
23 | self.session.add(event)
24 | self.session.commit()
25 | return event
26 | except SQLAlchemyError as err:
27 | logging.error(f"Error while creating event: {str(err)}")
28 | return None
--------------------------------------------------------------------------------
/superagi/config/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/config/__init__.py
--------------------------------------------------------------------------------
/superagi/controllers/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/controllers/__init__.py
--------------------------------------------------------------------------------
/superagi/controllers/agent_workflow.py:
--------------------------------------------------------------------------------
1 | from fastapi import APIRouter
2 | from fastapi import Depends
3 | from fastapi_sqlalchemy import db
4 |
5 | from superagi.helper.auth import get_user_organisation
6 | from superagi.models.workflows.agent_workflow import AgentWorkflow
7 |
8 | router = APIRouter()
9 |
10 |
11 | @router.get("/list", status_code=201)
12 | def list_workflows(organisation=Depends(get_user_organisation)):
13 | """
14 | Lists agent workflows.
15 |
16 | Args:
17 | organisation: User's organisation.
18 |
19 | Returns:
20 | list: A list of dictionaries representing the agent workflows.
21 |
22 | """
23 |
24 | workflows = db.session.query(AgentWorkflow).all()
25 |
26 | output_json = []
27 | for workflow in workflows:
28 | output_json.append(workflow.to_dict())
29 | return output_json
30 |
--------------------------------------------------------------------------------
/superagi/controllers/knowledge_configs.py:
--------------------------------------------------------------------------------
1 | from fastapi_sqlalchemy import db
2 | from fastapi import HTTPException, Depends, Query, status
3 | from fastapi import APIRouter
4 | from superagi.config.config import get_config
5 | from superagi.helper.auth import check_auth
6 | from superagi.models.knowledge_configs import KnowledgeConfigs
7 | from fastapi_jwt_auth import AuthJWT
8 |
9 | router = APIRouter()
10 |
11 | @router.get("/marketplace/details/{knowledge_id}")
12 | def get_marketplace_knowledge_configs(knowledge_id: int):
13 | knowledge_configs = db.session.query(KnowledgeConfigs).filter(KnowledgeConfigs.knowledge_id == knowledge_id).all()
14 | return knowledge_configs
15 |
16 |
--------------------------------------------------------------------------------
/superagi/controllers/marketplace_stats.py:
--------------------------------------------------------------------------------
1 | from fastapi_sqlalchemy import db
2 | from fastapi import HTTPException, Depends, Query, status
3 | from fastapi import APIRouter
4 | from superagi.config.config import get_config
5 | from superagi.models.marketplace_stats import MarketPlaceStats
6 | from superagi.models.vector_dbs import Vectordbs
7 |
8 | router = APIRouter()
9 |
10 | @router.get("/knowledge/downloads/{knowledge_id}")
11 | def count_knowledge_downloads(knowledge_id: int):
12 | download_number = db.session.query(MarketPlaceStats).filter(MarketPlaceStats.reference_id == knowledge_id, MarketPlaceStats.reference_name == "KNOWLEDGE", MarketPlaceStats.key == "download_count").first()
13 | if download_number is None:
14 | downloads = 0
15 | else:
16 | downloads = download_number.value
17 | return downloads
--------------------------------------------------------------------------------
/superagi/controllers/types/agent_execution_config.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | from typing import List, Optional
3 | from pydantic import BaseModel
4 | from datetime import datetime
5 |
6 |
7 | class AgentRunIn(BaseModel):
8 | status: Optional[str]
9 | name: Optional[str]
10 | agent_id: Optional[int]
11 | last_execution_time: Optional[datetime]
12 | num_of_calls: Optional[int]
13 | num_of_tokens: Optional[int]
14 | current_step_id: Optional[int]
15 | permission_id: Optional[int]
16 | goal: Optional[List[str]]
17 | instruction: Optional[List[str]]
18 | agent_workflow: str
19 | constraints: List[str]
20 | toolkits: List[int]
21 | tools: List[int]
22 | exit: str
23 | iteration_interval: int
24 | model: str
25 | permission_type: str
26 | LTM_DB: str
27 | max_iterations: int
28 | user_timezone: Optional[str]
29 | knowledge: Optional[int]
30 |
31 | class Config:
32 | orm_mode = True
--------------------------------------------------------------------------------
/superagi/controllers/types/agent_publish_config.py:
--------------------------------------------------------------------------------
1 | from typing import List, Optional
2 | from pydantic import BaseModel
3 |
4 | class AgentPublish(BaseModel):
5 | name: str
6 | description: str
7 | agent_template_id: int
8 | goal: Optional[List[str]]
9 | instruction: Optional[List[str]]
10 | constraints: List[str]
11 | toolkits: List[int]
12 | tools: List[int]
13 | exit: str
14 | iteration_interval: int
15 | model: str
16 | permission_type: str
17 | LTM_DB: str
18 | max_iterations: int
19 | user_timezone: Optional[str]
20 | knowledge: Optional[int]
21 |
22 | class Config:
23 | orm_mode = True
--------------------------------------------------------------------------------
/superagi/controllers/types/agent_schedule.py:
--------------------------------------------------------------------------------
1 | from pydantic import BaseModel
2 | from typing import Optional
3 | from datetime import datetime
4 |
5 | class AgentScheduleInput(BaseModel):
6 | agent_id: Optional[int]
7 | start_time: datetime
8 | recurrence_interval: Optional[str] = None
9 | expiry_date: Optional[datetime] = None
10 | expiry_runs: Optional[int] = -1
11 |
--------------------------------------------------------------------------------
/superagi/controllers/types/agent_with_config_schedule.py:
--------------------------------------------------------------------------------
1 | from pydantic import BaseModel
2 | from superagi.controllers.types.agent_schedule import AgentScheduleInput
3 | from superagi.controllers.types.agent_with_config import AgentConfigInput
4 |
5 |
6 | class AgentConfigSchedule(BaseModel):
7 | agent_config: AgentConfigInput
8 | schedule: AgentScheduleInput
--------------------------------------------------------------------------------
/superagi/controllers/types/models_types.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 | class ModelsTypes(Enum):
4 | MARKETPLACE = "Marketplace"
5 | CUSTOM = "Custom"
6 |
7 | @classmethod
8 | def get_models_types(cls, model_type):
9 | if model_type is None:
10 | raise ValueError("Queue status type cannot be None.")
11 | model_type = model_type.upper()
12 | if model_type in cls.__members__:
13 | return cls[model_type]
14 | raise ValueError(f"{model_type} is not a valid storage name.")
--------------------------------------------------------------------------------
/superagi/helper/error_handler.py:
--------------------------------------------------------------------------------
1 | from superagi.models.agent_execution import AgentExecution
2 | from superagi.models.agent_execution_feed import AgentExecutionFeed
3 |
4 | class ErrorHandler:
5 |
6 | def handle_openai_errors(session, agent_id, agent_execution_id, error_message):
7 | execution = session.query(AgentExecution).filter(AgentExecution.id == agent_execution_id).first()
8 | agent_feed = AgentExecutionFeed(agent_execution_id=agent_execution_id, agent_id=agent_id, role="system", feed="", error_message=error_message, feed_group_id=execution.current_feed_group_id)
9 | session.add(agent_feed)
10 | session.commit()
--------------------------------------------------------------------------------
/superagi/helper/imap_email.py:
--------------------------------------------------------------------------------
1 | import imaplib
2 |
3 |
4 | class ImapEmail:
5 |
6 | def imap_open(self, imap_folder, email_sender, email_password, imap_server) -> imaplib.IMAP4_SSL:
7 | """
8 | Function to open an IMAP connection to the email server.
9 |
10 | Args:
11 | imap_folder (str): The folder to open.
12 | email_sender (str): The email address of the sender.
13 | email_password (str): The password of the sender.
14 |
15 | Returns:
16 | imaplib.IMAP4_SSL: The IMAP connection.
17 | """
18 | conn = imaplib.IMAP4_SSL(imap_server)
19 | conn.login(email_sender, email_password)
20 | conn.select(imap_folder)
21 | return conn
22 |
23 | def adjust_imap_folder(self, imap_folder, email_sender) -> str:
24 | """
25 | Function to adjust the IMAP folder based on the email address of the sender.
26 |
27 | Args:
28 | imap_folder (str): The folder to open.
29 | email_sender (str): The email address of the sender.
30 |
31 | Returns:
32 | str: The adjusted IMAP folder.
33 | """
34 | if "@gmail" in email_sender.lower():
35 | if "sent" in imap_folder.lower():
36 | return '"[Gmail]/Sent Mail"'
37 | if "draft" in imap_folder.lower():
38 | return '"[Gmail]/Drafts"'
39 | return imap_folder
40 |
--------------------------------------------------------------------------------
/superagi/helper/llm_loader.py:
--------------------------------------------------------------------------------
1 | from llama_cpp import Llama
2 | from llama_cpp import LlamaGrammar
3 | from superagi.config.config import get_config
4 | from superagi.lib.logger import logger
5 |
6 |
7 | class LLMLoader:
8 | _instance = None
9 | _model = None
10 | _grammar = None
11 |
12 | def __new__(cls, *args, **kwargs):
13 | if cls._instance is None:
14 | cls._instance = super(LLMLoader, cls).__new__(cls)
15 | return cls._instance
16 |
17 | def __init__(self, context_length):
18 | self.context_length = context_length
19 |
20 | @property
21 | def model(self):
22 | if self._model is None:
23 | try:
24 | self._model = Llama(
25 | model_path="/app/local_model_path", n_ctx=self.context_length, n_gpu_layers=int(get_config('GPU_LAYERS', '-1')))
26 | except Exception as e:
27 | logger.error(e)
28 | return self._model
29 |
30 | @property
31 | def grammar(self):
32 | if self._grammar is None:
33 | try:
34 | self._grammar = LlamaGrammar.from_file(
35 | "superagi/llms/grammar/json.gbnf")
36 | except Exception as e:
37 | logger.error(e)
38 | return self._grammar
39 |
--------------------------------------------------------------------------------
/superagi/helper/models_helper.py:
--------------------------------------------------------------------------------
1 | from superagi.llms.hugging_face import HuggingFace
2 |
3 | class ModelsHelper:
4 | @staticmethod
5 | def validate_end_point(model_api_key, end_point, model_provider):
6 | response = {"success": True}
7 |
8 | if (model_provider == 'Hugging Face'):
9 | try:
10 | result = HuggingFace(api_key=model_api_key, end_point=end_point).verify_end_point()
11 | except Exception as e:
12 | response['success'] = False
13 | response['error'] = str(e)
14 | else:
15 | response['result'] = result
16 |
17 | return response
18 |
19 |
20 |
--------------------------------------------------------------------------------
/superagi/helper/prompt_reader.py:
--------------------------------------------------------------------------------
1 | from pathlib import Path
2 |
3 |
4 | class PromptReader:
5 | @staticmethod
6 | def read_tools_prompt(current_file: str, prompt_file: str) -> str:
7 | file_path = str(Path(current_file).resolve().parent) + "/prompts/" + prompt_file
8 | try:
9 | f = open(file_path, "r")
10 | file_content = f.read()
11 | f.close()
12 | except FileNotFoundError as e:
13 | print(e.__str__())
14 | raise e
15 | return file_content
16 |
17 | @staticmethod
18 | def read_agent_prompt(current_file: str, prompt_file: str) -> str:
19 | file_path = str(Path(current_file).resolve().parent) + "/prompts/" + prompt_file
20 | try:
21 | f = open(file_path, "r")
22 | file_content = f.read()
23 | f.close()
24 | except FileNotFoundError as e:
25 | print(e.__str__())
26 | raise e
27 | return file_content
28 |
--------------------------------------------------------------------------------
/superagi/helper/validate_csv.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import pandas as pd
3 | import chardet
4 | from superagi.lib.logger import logger
5 |
6 | def correct_csv_encoding(file_path):
7 | with open(file_path, 'rb') as f:
8 | result = chardet.detect(f.read())
9 | encoding = result['encoding']
10 |
11 | if encoding != 'utf-8':
12 | data = []
13 | with open(file_path, 'r', encoding=encoding) as f:
14 | reader = csv.reader(f, delimiter=',', quotechar='"')
15 | for row in reader:
16 | try:
17 | data.append(row)
18 | except Exception as e:
19 | logger.error(f"An error occurred while processing the file: {e}")
20 | continue
21 |
22 | df = pd.DataFrame(data)
23 | df.to_csv(file_path, encoding='utf-8', index=False)
24 | logger.info("File is converted to utf-8 encoding.")
25 | else:
26 | logger.info("File is already in utf-8 encoding.")
--------------------------------------------------------------------------------
/superagi/image_llms/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/image_llms/__init__.py
--------------------------------------------------------------------------------
/superagi/image_llms/base_image_llm.py:
--------------------------------------------------------------------------------
1 | from abc import ABC, abstractmethod
2 |
3 |
4 | class BaseImageLlm(ABC):
5 | @abstractmethod
6 | def get_image_model(self):
7 | pass
8 |
9 | @abstractmethod
10 | def generate_image(self, prompt: str, size: int = 512, num: int = 2):
11 | pass
12 |
--------------------------------------------------------------------------------
/superagi/image_llms/openai_dalle.py:
--------------------------------------------------------------------------------
1 | import openai
2 |
3 | from superagi.config.config import get_config
4 | from superagi.image_llms.base_image_llm import BaseImageLlm
5 |
6 |
7 | class OpenAiDalle(BaseImageLlm):
8 | def __init__(self, api_key, image_model=None, number_of_results=1):
9 | """
10 | Args:
11 | api_key (str): The OpenAI API key.
12 | image_model (str): The image model.
13 | number_of_results (int): The number of results.
14 | """
15 | self.number_of_results = number_of_results
16 | self.api_key = api_key
17 | self.image_model = image_model
18 | openai.api_key = api_key
19 | openai.api_base = get_config("OPENAI_API_BASE", "https://api.openai.com/v1")
20 |
21 | def get_image_model(self):
22 | """
23 | Returns:
24 | str: The image model.
25 | """
26 | return self.image_model
27 |
28 | def generate_image(self, prompt: str, size: int = 512):
29 | """
30 | Call the OpenAI image API.
31 |
32 | Args:
33 | prompt (str): The prompt.
34 | size (int): The size.
35 | num (int): The number of images.
36 |
37 | Returns:
38 | dict: The response.
39 | """
40 | response = openai.Image.create(
41 | prompt=prompt,
42 | n=self.number_of_results,
43 | size=f"{size}x{size}"
44 | )
45 | return response
46 |
--------------------------------------------------------------------------------
/superagi/jobs/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/jobs/__init__.py
--------------------------------------------------------------------------------
/superagi/llms/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/llms/__init__.py
--------------------------------------------------------------------------------
/superagi/llms/base_llm.py:
--------------------------------------------------------------------------------
1 | from abc import ABC, abstractmethod
2 |
3 |
4 | class BaseLlm(ABC):
5 | @abstractmethod
6 | def chat_completion(self, prompt):
7 | pass
8 |
9 | @abstractmethod
10 | def get_source(self):
11 | pass
12 |
13 | @abstractmethod
14 | def get_api_key(self):
15 | pass
16 |
17 | @abstractmethod
18 | def get_model(self):
19 | pass
20 |
21 | @abstractmethod
22 | def get_models(self):
23 | pass
24 |
25 | @abstractmethod
26 | def verify_access_key(self):
27 | pass
28 |
--------------------------------------------------------------------------------
/superagi/llms/grammar/json.gbnf:
--------------------------------------------------------------------------------
1 | root ::= object
2 | value ::= object | array | string | number | ("true" | "false" | "null") ws
3 |
4 | object ::=
5 | "{" ws (
6 | string ":" ws value
7 | ("," ws string ":" ws value)*
8 | )? "}" ws
9 |
10 | array ::=
11 | "[" ws (
12 | value
13 | ("," ws value)*
14 | )? "]" ws
15 |
16 | string ::=
17 | "\"" (
18 | [^"\\] |
19 | "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
20 | )* "\"" ws
21 |
22 | number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws
23 |
24 | # Optional space: by convention, applied in this grammar after literal chars when allowed
25 | ws ::= ([ \t\n] ws)?
26 |
--------------------------------------------------------------------------------
/superagi/llms/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/llms/utils/__init__.py
--------------------------------------------------------------------------------
/superagi/llms/utils/huggingface_utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/llms/utils/huggingface_utils/__init__.py
--------------------------------------------------------------------------------
/superagi/llms/utils/huggingface_utils/public_endpoints.py:
--------------------------------------------------------------------------------
1 | ACCOUNT_VERIFICATION_URL = "https://huggingface.co/api/whoami-v2"
--------------------------------------------------------------------------------
/superagi/models/__init__.py:
--------------------------------------------------------------------------------
1 | import glob
2 | from os.path import basename, dirname, isfile, join
3 |
4 | modules = glob.glob(join(dirname(__file__), "*.py"))
5 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith("__init__.py")]
--------------------------------------------------------------------------------
/superagi/models/budget.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, Integer, String, Float
2 | from superagi.models.base_model import DBBaseModel
3 |
4 |
5 | class Budget(DBBaseModel):
6 | """
7 | Model representing a budget.
8 |
9 | Attributes:
10 | id (Integer): The primary key of the budget.
11 | budget (Float): The budget value.
12 | cycle (String): The cycle of the budget.
13 | """
14 |
15 | __tablename__ = 'budgets'
16 |
17 | id = Column(Integer, primary_key=True)
18 | budget = Column(Float)
19 | cycle = Column(String)
20 |
21 | def __repr__(self):
22 | """
23 | Returns a string representation of the Budget object.
24 |
25 | Returns:
26 | str: String representation of the Budget object.
27 | """
28 |
29 | return (f"Budget(id={self.id}, budget={self.budget}, "
30 | f"cycle='{self.cycle}')")
31 |
--------------------------------------------------------------------------------
/superagi/models/types/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/models/types/__init__.py
--------------------------------------------------------------------------------
/superagi/models/types/agent_config.py:
--------------------------------------------------------------------------------
1 | from typing import Union
2 | from pydantic import BaseModel
3 |
4 | class AgentConfig(BaseModel):
5 | agent_id: int
6 | key: str
7 | value: Union[str, list]
8 |
9 | def __repr__(self):
10 | return f"AgentConfiguration(id={self.id}, key={self.key}, value={self.value})"
11 |
12 |
--------------------------------------------------------------------------------
/superagi/models/types/login_request.py:
--------------------------------------------------------------------------------
1 | from pydantic import BaseModel
2 |
3 |
4 | class LoginRequest(BaseModel):
5 | email: str
6 | password: str
7 |
--------------------------------------------------------------------------------
/superagi/models/types/validate_llm_api_key_request.py:
--------------------------------------------------------------------------------
1 | from pydantic import BaseModel
2 |
3 |
4 | class ValidateAPIKeyRequest(BaseModel):
5 | model_source: str
6 | model_api_key: str
7 |
--------------------------------------------------------------------------------
/superagi/models/user.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, Integer, String
2 |
3 | from superagi.models.base_model import DBBaseModel
4 |
5 |
6 | # from pydantic import BaseModel
7 |
8 | class User(DBBaseModel):
9 | """
10 | Model representing a user.
11 |
12 | Attributes:
13 | id (Integer): The primary key of the user.
14 | name (String): The name of the user.
15 | email (String): The email of the user.
16 | password (String): The password of the user.
17 | organisation_id (Integer): The ID of the associated organisation.
18 | """
19 |
20 | __tablename__ = 'users'
21 |
22 | id = Column(Integer, primary_key=True, autoincrement=True)
23 | name = Column(String)
24 | email = Column(String, unique=True)
25 | password = Column(String)
26 | organisation_id = Column(Integer)
27 | first_login_source = Column(String)
28 |
29 | def __repr__(self):
30 | """
31 | Returns a string representation of the User object.
32 |
33 | Returns:
34 | str: String representation of the User object.
35 | """
36 |
37 | return f"User(id={self.id}, name='{self.name}', email='{self.email}', password='{self.password}'," \
38 | f"organisation_id={self.organisation_id}, first_login_source={self.first_login_source})"
39 |
--------------------------------------------------------------------------------
/superagi/models/webhook_events.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, Integer, Text, String, Boolean, ForeignKey
2 | from sqlalchemy.orm import relationship
3 | from superagi.models.base_model import DBBaseModel
4 | from superagi.models.agent_execution import AgentExecution
5 |
6 |
7 | class WebhookEvents(DBBaseModel):
8 | """
9 |
10 | Attributes:
11 |
12 |
13 | Methods:
14 | """
15 | __tablename__ = 'webhook_events'
16 |
17 | id = Column(Integer, primary_key=True)
18 | agent_id=Column(Integer)
19 | run_id = Column(Integer)
20 | event = Column(String)
21 | status = Column(String)
22 | errors= Column(Text)
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/superagi/models/webhooks.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, Integer, Text, String, Boolean, ForeignKey,JSON
2 | from sqlalchemy.orm import relationship
3 | from sqlalchemy.dialects.postgresql import JSONB
4 | from superagi.models.base_model import DBBaseModel
5 | from superagi.models.agent_execution import AgentExecution
6 |
7 | class Webhooks(DBBaseModel):
8 | """
9 |
10 | Attributes:
11 |
12 |
13 | Methods:
14 | """
15 | __tablename__ = 'webhooks'
16 |
17 | id = Column(Integer, primary_key=True)
18 | name=Column(String)
19 | org_id = Column(Integer)
20 | url = Column(String)
21 | headers=Column(JSON)
22 | is_deleted=Column(Boolean)
23 | filters=Column(JSON)
24 |
--------------------------------------------------------------------------------
/superagi/models/workflows/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/models/workflows/__init__.py
--------------------------------------------------------------------------------
/superagi/resource_manager/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/resource_manager/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/apollo/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/apollo/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/apollo/apollo_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 |
4 | from superagi.tools.apollo.apollo_search import ApolloSearchTool
5 | from superagi.tools.base_tool import BaseToolkit, BaseTool, ToolConfiguration
6 | from superagi.types.key_type import ToolConfigKeyType
7 |
8 |
9 | class ApolloToolkit(BaseToolkit, ABC):
10 | name: str = "ApolloToolkit"
11 | description: str = "Apollo Tool kit contains all tools related to apollo.io tasks"
12 |
13 | def get_tools(self) -> List[BaseTool]:
14 | return [ApolloSearchTool()]
15 |
16 | def get_env_keys(self) -> List[str]:
17 | return [ToolConfiguration(key="APOLLO_SEARCH_KEY", key_type=ToolConfigKeyType.STRING, is_required=True)]
18 |
--------------------------------------------------------------------------------
/superagi/tools/code/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/code/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/code/coding_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 |
4 | from superagi.tools.base_tool import BaseToolkit, BaseTool, ToolConfiguration
5 | from superagi.tools.code.improve_code import ImproveCodeTool
6 | from superagi.tools.code.write_code import CodingTool
7 | from superagi.tools.code.write_spec import WriteSpecTool
8 | from superagi.tools.code.write_test import WriteTestTool
9 |
10 |
11 | class CodingToolkit(BaseToolkit, ABC):
12 | name: str = "CodingToolkit"
13 | description: str = "Coding Tool kit contains all tools related to coding tasks"
14 |
15 | def get_tools(self) -> List[BaseTool]:
16 | return [CodingTool(), WriteSpecTool(), WriteTestTool(), ImproveCodeTool()]
17 |
18 | def get_env_keys(self) -> List[ToolConfiguration]:
19 | return []
20 |
--------------------------------------------------------------------------------
/superagi/tools/code/prompts/generate_logic.txt:
--------------------------------------------------------------------------------
1 | You typically always place distinct classes in separate files.
2 | Always create a run.sh file which act as the entrypoint of the program, create it intellligently after analyzing the file types
3 | For Python, always generate a suitable requirements.txt file.
4 | For NodeJS, consistently produce an appropriate package.json file.
5 | Always include a brief comment that describes the purpose of the function definition.
6 | Attempt to provide comments that explain complicated logic.
7 | Consistently adhere to best practices for the specified languages, ensuring code is defined as a package or project.
8 |
9 | Preferred Python toolbelt:
10 | - pytest
11 | - dataclasses
--------------------------------------------------------------------------------
/superagi/tools/code/prompts/improve_code.txt:
--------------------------------------------------------------------------------
1 | You are a super smart developer. You have been tasked with fixing and filling the function and classes where only the description of code is written without the actual code . There might be placeholders in the code you have to fill in.
2 | You provide fully functioning, well formatted code with few comments, that works and has no bugs.
3 | If the code is already correct and doesn't need change, just return the same code
4 | However, make sure that you only return the improved code, without any additional content.
5 |
6 |
7 | Please structure the improved code as follows:
8 |
9 | ```
10 | CODE
11 | ```
12 |
13 | Please return the full new code in same format as the original code
14 | Don't write any explanation or description in your response other than the actual code
15 |
16 | Your high-level goal is:
17 | {goals}
18 |
19 | The content of the file you need to improve is:
20 | {content}
21 |
22 | Only return the code and not any other line
23 |
24 | To start, first analyze the existing code. Check for any function with missing logic inside it and fill the function.
25 | Make sure, that not a single function is empty or contains just comments, there should be function logic inside it
26 | Return fully completed functions by filling the placeholders
--------------------------------------------------------------------------------
/superagi/tools/code/prompts/write_spec.txt:
--------------------------------------------------------------------------------
1 | You are a super smart developer who has been asked to make a specification for a program.
2 |
3 | Your high-level goal is:
4 | {goals}
5 |
6 | Please keep in mind the following when creating the specification:
7 | 1. Be super explicit about what the program should do, which features it should have, and give details about anything that might be unclear.
8 | 2. Lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose.
9 | 3. List all non-standard dependencies that will have to be used.
10 |
11 | Write a specification for the following task:
12 | {task}
--------------------------------------------------------------------------------
/superagi/tools/code/prompts/write_test.txt:
--------------------------------------------------------------------------------
1 | You are a super smart developer who practices Test Driven Development for writing tests according to a specification.
2 |
3 | Your high-level goal is:
4 | {goals}
5 |
6 | Test Description:
7 | {test_description}
8 |
9 | {spec}
10 |
11 | Test should follow the following format:
12 | FILENAME is the lowercase file name including the file extension,
13 | [LANG] is the markup code block language for the code's language, and [UNIT_TEST_CODE] is the code:
14 |
15 | FILENAME
16 | ```[LANG]
17 | [UNIT_TEST_CODE]
18 | ```
19 |
20 | The tests should be as simple as possible, but still cover all the functionality described in the specification.
21 |
22 |
--------------------------------------------------------------------------------
/superagi/tools/duck_duck_go/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # SuperAGI DuckDuckGo Search Tool
6 |
7 | The SuperAGI DuckDuckGo Search Tool helps users perform a DuckDuckGo search and extract snippets and webpages.
8 |
9 | ## ⚙️ Installation
10 |
11 | ### 🛠 **Setting Up of SuperAGI**
12 |
13 | Set up the SuperAGI by following the instructions given (https://github.com/TransformerOptimus/SuperAGI/blob/main/README.MD)
14 |
15 | ## Running SuperAGI DuckDuckGo Search Tool
16 |
17 | You can simply ask your agent about latest information regarding anything in the world and your agent will be able to browse the internet to get that information for you.
18 |
--------------------------------------------------------------------------------
/superagi/tools/duck_duck_go/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/duck_duck_go/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/duck_duck_go/duck_duck_go_search_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.duck_duck_go.duck_duck_go_search import DuckDuckGoSearchTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 | from superagi.models.tool_config import ToolConfig
7 |
8 | class DuckDuckGoToolkit(BaseToolkit, ABC):
9 | name: str = "DuckDuckGo Search Toolkit"
10 | description: str = "Toolkit containing tools for performing DuckDuckGo search and extracting snippets and webpages"
11 |
12 | def get_tools(self) -> List[BaseTool]:
13 | return [DuckDuckGoSearchTool()]
14 |
15 | def get_env_keys(self) -> List[ToolConfiguration]:
16 | return [
17 | # Add more config keys specific to your project
18 | ]
19 |
--------------------------------------------------------------------------------
/superagi/tools/email/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/email/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/file/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/file/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/file/file_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.file.append_file import AppendFileTool
5 | from superagi.tools.file.delete_file import DeleteFileTool
6 | from superagi.tools.file.list_files import ListFileTool
7 | from superagi.tools.file.read_file import ReadFileTool
8 | from superagi.tools.file.write_file import WriteFileTool
9 | from superagi.types.key_type import ToolConfigKeyType
10 | from superagi.models.tool_config import ToolConfig
11 |
12 |
13 | class FileToolkit(BaseToolkit, ABC):
14 | name: str = "File Toolkit"
15 | description: str = "File Tool kit contains all tools related to file operations"
16 |
17 | def get_tools(self) -> List[BaseTool]:
18 | return [AppendFileTool(), DeleteFileTool(), ListFileTool(), ReadFileTool(), WriteFileTool()]
19 |
20 | def get_env_keys(self) -> List[ToolConfiguration]:
21 | return []
22 |
--------------------------------------------------------------------------------
/superagi/tools/github/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/github/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/github/github_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.github.add_file import GithubAddFileTool
5 | from superagi.tools.github.delete_file import GithubDeleteFileTool
6 | from superagi.tools.github.fetch_pull_request import GithubFetchPullRequest
7 | from superagi.tools.github.search_repo import GithubRepoSearchTool
8 | from superagi.tools.github.review_pull_request import GithubReviewPullRequest
9 | from superagi.types.key_type import ToolConfigKeyType
10 |
11 |
12 | class GitHubToolkit(BaseToolkit, ABC):
13 | name: str = "GitHub Toolkit"
14 | description: str = "GitHub Tool Kit contains all github related to tool"
15 |
16 | def get_tools(self) -> List[BaseTool]:
17 | return [GithubAddFileTool(), GithubDeleteFileTool(), GithubRepoSearchTool(), GithubReviewPullRequest(),
18 | GithubFetchPullRequest()]
19 |
20 | def get_env_keys(self) -> List[ToolConfiguration]:
21 | return [
22 | ToolConfiguration(key="GITHUB_ACCESS_TOKEN", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True),
23 | ToolConfiguration(key="GITHUB_USERNAME", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=False)
24 | ]
25 |
26 |
27 |
--------------------------------------------------------------------------------
/superagi/tools/google_calendar/google_calendar_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from superagi.tools.base_tool import BaseToolkit, BaseTool, ToolConfiguration
3 | from typing import Type, List
4 | from superagi.tools.google_calendar.create_calendar_event import CreateEventCalendarTool
5 | from superagi.tools.google_calendar.delete_calendar_event import DeleteCalendarEventTool
6 | from superagi.tools.google_calendar.list_calendar_events import ListCalendarEventsTool
7 | from superagi.tools.google_calendar.event_details_calendar import EventDetailsCalendarTool
8 | from superagi.types.key_type import ToolConfigKeyType
9 |
10 | class GoogleCalendarToolKit(BaseToolkit, ABC):
11 | name: str = "Google Calendar Toolkit"
12 | description: str = "Google Calendar Tool kit contains all tools related to Google Calendar"
13 |
14 | def get_tools(self) -> List[BaseTool]:
15 | return [CreateEventCalendarTool(), DeleteCalendarEventTool(), ListCalendarEventsTool(), EventDetailsCalendarTool()]
16 |
17 | def get_env_keys(self) -> List[ToolConfiguration]:
18 | return [
19 | ToolConfiguration(key="GOOGLE_CLIENT_ID", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = False),
20 | ToolConfiguration(key="GOOGLE_CLIENT_SECRET", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret= True)
21 | ]
22 |
--------------------------------------------------------------------------------
/superagi/tools/google_search/README.MD:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # SuperAGI Google Search Tool
6 |
7 | The SuperAGI Google Search Tool helps users perform a Google search and extract snippets and webpages.
8 |
9 | ## ⚙️ Installation
10 |
11 | ### 🛠 **Setting Up of SuperAGI**
12 | Set up the SuperAGI by following the instructions given (https://github.com/TransformerOptimus/SuperAGI/blob/main/README.MD)
13 |
14 | If you've put the correct Google API key and Custom Search Engine ID, you'll be able to use the Google Search Tool as well.
15 |
16 | ## Running SuperAGI Google Search Tool
17 |
18 | You can simply ask your agent about latest information regarding anything in the world and your agent will be able to browse the internet to get that information for you.
--------------------------------------------------------------------------------
/superagi/tools/google_search/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/google_search/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/google_search/google_search_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.google_search.google_search import GoogleSearchTool
5 | from superagi.models.tool_config import ToolConfig
6 | from superagi.types.key_type import ToolConfigKeyType
7 |
8 |
9 | class GoogleSearchToolkit(BaseToolkit, ABC):
10 | name: str = "Google Search Toolkit"
11 | description: str = "Toolkit containing tools for performing Google search and extracting snippets and webpages"
12 |
13 | def get_tools(self) -> List[BaseTool]:
14 | return [GoogleSearchTool()]
15 |
16 | def get_env_keys(self) -> List[ToolConfiguration]:
17 | return [
18 | ToolConfiguration(key="GOOGLE_API_KEY", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True),
19 | ToolConfiguration(key="SEARCH_ENGINE_ID", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=True)
20 | ]
21 |
--------------------------------------------------------------------------------
/superagi/tools/google_serp_search/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/google_serp_search/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/google_serp_search/google_serp_search_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.google_serp_search.google_serp_search import GoogleSerpTool
5 | from superagi.models.tool_config import ToolConfig
6 | from superagi.types.key_type import ToolConfigKeyType
7 |
8 | class GoogleSerpToolkit(BaseToolkit, ABC):
9 | name: str = "Google SERP Toolkit"
10 | description: str = "Toolkit containing tools for performing Google SERP search and extracting snippets and webpages"
11 |
12 | def get_tools(self) -> List[BaseTool]:
13 | return [GoogleSerpTool()]
14 |
15 | def get_env_keys(self) -> List[ToolConfiguration]:
16 | return [
17 | ToolConfiguration(key="SERP_API_KEY", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True)
18 | ]
19 |
--------------------------------------------------------------------------------
/superagi/tools/image_generation/README.MD:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # SuperAGI Image Generation Tool
6 |
7 | The SuperAGI Image Generation Tool helps you generate an image with a prompt using DALL-E.
8 |
9 | ## ⚙️ Installation
10 |
11 | ### 🛠 **Setting Up of SuperAGI**
12 | Set up the SuperAGI by following the instructions given (https://github.com/TransformerOptimus/SuperAGI/blob/main/README.MD)
13 |
14 | If you've put the correct OpenAI key during the installation, you'd be able to use the Image Generation tool as well.
15 |
16 | ## Running SuperAGI Image Generation Tool
17 |
18 | You can simply put one of the goals of your agent to create an image and the agent will pick up the Image Generation Tool and will place it in the Output folder of the Resource Manager, from where you'll be able to download it.
19 |
20 |
--------------------------------------------------------------------------------
/superagi/tools/image_generation/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/image_generation/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/image_generation/image_generation_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 |
4 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
5 | from superagi.tools.image_generation.dalle_image_gen import DalleImageGenTool
6 | from superagi.tools.image_generation.stable_diffusion_image_gen import StableDiffusionImageGenTool
7 | from superagi.types.key_type import ToolConfigKeyType
8 |
9 | class ImageGenToolkit(BaseToolkit, ABC):
10 | name: str = "Image Generation Toolkit"
11 | description: str = "Toolkit containing a tool for generating images"
12 |
13 | def get_tools(self) -> List[BaseTool]:
14 | return [DalleImageGenTool(), StableDiffusionImageGenTool()]
15 |
16 | def get_env_keys(self) -> List[ToolConfiguration]:
17 | return [
18 | ToolConfiguration(key="STABILITY_API_KEY", key_type=ToolConfigKeyType.STRING, is_required=False, is_secret = True),
19 | ToolConfiguration(key="ENGINE_ID", key_type=ToolConfigKeyType.STRING, is_required=False, is_secret=False),
20 | ToolConfiguration(key="OPENAI_API_KEY", key_type=ToolConfigKeyType.STRING, is_required=False, is_secret=True)
21 | ]
22 |
--------------------------------------------------------------------------------
/superagi/tools/instagram_tool/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/instagram_tool/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/instagram_tool/instagram_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.instagram_tool.instagram import InstagramTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 | class InstagramToolkit(BaseToolkit, ABC):
8 | name: str = "Instagram Toolkit"
9 | description: str = "Toolkit containing tools for posting AI generated photo on Instagram. Posts only one photo in a run "
10 |
11 | def get_tools(self) -> List[BaseTool]:
12 | return [InstagramTool()]
13 |
14 | def get_env_keys(self) -> List[ToolConfiguration]:
15 | return [
16 | ToolConfiguration(key="META_USER_ACCESS_TOKEN", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=True),
17 | ToolConfiguration(key="FACEBOOK_PAGE_ID", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=False)
18 | ]
--------------------------------------------------------------------------------
/superagi/tools/jira/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/jira/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/jira/jira_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.jira.create_issue import CreateIssueTool
5 | from superagi.tools.jira.edit_issue import EditIssueTool
6 | from superagi.tools.jira.get_projects import GetProjectsTool
7 | from superagi.tools.jira.search_issues import SearchJiraTool
8 | from superagi.types.key_type import ToolConfigKeyType
9 | from superagi.models.tool_config import ToolConfig
10 |
11 |
12 | class JiraToolkit(BaseToolkit, ABC):
13 | name: str = "Jira Toolkit"
14 | description: str = "Toolkit containing tools for Jira integration"
15 |
16 | def get_tools(self) -> List[BaseTool]:
17 | return [
18 | CreateIssueTool(),
19 | EditIssueTool(),
20 | GetProjectsTool(),
21 | SearchJiraTool(),
22 | ]
23 |
24 | def get_env_keys(self) -> List[ToolConfiguration]:
25 | return [
26 | ToolConfiguration(key="JIRA_INSTANCE_URL", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = False),
27 | ToolConfiguration(key="JIRA_USERNAME", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=False),
28 | ToolConfiguration(key="JIRA_API_TOKEN", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=True)
29 | ]
30 |
--------------------------------------------------------------------------------
/superagi/tools/jira/tool.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | import requests
4 | from typing import List, Type
5 | from pydantic import BaseModel, Field
6 |
7 | from superagi.config.config import get_config
8 | from superagi.tools.base_tool import BaseTool
9 | from jira import JIRA
10 |
11 | class JiraIssueSchema(BaseModel):
12 | issue_key: str = Field(
13 | ...,
14 | description="The key of the Jira issue.",
15 | )
16 | fields: dict = Field(
17 | ...,
18 | description="The fields to update for the Jira issue.",
19 | )
20 |
21 |
22 | class JiraTool(BaseTool):
23 | """
24 | Jira tool
25 |
26 | Attributes:
27 | name : The name.
28 | description : The description.
29 | args_schema : The args schema.
30 | """
31 | def build_jira_instance(self) -> dict:
32 | """
33 | Build a Jira instance.
34 |
35 | Returns:
36 | The Jira instance.
37 | """
38 | jira_instance_url = self.get_tool_config("JIRA_INSTANCE_URL")
39 | jira_username = self.get_tool_config("JIRA_USERNAME")
40 | jira_api_token = self.get_tool_config("JIRA_API_TOKEN")
41 | jira = JIRA(
42 | server=jira_instance_url,
43 | basic_auth=(jira_username, jira_api_token)
44 | )
45 | return jira
46 |
--------------------------------------------------------------------------------
/superagi/tools/knowledge_search/knowledge_search_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.knowledge_search.knowledge_search import KnowledgeSearchTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 | class KnowledgeSearchToolkit(BaseToolkit, ABC):
8 | name: str = "Knowledge Search Toolkit"
9 | description: str = "Toolkit containing tools for performing search on the knowledge base."
10 |
11 | def get_tools(self) -> List[BaseTool]:
12 | return [KnowledgeSearchTool()]
13 |
14 | def get_env_keys(self) -> List[ToolConfiguration]:
15 | return [
16 | ToolConfiguration(key="OPENAI_API_KEY", key_type=ToolConfigKeyType.STRING, is_required=False, is_secret=True)
17 | ]
--------------------------------------------------------------------------------
/superagi/tools/resource/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/resource/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/resource/resource_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.resource.query_resource import QueryResourceTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 |
8 | class JiraToolkit(BaseToolkit, ABC):
9 | name: str = "Resource Toolkit"
10 | description: str = "Toolkit containing tools for Resource integration"
11 |
12 | def get_tools(self) -> List[BaseTool]:
13 | return [
14 | QueryResourceTool(),
15 | ]
16 |
17 | def get_env_keys(self) -> List[ToolConfiguration]:
18 | return [
19 | ToolConfiguration(key="RESOURCE_VECTOR_STORE", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True),
20 | ToolConfiguration(key="RESOURCE_VECTOR_STORE_INDEX_NAME", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret=True)
21 | ]
22 |
--------------------------------------------------------------------------------
/superagi/tools/searx/README.MD:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # SuperAGI Searx Search Tool
6 |
7 | The SuperAGI Searx Search Tool helps users perform a Searx search and extract snippets and webpages. We parse the HTML response pages because most Searx instances do not support the JSON response format without an API key.
8 |
9 | ## ⚙️ Installation
10 |
11 | ### 🛠 **Setting Up of SuperAGI**
12 | Set up the SuperAGI by following the instructions given (https://github.com/TransformerOptimus/SuperAGI/blob/main/README.MD)
13 |
14 | ## Running SuperAGI Searx Search Serp Tool
15 |
16 | You can simply ask your agent about latest information regarding anything in the world and your agent will be able to browse the internet to get that information for you.
17 |
--------------------------------------------------------------------------------
/superagi/tools/searx/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/searx/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/searx/searx_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 |
4 | from superagi.tools.base_tool import BaseToolkit, BaseTool, ToolConfiguration
5 | from superagi.tools.searx.searx import SearxSearchTool
6 | from superagi.types.key_type import ToolConfigKeyType
7 |
8 | class SearxSearchToolkit(BaseToolkit, ABC):
9 | name: str = "Searx Toolkit"
10 | description: str = "Toolkit containing tools for performing Google search and extracting snippets and webpages " \
11 | "using Searx"
12 |
13 | def get_tools(self) -> List[BaseTool]:
14 | return [SearxSearchTool()]
15 |
16 | def get_env_keys(self) -> List[ToolConfiguration]:
17 | return []
18 |
--------------------------------------------------------------------------------
/superagi/tools/slack/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/slack/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/slack/slack_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.slack.send_message import SlackMessageTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 |
8 | class SlackToolkit(BaseToolkit, ABC):
9 | name: str = "Slack Toolkit"
10 | description: str = "Toolkit containing tools for Slack integration"
11 |
12 | def get_tools(self) -> List[BaseTool]:
13 | return [
14 | SlackMessageTool(),
15 | ]
16 |
17 | def get_env_keys(self) -> List[ToolConfiguration]:
18 | return [
19 | ToolConfiguration(key="SLACK_BOT_TOKEN", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True)
20 | ]
21 |
--------------------------------------------------------------------------------
/superagi/tools/thinking/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperAGI/c3c1982e7bd6a11cfed53c5a193ea502f924b1b6/superagi/tools/thinking/__init__.py
--------------------------------------------------------------------------------
/superagi/tools/thinking/prompts/thinking.txt:
--------------------------------------------------------------------------------
1 | Given the following overall objective
2 | Objective:
3 | {goals}
4 |
5 | and the following task, `{task_description}`.
6 |
7 | Below is last tool response:
8 | `{last_tool_response}`
9 |
10 | Below is the relevant tool response:
11 | `{relevant_tool_response}`
12 |
13 | Perform the task by understanding the problem, extracting variables, and being smart
14 | and efficient. Provide a descriptive response, make decisions yourself when
15 | confronted with choices and provide reasoning for ideas / decisions.
--------------------------------------------------------------------------------
/superagi/tools/thinking/thinking_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from typing import List
3 | from superagi.tools.base_tool import BaseTool, BaseToolkit, ToolConfiguration
4 | from superagi.tools.thinking.tools import ThinkingTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 |
8 | class ThinkingToolkit(BaseToolkit, ABC):
9 | name: str = "Thinking Toolkit"
10 | description: str = "Toolkit containing tools for intelligent problem-solving"
11 |
12 | def get_tools(self) -> List[BaseTool]:
13 | return [
14 | ThinkingTool(),
15 | ]
16 |
17 | def get_env_keys(self) -> List[ToolConfiguration]:
18 | return []
19 |
--------------------------------------------------------------------------------
/superagi/tools/tool_response_query_manager.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy.orm import Session
2 |
3 | from superagi.models.agent_execution_feed import AgentExecutionFeed
4 | from superagi.vector_store.base import VectorStore
5 |
6 | class ToolResponseQueryManager:
7 | def __init__(self, session: Session, agent_execution_id: int,memory:VectorStore):
8 | self.session = session
9 | self.agent_execution_id = agent_execution_id
10 | self.memory=memory
11 |
12 | def get_last_response(self, tool_name: str = None):
13 | return AgentExecutionFeed.get_last_tool_response(self.session, self.agent_execution_id, tool_name)
14 |
15 | def get_relevant_response(self, query: str,metadata:dict, top_k: int = 5):
16 | if self.memory is None:
17 | return ""
18 | documents = self.memory.get_matching_text(query, metadata=metadata)
19 | relevant_responses = ""
20 | for document in documents["documents"]:
21 | relevant_responses += document.text_content
22 | return relevant_responses
23 |
--------------------------------------------------------------------------------
/superagi/tools/twitter/twitter_toolkit.py:
--------------------------------------------------------------------------------
1 | from abc import ABC
2 | from superagi.tools.base_tool import BaseToolkit, BaseTool, ToolConfiguration
3 | from typing import Type, List
4 | from superagi.tools.twitter.send_tweets import SendTweetsTool
5 | from superagi.types.key_type import ToolConfigKeyType
6 |
7 | class TwitterToolkit(BaseToolkit, ABC):
8 | name: str = "Twitter Toolkit"
9 | description: str = "Twitter Tool kit contains all tools related to Twitter"
10 |
11 | def get_tools(self) -> List[BaseTool]:
12 | return [SendTweetsTool()]
13 |
14 | def get_env_keys(self) -> List[ToolConfiguration]:
15 | return [
16 | ToolConfiguration(key="TWITTER_API_KEY", key_type=ToolConfigKeyType.STRING, is_required= True, is_secret = True),
17 | ToolConfiguration(key="TWITTER_API_SECRET", key_type=ToolConfigKeyType.STRING, is_required=True, is_secret= True)
18 | ]
19 |
--------------------------------------------------------------------------------
/superagi/tools/webscaper/README.MD:
--------------------------------------------------------------------------------
1 |