Skip to content

Commit

Permalink
lint(forge): black . and isort .
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jan 16, 2024
1 parent f0ede64 commit 39fd1d6
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 32 deletions.
6 changes: 5 additions & 1 deletion autogpts/forge/forge/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@
forge.sdk.forge_log.setup_logger()

uvicorn.run(
"forge.app:app", host="localhost", port=int(port), log_level="error", reload=True
"forge.app:app",
host="localhost",
port=int(port),
log_level="error",
reload=True,
)
2 changes: 1 addition & 1 deletion autogpts/forge/forge/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .registry import ActionRegister, Action, action, ActionParameter
from .registry import Action, ActionParameter, ActionRegister, action
1 change: 1 addition & 0 deletions autogpts/forge/forge/actions/finish.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from sdk.forge_log import ForgeLogger

from .registry import action

logger = ForgeLogger(__name__)
Expand Down
17 changes: 5 additions & 12 deletions autogpts/forge/forge/actions/web/web_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
COMMAND_CATEGORY = "web_browse"
COMMAND_CATEGORY_TITLE = "Web Browsing"

import functools
import logging
import re
from pathlib import Path
from sys import platform
from typing import TYPE_CHECKING, Optional, Type, List, Tuple
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, Type
from urllib.parse import urljoin, urlparse

from bs4 import BeautifulSoup
from requests.compat import urljoin
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.chrome.service import Service as ChromeDriverService
Expand All @@ -33,19 +36,9 @@
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.microsoft import EdgeChromiumDriverManager as EdgeDriverManager

from forge.sdk.errors import CommandExecutionError

from ..registry import action
from forge.sdk.errors import *
import functools
import re
from typing import Any, Callable
from urllib.parse import urljoin, urlparse

from requests.compat import urljoin


from bs4 import BeautifulSoup
from requests.compat import urljoin


def extract_hyperlinks(soup: BeautifulSoup, base_url: str) -> list[tuple[str, str]]:
Expand Down
3 changes: 1 addition & 2 deletions autogpts/forge/forge/agent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from forge.actions import ActionRegister
from forge.sdk import (
Agent,
AgentDB,
Expand All @@ -8,8 +9,6 @@
TaskRequestBody,
Workspace,
)
from forge.actions import ActionRegister


LOG = ForgeLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions autogpts/forge/forge/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from forge.agent import ForgeAgent
from forge.sdk import LocalWorkspace

from .db import ForgeDatabase

database_name = os.getenv("DATABASE_STRING")
Expand Down
13 changes: 5 additions & 8 deletions autogpts/forge/forge/db.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from .sdk import AgentDB, ForgeLogger, NotFoundError, Base
from sqlalchemy.exc import SQLAlchemyError

import datetime
from sqlalchemy import (
Column,
DateTime,
String,
)
import uuid

from sqlalchemy import Column, DateTime, String
from sqlalchemy.exc import SQLAlchemyError

from .sdk import AgentDB, Base, ForgeLogger, NotFoundError

LOG = ForgeLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion autogpts/forge/forge/memory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .memstore import MemStore
from .chroma_memstore import ChromaMemStore
from .memstore import MemStore
5 changes: 3 additions & 2 deletions autogpts/forge/forge/memory/chroma_memstore.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from .memstore import MemStore
import hashlib

import chromadb
from chromadb.config import Settings
import hashlib

from .memstore import MemStore


class ChromaMemStore:
Expand Down
6 changes: 3 additions & 3 deletions autogpts/forge/forge/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
The Forge SDK. This is the core of the Forge. It contains the agent protocol, which is the
core of the Forge.
"""
from ..llm import chat_completion_request, create_embedding_request, transcribe_audio
from .agent import Agent
from .db import AgentDB, Base
from .errors import *
from .forge_log import ForgeLogger
from ..llm import chat_completion_request, create_embedding_request, transcribe_audio
from .prompting import PromptEngine
from .model import (
Artifact,
ArtifactUpload,
Expand All @@ -21,5 +21,5 @@
TaskRequestBody,
TaskStepsListResponse,
)
from .prompting import PromptEngine
from .workspace import LocalWorkspace, Workspace
from .errors import *
11 changes: 10 additions & 1 deletion autogpts/forge/forge/sdk/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@
from .errors import NotFoundError
from .forge_log import ForgeLogger
from .middlewares import AgentMiddleware
from .model import (
Artifact,
Step,
StepRequestBody,
Task,
TaskArtifactsListResponse,
TaskListResponse,
TaskRequestBody,
TaskStepsListResponse,
)
from .routes.agent_protocol import base_router
from .model import *
from .workspace import Workspace

LOG = ForgeLogger(__name__)
Expand Down
8 changes: 7 additions & 1 deletion autogpts/forge/forge/sdk/db_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
convert_to_task,
)
from forge.sdk.errors import NotFoundError as DataNotFoundError
from autogpts.forge.forge.sdk.model import *
from forge.sdk.model import (
Artifact,
Status,
Step,
StepRequestBody,
Task,
)


@pytest.mark.asyncio
Expand Down
1 change: 1 addition & 0 deletions autogpts/forge/forge/sdk/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import typing
from pathlib import Path

from google.cloud import storage


Expand Down

0 comments on commit 39fd1d6

Please sign in to comment.