Skip to content

Commit

Permalink
Added workspace dir
Browse files Browse the repository at this point in the history
  • Loading branch information
COLONAYUSH committed May 25, 2023
1 parent 58642cc commit cd64438
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion superagi/tools/file/append_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppendFileTool(BaseTool):

def _execute(self, file_name: str, content: str):
final_path = file_name
root_dir = get_config('RESOURCES_ROOT_DIR')
root_dir = get_config('RESOURCES_OUTPUT_ROOT_DIR')
if root_dir is not None:
root_dir = root_dir if root_dir.endswith("/") else root_dir + "/"
final_path = root_dir + file_name
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/file/delete_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DeleteFileTool(BaseTool):

def _execute(self, file_name: str, content: str):
final_path = file_name
root_dir = get_config('RESOURCES_ROOT_DIR')
root_dir = get_config('RESOURCES_INPUT_ROOT_DIR')
if root_dir is not None:
root_dir = root_dir if root_dir.endswith("/") else root_dir + "/"
final_path = root_dir + file_name
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_ROOT_DIR')
root_dir = get_config('RESOURCES_INPUT_ROOT_DIR')
final_path = file_name
if root_dir is not None:
root_dir = root_dir if root_dir.endswith("/") else root_dir + "/"
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/file/write_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WriteFileTool(BaseTool):

def _execute(self, file_name: str, content: str):
final_path = file_name
root_dir = get_config('RESOURCES_ROOT_DIR')
root_dir = get_config('RESOURCES_OUTPUT_ROOT_DIR')
if root_dir is not None:
root_dir = root_dir if root_dir.endswith("/") else root_dir + "/"
final_path = root_dir + file_name
Expand Down
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from superagi.llms.openai import OpenAi
from superagi.tools.base_tool import FunctionalTool
from superagi.tools.file.write_file import WriteFileTool
from superagi.tools.file.read_file import ReadFileTool
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
Expand All @@ -24,6 +25,7 @@ def create_campaign(campaign_name: str):
tools = [
GoogleSearchTool(),
WriteFileTool(),
ReadFileTool()
# GoogleSerpTool()
]

Expand Down
1 change: 1 addition & 0 deletions workspace/input/dog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dogs have been bred for specific jobs and traits, resulting in over 300 recognized breeds with unique characteristics, temperaments, and abilities. Herding breeds possess high energy and agility to assist farmers in managing livestock, hunting breeds are divided into scent and sight hounds for finding game, guardian breeds are protective watchdogs, and companion breeds offer comfort and companionship. Dogs have proven to be exceptional in adapting to fulfill various roles in human life and enrich our lives through their invaluable services and unwavering loyalty and affection.

0 comments on commit cd64438

Please sign in to comment.