Skip to content

Commit

Permalink
Modified workspace directory
Browse files Browse the repository at this point in the history
  • Loading branch information
COLONAYUSH committed May 31, 2023
1 parent 536a92c commit 9714d93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SERP_API_KEY: YOUR_SERP_API_KEY

RESOURCES_OUTPUT_ROOT_DIR: workspace/output
RESOURCES_INPUT_ROOT_DIR: workspace/output
RESOURCES_DIR: workspace/files

#ENTER YOUR EMAIL CREDENTIALS TO ACCESS EMAIL TOOL
EMAIL_ADDRESS: YOUR_EMAIL_ADDRESS
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/file/read_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ReadFileTool(BaseTool):
description: str = "Reads the file content in a specified location"

def _execute(self, file_name: str):
root_dir = get_config('RESOURCES_INPUT_ROOT_DIR')
root_dir = get_config('RESOURCES_DIR')
final_path = file_name
if root_dir is not None:
root_dir = root_dir if root_dir.startswith("/") else os.getcwd() + "/" + root_dir
Expand Down
4 changes: 2 additions & 2 deletions superagi/tools/file/write_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class WriteFileInput(BaseModel):
class WriteFileTool(BaseTool):
name: str = "write_file"
args_schema: Type[BaseModel] = WriteFileInput
description: str = "Writes text to a file"
description: str = "Writes text to a file "

def _execute(self, file_name: str, content: str):
final_path = file_name
root_dir = get_config('RESOURCES_OUTPUT_ROOT_DIR')
root_dir = get_config('RESOURCES_DIR')
if root_dir is not None:
root_dir = root_dir if root_dir.startswith("/") else os.getcwd() + "/" + root_dir
root_dir = root_dir if root_dir.endswith("/") else root_dir + "/"
Expand Down
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from superagi.tools.google_search.tools import GoogleSearchSchema, GoogleSearchTool
from superagi.tools.google_serp_search.tools import GoogleSerpTool
from superagi.tools.twitter.send_tweet import SendTweetTool
from superagi.tools.slack.tools import SlackTool
from superagi.tools.thinking.tools import LlmThinkingTool
from superagi.tools.email.read_email import ReadEmailTool
from superagi.tools.email.send_email import SendEmailTool
Expand All @@ -32,6 +33,7 @@ def create_campaign(campaign_name: str):
WriteFileTool(),
ReadFileTool(),
ReadEmailTool(),
SlackTool(),
SendEmailTool(),
SendEmailAttachmentTool()
# GoogleSerpTool()
Expand Down

0 comments on commit 9714d93

Please sign in to comment.