Skip to content

Commit d181921

Browse files
authored
Merge pull request #1 from Phoenix2809/contributing-md
Contributing md
2 parents 84c8226 + a0dcced commit d181921

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+302
-110
lines changed

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ⚡ Contributing to SuperAGI
2+
<p align=center>
3+
<a href=”https://superagi.co”><img src=https://superagi.co/wp-content/uploads/2023/05/SuperAGI_icon.png></a>
4+
</p>
5+
6+
First of all, thank you for taking your time to to contribute to this project. We truly appreciate your contributions, whether it's bug reports, feature suggestions, or pull requests. Your time and effort are highly valued in this project. 🚀
7+
8+
This document provides guidelines and best practices to help you to contribute effectively. These are meant to serve as guidelines, not strict rules. We encourage you to use your best judgment and feel comfortable proposing changes to this document through a pull request.
9+
10+
**********************************Table of Content:**********************************
11+
1. [Code of conduct](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#code-of-conduct)
12+
2. [Getting Started](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#getting-started)
13+
3. [How can I contribute](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#getting-started)
14+
1. [Reporting Bugs](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#reporting-bugs)
15+
2. [Suggesting Enhancements](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#suggesting-enhancements)
16+
3. [Pull Requests](https://github.com/Phoenix2809/SuperAGI/blob/contributing-md/CONTRIBUTING.md#pull-requests)
17+
4. Styleguides
18+
5. Testing
19+
20+
## Code of Conduct:
21+
22+
Please read our [Code of Conduct](https://github.com/TransformerOptimus/SuperAGI/blob/main/CODE_OF_CONDUCT.md) to understand the expectations we have for all contributors participating in this project. By participating, you agree to abide by our Code of Conduct.
23+
24+
## Getting Started
25+
26+
1. Create a fork of this repository and clone your fork
27+
2. Create a new branch for your changes (make sure you’re using a descriptive name, such as bug-fix-293
28+
3. Make the respective changes in your new branch
29+
4. Test your changes thoroughly
30+
5. Commit and push your changes to your fork
31+
6. Create a pull request. Please refer to the Submitting Pull Requests section for guidelines.
32+
33+
## How can I contribute
34+
35+
### Reporting Bugs
36+
37+
You can start contributing to SuperAGI by reporting bugs that you’ve encountered. Please create an issue on GitHub with the following information:
38+
39+
1. Title describing the issue in a clear and concise manner
40+
2. Provide a detailed description of the problem, along with the necessary steps to reproduce the issue.
41+
3. Make sure to include any relevant logs, screenshots, or other helpful information that supports the issue.
42+
43+
### Suggesting Enhancements
44+
45+
You can start adding ideas for new features or improvements to SuperAGI. Create an issue on Github with the following information:
46+
47+
1. Title describing the issue in a clear and concise manner
48+
2. Please provide a clear description of the proposed enhancement, highlighting its benefits and potential drawbacks.
49+
3. Provide example and supporting information.
50+
51+
### Pull Requests
52+
53+
When submitting your pull request, please ensure that your changes meet the following criteria:
54+
55+
1. The pull request is atomic and focuses on a single change.
56+
2. You have read the contributing guide and your code conforms to the guidelines.
57+
3. You have documented your changes clearly and comprehensively.
58+
4. You have added the required tests.
59+
60+
61+
## Styleguides
62+
63+
will need extensive Developer KT on this
64+
65+
## Code Formatting
66+
Pre-commit Hooks
67+
68+
## Testing Changes
69+
70+
Will need Dev KT on filling this documentation

docker-compose.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ services:
2727
- NEXT_PUBLIC_API_BASE_URL=/api
2828
networks:
2929
- super_network
30-
volumes:
31-
- ./gui:/app
32-
- /app/.next
30+
# volumes:
31+
# - ./gui:/app
32+
# - /app/node_modules/
33+
# - /app/.next/
3334
super__redis:
3435
image: "docker.io/library/redis:latest"
3536
networks:

gui/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /app
55
COPY package*.json ./
66
RUN npm ci
77

8+
FROM node:lts AS builder
9+
WORKDIR /app
810
COPY . .
11+
COPY --from=deps /app/node_modules ./node_modules
912

1013
CMD ["npm", "run", "dev"]

local-llm-gpu

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ services:
4242

4343
super__tgwui:
4444
build:
45-
context: .
45+
context: ./tgwui/
4646
target: llama-cublas
47-
dockerfile: ./tgwui/DockerfileTGWUI
47+
dockerfile: DockerfileTGWUI
4848
# args:
4949
# - LCL_SRC_DIR=text-generation-webui # Developers - see Dockerfile app_base
50+
image: atinoda/text-generation-webui:llama-cublas # Specify variant as the :tag
5051
container_name: super__tgwui
5152
environment:
52-
- EXTRA_LAUNCH_ARGS="--listen --no-mmap --verbose --extensions openai --auto-devices --n_ctx 1600 --gpu-memory 20 20 --n-gpu-layers 128 --threads 8 --model vicuna-13b-cot.ggmlv3.q8_0.bin"
53+
- EXTRA_LAUNCH_ARGS="--no-mmap --verbose --extensions openai --auto-devices --n_ctx 2000 --gpu-memory 22 22 --n-gpu-layers 128 --threads 8"
54+
# - BUILD_EXTENSIONS_LIVE="silero_tts whisper_stt" # Install named extensions during every container launch. THIS WILL SIGNIFICANLTLY SLOW LAUNCH TIME.
5355
ports:
5456
- 7860:7860 # Default web port
5557
- 5000:5000 # Default API port
@@ -62,15 +64,14 @@ services:
6264
- ./tgwui/config/prompts:/app/prompts
6365
- ./tgwui/config/softprompts:/app/softprompts
6466
- ./tgwui/config/training:/app/training
65-
- ./tgwui/config/embeddings:/app/embeddings
67+
# - ./config/extensions:/app/extensions
6668
logging:
6769
driver: json-file
6870
options:
6971
max-file: "3" # number of files or file count
7072
max-size: '10m'
7173
networks:
7274
- super_network
73-
### Uncomment the following lines to run the container using the host machine's GPU resources
7475
deploy:
7576
resources:
7677
reservations:
@@ -79,8 +80,6 @@ services:
7980
# count: "all"
8081
device_ids: ['0', '1'] # must comment the above line if this line is uncommented.
8182
capabilities: [gpu]
82-
83-
8483
super__redis:
8584
image: "docker.io/library/redis:latest"
8685
networks:

superagi/controllers/tool_config.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
from fastapi import APIRouter, HTTPException, Depends, Path
1+
from fastapi import APIRouter, HTTPException, Depends
2+
from fastapi_jwt_auth import AuthJWT
23
from fastapi_sqlalchemy import db
34
from pydantic_sqlalchemy import sqlalchemy_to_pydantic
5+
6+
from superagi.helper.auth import check_auth
7+
from superagi.helper.auth import get_user_organisation
48
from superagi.models.organisation import Organisation
59
from superagi.models.tool_config import ToolConfig
610
from superagi.models.toolkit import Toolkit
7-
from fastapi_jwt_auth import AuthJWT
8-
from superagi.helper.auth import check_auth
9-
from superagi.helper.auth import get_user_organisation
10-
from typing import List
1111

1212
router = APIRouter()
1313

1414

1515
@router.post("/add/{toolkit_name}", status_code=201)
16-
def update_tool_config(toolkit_name: str, configs: list):
16+
def update_tool_config(toolkit_name: str, configs: list, organisation: Organisation = Depends(get_user_organisation)):
1717
"""
1818
Update tool configurations for a specific tool kit.
1919
@@ -34,7 +34,7 @@ def update_tool_config(toolkit_name: str, configs: list):
3434

3535
try:
3636
# Check if the tool kit exists
37-
toolkit = Toolkit.get_toolkit_from_name(db.session, toolkit_name)
37+
toolkit = Toolkit.get_toolkit_from_name(db.session, toolkit_name,organisation)
3838
if toolkit is None:
3939
raise HTTPException(status_code=404, detail="Tool kit not found")
4040

@@ -114,12 +114,11 @@ def get_all_tool_configs(toolkit_name: str, organisation: Organisation = Depends
114114
HTTPException (status_code=404): If the specified tool kit is not found.
115115
HTTPException (status_code=403): If the user is not authorized to access the tool kit.
116116
"""
117-
user_toolkits = db.session.query(Toolkit).filter(Toolkit.organisation_id == organisation.id).all()
118-
toolkit = db.session.query(Toolkit).filter_by(name=toolkit_name).first()
117+
118+
toolkit = db.session.query(Toolkit).filter(Toolkit.name == toolkit_name,
119+
Toolkit.organisation_id == organisation.id).first()
119120
if not toolkit:
120121
raise HTTPException(status_code=404, detail='ToolKit not found')
121-
if toolkit.name not in [user_toolkit.name for user_toolkit in user_toolkits]:
122-
raise HTTPException(status_code=403, detail='Unauthorized')
123122

124123
tool_configs = db.session.query(ToolConfig).filter(ToolConfig.toolkit_id == toolkit.id).all()
125124
return tool_configs

superagi/jobs/agent_executor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, session=None, toolkit_id=None):
4444

4545
def get_tool_config(self, key: str):
4646
tool_config = self.session.query(ToolConfig).filter_by(key=key, toolkit_id=self.toolkit_id).first()
47-
if tool_config:
47+
if tool_config and tool_config.value:
4848
return tool_config.value
4949
return super().get_tool_config(key=key)
5050

@@ -77,8 +77,11 @@ def create_object(tool,session):
7777
"""
7878
file_name = AgentExecutor.validate_filename(filename=tool.file_name)
7979

80-
tools_dir = get_config("TOOLS_DIR").rstrip("/")
81-
module_name = ".".join(tools_dir.split("/") + [tool.folder_name, file_name])
80+
tools_dir = get_config("TOOLS_DIR")
81+
if tools_dir is None:
82+
tools_dir = "superagi/tools"
83+
parsed_tools_dir = tools_dir.rstrip("/")
84+
module_name = ".".join(parsed_tools_dir.split("/") + [tool.folder_name, file_name])
8285

8386
# module_name = f"superagi.tools.{folder_name}.{file_name}"
8487

superagi/models/agent_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class AgentConfiguration(DBBaseModel):
99
"""
10-
Represents a configuration for an agent.
10+
Agent related configurations like goals, instructions, constraints and tools are stored here
1111
1212
Attributes:
1313
id (int): The unique identifier of the agent configuration.

superagi/models/agent_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class AgentExecution(DBBaseModel):
1010
"""
11-
Represents an execution of an agent.
11+
Represents single agent run
1212
1313
Attributes:
1414
id (int): The unique identifier of the agent execution.

superagi/models/agent_execution_feed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class AgentExecutionFeed(DBBaseModel):
88
"""
9-
Represents a feed entry for an agent execution.
9+
Feed of the agent execution.
1010
1111
Attributes:
1212
id (int): The unique identifier of the agent execution feed.

superagi/models/agent_execution_permission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class AgentExecutionPermission(DBBaseModel):
88
"""
9-
Represents an Agent Execution Permission record in the database.
9+
Agent Execution Permissions at each step to be approved or rejected by the user.
1010
1111
Attributes:
1212
id (Integer): The primary key of the agent execution permission record.

0 commit comments

Comments
 (0)