diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..12d3307 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [khulnasoft-bot] \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2fb7c21 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: ⬆ + # Python + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" + groups: + python-packages: + patterns: + - "*" + commit-message: + prefix: ⬆ \ No newline at end of file diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml new file mode 100644 index 0000000..8503d2e --- /dev/null +++ b/.github/workflows/issue-manager.yml @@ -0,0 +1,39 @@ +name: Issue Manager + +on: + schedule: + - cron: "10 3 * * *" + issue_comment: + types: + - created + issues: + types: + - labeled + pull_request_target: + types: + - labeled + workflow_dispatch: + +jobs: + issue-manager: + if: github.repository_owner == 'khulnasoft' + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: khulnasoft/issue-manager-action@0.5.0 + with: + token: ${{ secrets.ORG_REPO_TOKEN }} + config: > + { + "answered": { + "delay": 864000, + "message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs." + }, + "changes-requested": { + "delay": 2628000, + "message": "As this PR had requested changes to be applied but has been inactive for a while, it's now going to be closed. But if there's anyone interested, feel free to create a new PR." + } + } \ No newline at end of file diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml new file mode 100644 index 0000000..03ef685 --- /dev/null +++ b/.github/workflows/label-approved.yml @@ -0,0 +1,27 @@ +name: Label Approved + +on: + schedule: + - cron: "0 12 * * *" + workflow_dispatch: + +jobs: + label-approved: + if: github.repository_owner == 'khulnasoft' + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: docker://khulnasoft/label-approved:latest + with: + token: ${{ secrets.ORG_REPO_TOKEN }} + config: > + { + "approved-1": + { + "number": 1, + "await_label": "awaiting-review" + } + } \ No newline at end of file diff --git a/README.md b/README.md index 112c488..9c64f25 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ git clone https://github.com/KhulnaSoft/FastNode.git ``` cd FastNode ``` -3. Create a copy of .env.example , and name it .env. Repeat this step for all the three modules - autonode, yolo, ocr +3. Create a copy of .env.example , and name it .env. Repeat this step for all the three modules - fastnode, yolo, ocr 4. Ensure that Docker is installed on your system. You can download and install it from [here](https://docs.docker.com/get-docker/). @@ -101,10 +101,10 @@ FastNode operates based on a site-graph that defines the navigation and actions #### Sending a Request to FastNode - To automate a task with FastNode, you will use the /api/autonode/initiate endpoint. This endpoint accepts a JSON payload that specifies the task's objective, the path to the site-graph JSON file, the root node to start traversal, and the URL of the website you wish to interact with. + To automate a task with FastNode, you will use the /api/fastnode/initiate endpoint. This endpoint accepts a JSON payload that specifies the task's objective, the path to the site-graph JSON file, the root node to start traversal, and the URL of the website you wish to interact with. #### Request Structure - Here is the structure of the JSON payload you need to send to the `/api/autonode/initiate` endpoint: + Here is the structure of the JSON payload you need to send to the `/api/fastnode/initiate` endpoint: ``` { @@ -120,7 +120,7 @@ FastNode operates based on a site-graph that defines the navigation and actions { "site_url": "https://app.apollo.io/#/login", "objective": "Find the list of 20 ceo, cto of tech companies in san francisco. Login into apollo using the creds example@example.com and password dummypassword@123", - "graph_path": "autonode/site_trees/apollo.json" + "graph_path": "fastnode/site_trees/apollo.json" "planner_prompt": "apollo" } @@ -137,7 +137,7 @@ FastNode operates based on a site-graph that defines the navigation and actions ``` curl -X 'POST' \ - 'http://localhost:8001/api/autonode/initiate' \ + 'http://localhost:8001/api/fastnode/initiate' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ @@ -223,8 +223,8 @@ Screenshots at every node for web element detection is stored in requests direct For use-cases which require downloading output, downloadable content (like output in apollo) needs to be stored either locally or remotely. 1. Storing Screenshots & Downloads Remotely - - In your autonode/.env file, configure AWS keys AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from your AWS console - - In autonode/services/autonode.py, uncomment the following snippet at line 35, + - In your fastnode/.env file, configure AWS keys AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from your AWS console + - In fastnode/services/fastnode.py, uncomment the following snippet at line 35, ``` # Uncomment If you have aws account and want to store result in your AWS S3 @@ -237,13 +237,13 @@ For use-cases which require downloading output, downloadable content (like outpu ``` s3_client=None ``` - - In autonode/utils/screenshot_generator.py uncomment this on line 18, + - In fastnode/utils/screenshot_generator.py uncomment this on line 18, ``` # Uncomment If you have aws account and want to store result in your AWS S3 s3_client.upload_file(file_path=screenshot_filename) ``` - - In autonode/nodes/download.py uncomment this on line 44 + - In fastnode/nodes/download.py uncomment this on line 44 ``` # Uncomment If you have aws account and want to store result in your AWS S3 @@ -252,7 +252,7 @@ For use-cases which require downloading output, downloadable content (like outpu 2. Storing Screenshots & Downloaded files locally - By default, the screenshots and downloaded output are stored locally during execution and are deleted as the task completes or fails - - In autonode/worker.py comment this finally block on line 79 to persist screenshots locally, + - In fastnode/worker.py comment this finally block on line 79 to persist screenshots locally, ``` finally: # Comment if you don't want to delete screenshots locally diff --git a/fastnode/agents/planning_agent.py b/fastnode/agents/planning_agent.py index 41ddfcb..ff597ad 100644 --- a/fastnode/agents/planning_agent.py +++ b/fastnode/agents/planning_agent.py @@ -1,8 +1,8 @@ from fastnode.agents.base_agent import BaseAgent from fastnode.llms.base_llm import BaseLlm -from fastnode.prompts.openai_prompt import (AUTONODE_PLANNER_PROMPT_APOLLO, - AUTONODE_PLANNER_PROMPT_TWITTER, - AUTONODE_PLANNER_PROMPT_GMAIL) +from fastnode.prompts.openai_prompt import (FASTNODE_PLANNER_PROMPT_APOLLO, + FASTNODE_PLANNER_PROMPT_TWITTER, + FASTNODE_PLANNER_PROMPT_GMAIL) class PlanningAgent(BaseAgent): @@ -10,9 +10,9 @@ class PlanningAgent(BaseAgent): def __init__(self, planner_prompt: str, llm_instance: BaseLlm): self.llm = llm_instance self.prompt_hash = { - "apollo": AUTONODE_PLANNER_PROMPT_APOLLO, - "twitter": AUTONODE_PLANNER_PROMPT_TWITTER, - "gmail": AUTONODE_PLANNER_PROMPT_GMAIL + "apollo": FASTNODE_PLANNER_PROMPT_APOLLO, + "twitter": FASTNODE_PLANNER_PROMPT_TWITTER, + "gmail": FASTNODE_PLANNER_PROMPT_GMAIL } self.prompt = self.prompt_hash.get(planner_prompt) fast().__init__(llm_instance) diff --git a/fastnode/app.py b/fastnode/app.py index 3f9c9dd..c2624de 100644 --- a/fastnode/app.py +++ b/fastnode/app.py @@ -16,4 +16,4 @@ @app.get("/health") async def health_check(): - return {"status": "AutoNode is Running"} + return {"status": "FastNode is Running"} diff --git a/fastnode/controllers/autonode.py b/fastnode/controllers/autonode.py index 35af8c1..e9b937e 100644 --- a/fastnode/controllers/autonode.py +++ b/fastnode/controllers/autonode.py @@ -2,14 +2,14 @@ from fastapi import APIRouter from fastnode.logger.logger import logger from fastnode.models.requests import Requests -from fastnode.models.types.requests.initiate_fastnode import InitiateAutoNodeRequest +from fastnode.models.types.requests.initiate_fastnode import InitiateFastNodeRequest from fastnode.utils.helpers.naming_helper import NamingHelper router = APIRouter() @router.post("/initiate") -def initiate_fastnode(request: InitiateAutoNodeRequest): +def initiate_fastnode(request: InitiateFastNodeRequest): try: req = Requests.add_request(session=db.session, description=request.objective, @@ -26,7 +26,7 @@ def initiate_fastnode(request: InitiateAutoNodeRequest): planner_prompt=request.planner_prompt, screenshots_dir=f"requests/{NamingHelper.request_folder_name_generator()}") - return {"success": True, "message": f"Initiated AutoNode for Request ID {req.id} successfully"} + return {"success": True, "message": f"Initiated FastNode for Request ID {req.id} successfully"} except Exception as e: logger.error(f"Error initiating Fastnode: {str(e)}") diff --git a/fastnode/logger/logger.py b/fastnode/logger/logger.py index 29f3e48..dda0e62 100644 --- a/fastnode/logger/logger.py +++ b/fastnode/logger/logger.py @@ -32,7 +32,7 @@ def __call__(cls, *args, **kwargs): class Logger(metaclass=SingletonMeta): - def __init__(self, logger_name='AutoNode', log_level=logging.DEBUG): + def __init__(self, logger_name='FastNode', log_level=logging.DEBUG): if not hasattr(self, 'logger'): self.logger = logging.getLogger(logger_name) self.logger.setLevel(log_level) @@ -78,5 +78,5 @@ def critical(self, message, *args): self.logger.critical(*args) -logger = Logger('AutoNode') +logger = Logger('FastNode') diff --git a/fastnode/models/types/requests/initiate_autonode.py b/fastnode/models/types/requests/initiate_autonode.py index aecfeae..e2bc19a 100644 --- a/fastnode/models/types/requests/initiate_autonode.py +++ b/fastnode/models/types/requests/initiate_autonode.py @@ -1,7 +1,7 @@ from pydantic import BaseModel -class InitiateAutoNodeRequest(BaseModel): +class InitiateFastNodeRequest(BaseModel): site_url: str objective: str graph_path: str diff --git a/fastnode/prompts/openai_prompt.py b/fastnode/prompts/openai_prompt.py index d94b85e..eb9d03c 100644 --- a/fastnode/prompts/openai_prompt.py +++ b/fastnode/prompts/openai_prompt.py @@ -204,7 +204,7 @@ """ # Initiate Fastnode planner prompt -AUTONODE_PLANNER_PROMPT_TWITTER = """ +FASTNODE_PLANNER_PROMPT_TWITTER = """ You are an intelligent Self Operating Computer designed to perform autonomous cognitive RPA tasks using a graph-based execution model to interact with Twitter. Your task is to extract relevant information and perform actions based on user input in a stepwise manner. Instructions: @@ -302,7 +302,7 @@ """ -AUTONODE_PLANNER_PROMPT_GMAIL = """ +FASTNODE_PLANNER_PROMPT_GMAIL = """ You are an intelligent Self Operating Computer designed to perform autonomous cognitive RPA tasks using a graph-based execution model to interact with Gmail. Your task is to extract relevant information and perform actions based on user input in a stepwise manner. Instructions: @@ -463,7 +463,7 @@ """ # Initiate Fastnode & Planner prompt -AUTONODE_PLANNER_PROMPT_APOLLO = """You are an intelligent agent which will help segregate filters and provide accurate and relevant +FASTNODE_PLANNER_PROMPT_APOLLO = """You are an intelligent agent which will help segregate filters and provide accurate and relevant leads from the user input. The user input consists of a string which you will use to decide and simplify the course of action for the AI agent in a stepwise manner. diff --git a/fastnode/utils/helpers/web_automation_helper.py b/fastnode/utils/helpers/web_automation_helper.py index 0301047..da52b00 100644 --- a/fastnode/utils/helpers/web_automation_helper.py +++ b/fastnode/utils/helpers/web_automation_helper.py @@ -25,7 +25,7 @@ async def click_on_page(self, page, location: list, screenshot_size: tuple, clic async def type_str_on_page(self, page, text: str, system: str): if system == "Linux": - await page.keyboard.type("AutoNode", delay=100) + await page.keyboard.type("FastNode", delay=100) await page.keyboard.down('Control') await page.keyboard.press('A') await page.keyboard.up('Control') @@ -33,7 +33,7 @@ async def type_str_on_page(self, page, text: str, system: str): await page.keyboard.type(text, delay=200) elif system == "mac": - await page.keyboard.type("AutoNode", delay=100) + await page.keyboard.type("FastNode", delay=100) await page.keyboard.down('Meta') await page.keyboard.press('A') await page.keyboard.up('Meta') @@ -45,7 +45,7 @@ async def type_str_on_page(self, page, text: str, system: str): async def type_multiple_elements_on_page(self, page, text_list: list, system: str, separation_key: str = "Enter"): if system == "Linux": - await page.keyboard.type("AutoNode", delay=100) + await page.keyboard.type("FastNode", delay=100) await page.keyboard.down('Control') await page.keyboard.press('A') await page.keyboard.up('Control') @@ -56,7 +56,7 @@ async def type_multiple_elements_on_page(self, page, text_list: list, system: st await page.keyboard.press(separation_key) elif system == "mac": - await page.keyboard.type("AutoNode", delay=100) + await page.keyboard.type("FastNode", delay=100) await page.keyboard.down('Meta') await page.keyboard.press('A') await page.keyboard.up('Meta') diff --git a/ocr/README.md b/ocr/README.md index 71bdd9b..2664cce 100644 --- a/ocr/README.md +++ b/ocr/README.md @@ -1 +1 @@ -## AutoNode OCR \ No newline at end of file +## FastNode OCR \ No newline at end of file diff --git a/ocr/newrelic.ini b/ocr/newrelic.ini index 6e7c66c..8d0a550 100644 --- a/ocr/newrelic.ini +++ b/ocr/newrelic.ini @@ -246,7 +246,7 @@ monitor_mode = false monitor_mode = false [newrelic:staging] -app_name = AutoNode-OCR (Staging) +app_name = FastNode-OCR (Staging) monitor_mode = false [newrelic:production] diff --git a/ocr/pyproject.toml b/ocr/pyproject.toml index ee1c2f1..f6ef501 100644 --- a/ocr/pyproject.toml +++ b/ocr/pyproject.toml @@ -2,7 +2,7 @@ name = "ocr" version = "0.1.0" description = "" -authors = ["Madhur Bansal "] +authors = ["KhulanSoft DevOps "] readme = "README.md" [tool.poetry.dependencies] diff --git a/yolo/newrelic.ini b/yolo/newrelic.ini index 9714096..7577f3c 100644 --- a/yolo/newrelic.ini +++ b/yolo/newrelic.ini @@ -246,7 +246,7 @@ monitor_mode = false monitor_mode = false [newrelic:staging] -app_name = AutoNode-yolo (Staging) +app_name = FastNode-yolo (Staging) monitor_mode = false [newrelic:production] diff --git a/yolo/pyproject.toml b/yolo/pyproject.toml index 9bc545c..53bde2a 100644 --- a/yolo/pyproject.toml +++ b/yolo/pyproject.toml @@ -2,7 +2,7 @@ name = "yolo" version = "0.1.0" description = "" -authors = ["Madhur Bansal "] +authors = ["KhulanSoft DevOps "] readme = "README.md" [tool.poetry.dependencies]