Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci update #3

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [khulnasoft-bot]
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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:
39 changes: 39 additions & 0 deletions .github/workflows/issue-manager.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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."
}
}
27 changes: 27 additions & 0 deletions .github/workflows/label-approved.yml
Original file line number Diff line number Diff line change
@@ -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"
}
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down Expand Up @@ -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:
```
{
Expand All @@ -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 [email protected] and password dummypassword@123",
"graph_path": "autonode/site_trees/apollo.json"
"graph_path": "fastnode/site_trees/apollo.json"
"planner_prompt": "apollo"
}
Expand All @@ -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 '{
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions fastnode/agents/planning_agent.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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):

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)
Expand Down
2 changes: 1 addition & 1 deletion fastnode/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

@app.get("/health")
async def health_check():
return {"status": "AutoNode is Running"}
return {"status": "FastNode is Running"}
6 changes: 3 additions & 3 deletions fastnode/controllers/autonode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)}")
Expand Down
4 changes: 2 additions & 2 deletions fastnode/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -78,5 +78,5 @@ def critical(self, message, *args):
self.logger.critical(*args)


logger = Logger('AutoNode')
logger = Logger('FastNode')

2 changes: 1 addition & 1 deletion fastnode/models/types/requests/initiate_autonode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import BaseModel


class InitiateAutoNodeRequest(BaseModel):
class InitiateFastNodeRequest(BaseModel):
site_url: str
objective: str
graph_path: str
Expand Down
6 changes: 3 additions & 3 deletions fastnode/prompts/openai_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions fastnode/utils/helpers/web_automation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ 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')
await page.keyboard.press('Backspace')

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')
Expand All @@ -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')
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion ocr/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## AutoNode OCR
## FastNode OCR
2 changes: 1 addition & 1 deletion ocr/newrelic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion ocr/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ocr"
version = "0.1.0"
description = ""
authors = ["Madhur Bansal <madhur@contlo.com>"]
authors = ["KhulanSoft DevOps <info@khulnasoft.com>"]
readme = "README.md"

[tool.poetry.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion yolo/newrelic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion yolo/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "yolo"
version = "0.1.0"
description = ""
authors = ["Madhur Bansal <madhur@contlo.com>"]
authors = ["KhulanSoft DevOps <info@khulnasoft.com>"]
readme = "README.md"

[tool.poetry.dependencies]
Expand Down