Ruff: use I rule for isort (#1410)

Ruff: use I rule for isort
This commit is contained in:
Jirka Borovec 2024-04-30 00:41:58 +02:00 committed by GitHub
parent 086a2ed17f
commit 0c2ebfd6e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
78 changed files with 301 additions and 247 deletions

View File

@ -1,4 +1,5 @@
from opendevin.agent import Agent
from .agent import SWEAgent
Agent.register('SWEAgent', SWEAgent)

View File

@ -1,23 +1,23 @@
from typing import List
from opendevin.agent import Agent
from opendevin.llm.llm import LLM
from opendevin.state import State
from opendevin.action import (
Action,
AgentThinkAction,
FileReadAction,
FileWriteAction,
)
from opendevin.agent import Agent
from opendevin.llm.llm import LLM
from opendevin.observation import Observation
from opendevin.state import State
from .parser import parse_command
from .prompts import (
SYSTEM_MESSAGE,
STEP_PROMPT,
CONTEXT_PROMPT,
MEMORY_FORMAT,
NO_ACTION,
CONTEXT_PROMPT
STEP_PROMPT,
SYSTEM_MESSAGE,
)

View File

@ -1,17 +1,17 @@
import re
from opendevin.action import (
Action,
AgentEchoAction,
AgentFinishAction,
AgentThinkAction,
BrowseURLAction,
CmdRunAction,
FileReadAction,
FileWriteAction,
BrowseURLAction,
AgentEchoAction,
AgentThinkAction,
)
import re
from .prompts import CUSTOM_DOCS, COMMAND_USAGE
from .prompts import COMMAND_USAGE, CUSTOM_DOCS
# commands: exit, read, write, browse, kill, search_file, search_dir

View File

@ -1,17 +1,21 @@
from .micro.registry import all_microagents
from .micro.agent import MicroAgent
from dotenv import load_dotenv
from opendevin.agent import Agent
from dotenv import load_dotenv
from .micro.agent import MicroAgent
from .micro.registry import all_microagents
load_dotenv()
# Import agents after environment variables are loaded
from . import monologue_agent # noqa: E402
from . import codeact_agent # noqa: E402
from . import planner_agent # noqa: E402
from . import SWE_agent # noqa: E402
from . import delegator_agent # noqa: E402
from . import ( # noqa: E402
SWE_agent,
codeact_agent,
delegator_agent,
monologue_agent,
planner_agent,
)
__all__ = ['monologue_agent', 'codeact_agent',
'planner_agent', 'SWE_agent', 'delegator_agent']

View File

@ -1,4 +1,5 @@
from opendevin.agent import Agent
from .codeact_agent import CodeActAgent
Agent.register('CodeActAgent', CodeActAgent)

View File

@ -13,8 +13,8 @@ from opendevin.observation import (
AgentMessageObservation,
CmdOutputObservation,
)
from opendevin.sandbox.plugins import JupyterRequirement, PluginRequirement
from opendevin.state import State
from opendevin.sandbox.plugins import PluginRequirement, JupyterRequirement
SYSTEM_MESSAGE = """You are a helpful assistant. You will be provided access (as root) to a bash shell to complete user-provided tasks.
You will be able to execute commands in the bash shell, interact with the file system, install packages, and receive the output of your commands.

View File

@ -1,4 +1,5 @@
from opendevin.agent import Agent
from .agent import DelegatorAgent
Agent.register('DelegatorAgent', DelegatorAgent)

View File

@ -1,11 +1,10 @@
from typing import List
from opendevin.action import Action, AgentDelegateAction, AgentFinishAction
from opendevin.agent import Agent
from opendevin.action import AgentFinishAction, AgentDelegateAction
from opendevin.observation import AgentDelegateObservation
from opendevin.llm.llm import LLM
from opendevin.observation import AgentDelegateObservation
from opendevin.state import State
from opendevin.action import Action
class DelegatorAgent(Agent):

View File

@ -1,12 +1,14 @@
"""Module for a Dummy agent."""
from opendevin.action.base import NullAction
from opendevin.state import State
from opendevin.action import Action
from typing import List
from opendevin.action import Action
from opendevin.action.base import NullAction
from opendevin.agent import Agent
from opendevin.controller.agent_controller import AgentController
from opendevin.observation.base import NullObservation, Observation
from opendevin.state import State
class DummyAgent(Agent):
"""A dummy agent that does nothing but can be used in testing."""

View File

@ -1,13 +1,13 @@
import json
from typing import List, Dict
from typing import Dict, List
from jinja2 import Environment, BaseLoader
from jinja2 import BaseLoader, Environment
from opendevin.action import Action, action_from_dict
from opendevin.agent import Agent
from opendevin.exceptions import LLMOutputError
from opendevin.llm.llm import LLM
from opendevin.state import State
from opendevin.action import Action, action_from_dict
from opendevin.exceptions import LLMOutputError
from .instructions import instructions
from .registry import all_microagents

View File

@ -1,5 +1,5 @@
from typing import Dict
import os
from typing import Dict
instructions: Dict = {}

View File

@ -1,4 +1,5 @@
import os
import yaml
all_microagents = {}

View File

@ -1,4 +1,5 @@
from opendevin.agent import Agent
from .agent import MonologueAgent
Agent.register('MonologueAgent', MonologueAgent)

View File

@ -1,35 +1,34 @@
from typing import List
from opendevin.agent import Agent
from opendevin.state import State
from opendevin.llm.llm import LLM
from opendevin.schema import ActionType
from opendevin.exceptions import AgentNoInstructionError
from opendevin.schema.config import ConfigType
from opendevin import config
from opendevin.action import (
Action,
NullAction,
CmdRunAction,
FileWriteAction,
FileReadAction,
AgentRecallAction,
BrowseURLAction,
GitHubPushAction,
AgentThinkAction,
)
from opendevin.observation import (
Observation,
NullObservation,
CmdOutputObservation,
FileReadObservation,
AgentRecallObservation,
BrowserOutputObservation,
)
import agenthub.monologue_agent.utils.prompts as prompts
from agenthub.monologue_agent.utils.monologue import Monologue
from opendevin import config
from opendevin.action import (
Action,
AgentRecallAction,
AgentThinkAction,
BrowseURLAction,
CmdRunAction,
FileReadAction,
FileWriteAction,
GitHubPushAction,
NullAction,
)
from opendevin.agent import Agent
from opendevin.exceptions import AgentNoInstructionError
from opendevin.llm.llm import LLM
from opendevin.observation import (
AgentRecallObservation,
BrowserOutputObservation,
CmdOutputObservation,
FileReadObservation,
NullObservation,
Observation,
)
from opendevin.schema import ActionType
from opendevin.schema.config import ConfigType
from opendevin.state import State
if config.get(ConfigType.AGENT_MEMORY_ENABLED):
from agenthub.monologue_agent.utils.memory import LongTermMemory

View File

@ -1,4 +1,5 @@
import json
from json_repair import repair_json

View File

@ -1,17 +1,22 @@
import llama_index.embeddings.openai.base as llama_openai
import threading
import chromadb
from llama_index.core import Document
import llama_index.embeddings.openai.base as llama_openai
from llama_index.core import Document, VectorStoreIndex
from llama_index.core.retrievers import VectorIndexRetriever
from llama_index.core import VectorStoreIndex
from llama_index.vector_stores.chroma import ChromaVectorStore
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_random_exponential
from openai._exceptions import APIConnectionError, RateLimitError, InternalServerError
from openai._exceptions import APIConnectionError, InternalServerError, RateLimitError
from tenacity import (
retry,
retry_if_exception_type,
stop_after_attempt,
wait_random_exponential,
)
from opendevin import config
from opendevin.logger import opendevin_logger as logger
from opendevin.schema.config import ConfigType
from . import json
num_retries = config.get(ConfigType.LLM_NUM_RETRIES)

View File

@ -1,8 +1,8 @@
from opendevin.llm.llm import LLM
from opendevin.exceptions import AgentEventTypeError
import agenthub.monologue_agent.utils.json as json
import agenthub.monologue_agent.utils.prompts as prompts
from opendevin.exceptions import AgentEventTypeError
from opendevin.llm.llm import LLM
from opendevin.logger import opendevin_logger as logger

View File

@ -1,21 +1,20 @@
import re
from json import JSONDecodeError
from typing import List
from . import json
from json import JSONDecodeError
import re
from opendevin import config
from opendevin.action import (
action_from_dict,
Action,
action_from_dict,
)
from opendevin.exceptions import LLMOutputError
from opendevin.observation import (
CmdOutputObservation,
)
from opendevin.exceptions import LLMOutputError
from opendevin import config
from opendevin.schema.config import ConfigType
from . import json
ACTION_PROMPT = """
You're a thoughtful robot. Your main task is this:
%(task)s

View File

@ -1,4 +1,5 @@
from opendevin.agent import Agent
from .agent import PlannerAgent
Agent.register('PlannerAgent', PlannerAgent)

View File

@ -1,11 +1,11 @@
from typing import List
from .prompt import get_prompt, parse_response
from opendevin.action import Action, AgentFinishAction
from opendevin.agent import Agent
from opendevin.action import AgentFinishAction
from opendevin.llm.llm import LLM
from opendevin.state import State
from opendevin.action import Action
from .prompt import get_prompt, parse_response
class PlannerAgent(Agent):

View File

@ -1,29 +1,29 @@
import json
from typing import List, Tuple, Dict, Type
from opendevin.plan import Plan
from opendevin.action import Action, action_from_dict
from opendevin.observation import Observation
from opendevin.schema import ActionType
from opendevin.logger import opendevin_logger as logger
from typing import Dict, List, Tuple, Type
from opendevin.action import (
NullAction,
CmdRunAction,
CmdKillAction,
Action,
AddTaskAction,
AgentFinishAction,
AgentRecallAction,
AgentSummarizeAction,
AgentThinkAction,
BrowseURLAction,
CmdKillAction,
CmdRunAction,
FileReadAction,
FileWriteAction,
AgentRecallAction,
AgentThinkAction,
AgentFinishAction,
AgentSummarizeAction,
AddTaskAction,
ModifyTaskAction,
NullAction,
action_from_dict,
)
from opendevin.logger import opendevin_logger as logger
from opendevin.observation import (
NullObservation,
Observation,
)
from opendevin.plan import Plan
from opendevin.schema import ActionType
ACTION_TYPE_TO_CLASS: Dict[str, Type[Action]] = {
ActionType.RUN: CmdRunAction,

View File

@ -7,6 +7,7 @@ select = [
"E",
"W",
"F",
"I",
"Q",
]

View File

@ -11,12 +11,12 @@
},
"outputs": [],
"source": [
"import requests\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"from tqdm import tqdm\n",
"from datasets import load_dataset\n",
"import requests\n",
"import seaborn as sns\n",
"import matplotlib.pyplot as plt"
"from datasets import load_dataset\n",
"from tqdm import tqdm"
]
},
{

View File

@ -11,9 +11,10 @@ Outputs:
'''
# fetch devin's outputs into a json file for evaluation
import json
import os
import sys
import json
import requests
from tqdm import tqdm

View File

@ -1,4 +1,5 @@
import os
import pytest
from conftest import agents

View File

@ -1,9 +1,10 @@
import os
import pytest
import subprocess
import logging
import shutil
import datetime
import logging
import os
import shutil
import subprocess
import pytest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
CASES_DIR = os.path.join(SCRIPT_DIR, 'cases')

View File

@ -1,4 +1,5 @@
import argparse
import pytest
from opendevin import config

View File

@ -1,18 +1,18 @@
from ..exceptions import AgentMalformedActionError
from .agent import (
AgentDelegateAction,
AgentEchoAction,
AgentFinishAction,
AgentRecallAction,
AgentSummarizeAction,
AgentThinkAction,
)
from .base import Action, NullAction
from .bash import CmdRunAction, CmdKillAction
from .bash import CmdKillAction, CmdRunAction
from .browse import BrowseURLAction
from .fileop import FileReadAction, FileWriteAction
from .github import GitHubPushAction
from .agent import (
AgentRecallAction,
AgentThinkAction,
AgentFinishAction,
AgentEchoAction,
AgentSummarizeAction,
AgentDelegateAction,
)
from .tasks import AddTaskAction, ModifyTaskAction
from ..exceptions import AgentMalformedActionError
actions = (
CmdKillAction,

View File

@ -2,12 +2,13 @@ from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Dict
from opendevin.observation import (
AgentRecallObservation,
AgentMessageObservation,
AgentRecallObservation,
NullObservation,
Observation,
)
from opendevin.schema import ActionType
from .base import ExecutableAction, NotExecutableAction
if TYPE_CHECKING:

View File

@ -1,5 +1,6 @@
from dataclasses import dataclass, asdict
from dataclasses import asdict, dataclass
from typing import TYPE_CHECKING
from opendevin.schema import ActionType
if TYPE_CHECKING:

View File

@ -1,9 +1,10 @@
from dataclasses import dataclass
from typing import TYPE_CHECKING
from .base import ExecutableAction
from opendevin.schema import ActionType
from .base import ExecutableAction
if TYPE_CHECKING:
from opendevin.controller import AgentController
from opendevin.observation import CmdOutputObservation, Observation

View File

@ -1,10 +1,12 @@
import os
import base64
import os
from dataclasses import dataclass
from typing import TYPE_CHECKING
from playwright.async_api import async_playwright
from opendevin.observation import BrowserOutputObservation
from opendevin.schema import ActionType
from typing import TYPE_CHECKING
from playwright.async_api import async_playwright
from .base import ExecutableAction

View File

@ -1,18 +1,16 @@
import os
from dataclasses import dataclass
from pathlib import Path
from opendevin import config
from opendevin.observation import (
Observation,
AgentErrorObservation,
FileReadObservation,
FileWriteObservation,
AgentErrorObservation,
Observation,
)
from opendevin.schema import ActionType
from opendevin.sandbox import E2BBox
from opendevin import config
from opendevin.schema import ActionType
from opendevin.schema.config import ConfigType
from .base import ExecutableAction

View File

@ -1,14 +1,15 @@
import random
import string
from dataclasses import dataclass
from opendevin.observation import Observation, AgentErrorObservation
from typing import TYPE_CHECKING
import requests
from opendevin import config
from opendevin.observation import AgentErrorObservation, Observation
from opendevin.observation.message import AgentMessageObservation
from opendevin.observation.run import CmdOutputObservation
from opendevin.schema import ActionType
from opendevin import config
from typing import TYPE_CHECKING
import requests
import random
import string
from opendevin.schema.config import ConfigType
from .base import ExecutableAction

View File

@ -1,10 +1,11 @@
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from opendevin.observation import NullObservation
from opendevin.schema import ActionType
from .base import ExecutableAction, NotExecutableAction
from opendevin.schema import ActionType
from opendevin.observation import NullObservation
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from opendevin.controller import AgentController

View File

@ -1,11 +1,11 @@
from abc import ABC, abstractmethod
from typing import List, Dict, Type, TYPE_CHECKING
from typing import TYPE_CHECKING, Dict, List, Type
if TYPE_CHECKING:
from opendevin.action import Action
from opendevin.state import State
from opendevin.llm.llm import LLM
from opendevin.exceptions import AgentAlreadyRegisteredError, AgentNotRegisteredError
from opendevin.llm.llm import LLM
from opendevin.sandbox.plugins import PluginRequirement

View File

@ -1,12 +1,13 @@
import os
import argparse
import toml
import logging
import os
import pathlib
import platform
import toml
from dotenv import load_dotenv
from opendevin.schema import ConfigType
import logging
logger = logging.getLogger(__name__)

View File

@ -1,5 +1,5 @@
from .agent_controller import AgentController
from .action_manager import ActionManager
from .agent_controller import AgentController
__all__ = [
'AgentController',

View File

@ -1,17 +1,18 @@
from typing import List
from opendevin import config
from opendevin.observation import CmdOutputObservation, AgentErrorObservation
from opendevin.sandbox import DockerExecBox, DockerSSHBox, Sandbox, LocalBox, E2BBox
from opendevin.schema import ConfigType
from opendevin.action import (
Action,
)
from opendevin.observation import (
Observation,
AgentErrorObservation,
CmdOutputObservation,
NullObservation,
Observation,
)
from opendevin.sandbox import DockerExecBox, DockerSSHBox, E2BBox, LocalBox, Sandbox
from opendevin.sandbox.plugins import PluginRequirement
from opendevin.schema import ConfigType
class ActionManager:

View File

@ -1,30 +1,33 @@
import asyncio
from typing import Callable, List, Type
from opendevin import config
from opendevin.schema.config import ConfigType
from opendevin.action import (
Action,
AgentFinishAction,
AgentDelegateAction,
AgentFinishAction,
NullAction,
)
from opendevin.observation import (
Observation,
AgentErrorObservation,
AgentDelegateObservation,
NullObservation,
)
from opendevin.agent import Agent
from opendevin.exceptions import AgentMalformedActionError, AgentNoActionError, MaxCharsExceedError, LLMOutputError
from opendevin.logger import opendevin_logger as logger
from opendevin.plan import Plan
from opendevin.state import State
from opendevin.action.tasks import TaskStateChangedAction
from opendevin.schema import TaskState
from opendevin.agent import Agent
from opendevin.controller.action_manager import ActionManager
from opendevin.exceptions import (
AgentMalformedActionError,
AgentNoActionError,
LLMOutputError,
MaxCharsExceedError,
)
from opendevin.logger import opendevin_logger as logger
from opendevin.observation import (
AgentDelegateObservation,
AgentErrorObservation,
NullObservation,
Observation,
)
from opendevin.plan import Plan
from opendevin.schema import TaskState
from opendevin.schema.config import ConfigType
from opendevin.state import State
MAX_ITERATIONS = config.get(ConfigType.MAX_ITERATIONS)
MAX_CHARS = config.get(ConfigType.MAX_CHARS)

View File

@ -3,10 +3,11 @@ import os
import sys
import traceback
from datetime import datetime
from opendevin import config
from typing import Literal, Mapping
from termcolor import colored
from opendevin import config
from opendevin.schema.config import ConfigType
DISABLE_COLOR_PRINTING = (

View File

@ -3,8 +3,8 @@ import sys
from typing import Type
import agenthub # noqa F401 (we import this to get the agents registered)
from opendevin.config import args
from opendevin.agent import Agent
from opendevin.config import args
from opendevin.controller import AgentController
from opendevin.llm.llm import LLM

View File

@ -1,11 +1,11 @@
from .base import Observation, NullObservation
from .run import CmdOutputObservation
from .base import NullObservation, Observation
from .browse import BrowserOutputObservation
from .files import FileReadObservation, FileWriteObservation
from .message import UserMessageObservation, AgentMessageObservation
from .recall import AgentRecallObservation
from .delegate import AgentDelegateObservation
from .error import AgentErrorObservation
from .files import FileReadObservation, FileWriteObservation
from .message import AgentMessageObservation, UserMessageObservation
from .recall import AgentRecallObservation
from .run import CmdOutputObservation
observations = (
CmdOutputObservation,

View File

@ -1,5 +1,6 @@
import copy
from dataclasses import dataclass
from opendevin.schema import ObservationType

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class BrowserOutputObservation(Observation):

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class AgentDelegateObservation(Observation):

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class AgentErrorObservation(Observation):

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class FileReadObservation(Observation):

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class UserMessageObservation(Observation):

View File

@ -1,9 +1,10 @@
from dataclasses import dataclass
from typing import List
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class AgentRecallObservation(Observation):

View File

@ -1,8 +1,9 @@
from dataclasses import dataclass
from .base import Observation
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class CmdOutputObservation(Observation):

View File

@ -1,7 +1,7 @@
from typing import List
from opendevin.logger import opendevin_logger as logger
from opendevin.exceptions import PlanInvalidStateError
from opendevin.logger import opendevin_logger as logger
OPEN_STATE = 'open'
COMPLETED_STATE = 'completed'

View File

@ -1,8 +1,8 @@
from .sandbox import Sandbox
from .docker.ssh_box import DockerSSHBox
from .docker.exec_box import DockerExecBox
from .docker.local_box import LocalBox
from .docker.ssh_box import DockerSSHBox
from .e2b.sandbox import E2BBox
from .sandbox import Sandbox
__all__ = [
'Sandbox',

View File

@ -2,22 +2,22 @@ import atexit
import concurrent.futures
import os
import sys
import tarfile
import time
import uuid
import tarfile
from glob import glob
from collections import namedtuple
from glob import glob
from typing import Dict, List, Tuple
import docker
from opendevin import config
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.sandbox import Sandbox
from opendevin.sandbox.process import Process
from opendevin.sandbox.docker.process import DockerProcess
from opendevin.schema import ConfigType
from opendevin.exceptions import SandboxInvalidBackgroundCommandError
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.docker.process import DockerProcess
from opendevin.sandbox.process import Process
from opendevin.sandbox.sandbox import Sandbox
from opendevin.schema import ConfigType
InputType = namedtuple('InputType', ['content'])
OutputType = namedtuple('OutputType', ['content'])

View File

@ -1,13 +1,14 @@
import subprocess
import atexit
import os
import subprocess
import sys
from typing import Tuple, Dict
from opendevin.sandbox.sandbox import Sandbox
from opendevin.sandbox.process import Process
from opendevin.sandbox.docker.process import DockerProcess
from opendevin.logger import opendevin_logger as logger
from typing import Dict, Tuple
from opendevin import config
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.docker.process import DockerProcess
from opendevin.sandbox.process import Process
from opendevin.sandbox.sandbox import Sandbox
from opendevin.schema.config import ConfigType
# ===============================================================================

View File

@ -1,25 +1,25 @@
import atexit
import os
import sys
import tarfile
import time
import uuid
import tarfile
from glob import glob
from collections import namedtuple
from glob import glob
from typing import Dict, List, Tuple, Union
import docker
from pexpect import pxssh
from opendevin import config
from opendevin.exceptions import SandboxInvalidBackgroundCommandError
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.sandbox import Sandbox
from opendevin.sandbox.process import Process
from opendevin.sandbox.docker.process import DockerProcess
from opendevin.sandbox.plugins import JupyterRequirement, SWEAgentCommandsRequirement
from opendevin.sandbox.process import Process
from opendevin.sandbox.sandbox import Sandbox
from opendevin.schema import ConfigType
from opendevin.utils import find_available_tcp_port
from opendevin.exceptions import SandboxInvalidBackgroundCommandError
InputType = namedtuple('InputType', ['content'])
OutputType = namedtuple('OutputType', ['content'])

View File

@ -2,17 +2,18 @@ import os
import tarfile
from glob import glob
from typing import Dict, Tuple
from e2b import Sandbox as E2BSandbox
from e2b.sandbox.exception import (
TimeoutException,
)
from opendevin import config
from opendevin.schema.config import ConfigType
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.sandbox import Sandbox
from opendevin.sandbox.e2b.process import E2BProcess
from opendevin.sandbox.process import Process
from opendevin.sandbox.sandbox import Sandbox
from opendevin.schema.config import ConfigType
class E2BBox(Sandbox):

View File

@ -1,8 +1,7 @@
from .mixin import PluginMixin
from .requirement import PluginRequirement
# Requirements
from .jupyter import JupyterRequirement
from .mixin import PluginMixin
from .requirement import PluginRequirement
from .swe_agent_commands import SWEAgentCommandsRequirement
__all__ = ['PluginMixin', 'PluginRequirement', 'JupyterRequirement', 'SWEAgentCommandsRequirement']

View File

@ -1,5 +1,6 @@
import os
from dataclasses import dataclass
from opendevin.sandbox.plugins.requirement import PluginRequirement

View File

@ -2,6 +2,7 @@
import os
import sys
import time
import requests
# Read the Python code from STDIN

View File

@ -1,17 +1,17 @@
#!/usr/bin/env python3
import asyncio
import logging
import os
import re
import asyncio
import tornado
import logging
from tornado.escape import json_encode, json_decode, url_escape
from tornado.websocket import websocket_connect
from tornado.ioloop import PeriodicCallback
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from uuid import uuid4
import tornado
from tornado.escape import json_decode, json_encode, url_escape
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from tornado.ioloop import PeriodicCallback
from tornado.websocket import websocket_connect
logging.basicConfig(level=logging.INFO)

View File

@ -1,5 +1,6 @@
import os
from typing import List, Protocol, Tuple
from opendevin.logger import opendevin_logger as logger
from opendevin.sandbox.plugins.requirement import PluginRequirement

View File

@ -1,8 +1,11 @@
import os
from typing import List
from dataclasses import dataclass, field
from typing import List
from opendevin.sandbox.plugins.requirement import PluginRequirement
from opendevin.sandbox.plugins.swe_agent_commands.parse_commands import parse_command_file
from opendevin.sandbox.plugins.swe_agent_commands.parse_commands import (
parse_command_file,
)
def _resolve_to_cur_dir(filename):

View File

@ -1,9 +1,8 @@
from abc import ABC, abstractmethod
from typing import Dict
from typing import Tuple
from typing import Dict, Tuple
from opendevin.sandbox.process import Process
from opendevin.sandbox.plugins.mixin import PluginMixin
from opendevin.sandbox.process import Process
class Sandbox(ABC, PluginMixin):

View File

@ -1,7 +1,8 @@
import atexit
from opendevin.server.session import session_manager
from opendevin.logger import opendevin_logger as logger
from opendevin.server.session import session_manager
from .agent import AgentUnit

View File

@ -1,9 +1,11 @@
import os
import jwt
from typing import Dict
from opendevin.logger import opendevin_logger as logger
import jwt
from jwt.exceptions import InvalidTokenError
from opendevin.logger import opendevin_logger as logger
JWT_SECRET = os.getenv('JWT_SECRET', '5ecRe7')

View File

@ -11,9 +11,9 @@ from fastapi.staticfiles import StaticFiles
import agenthub # noqa F401 (we import this to get the agents registered)
from opendevin import config, files
from opendevin.schema.config import ConfigType
from opendevin.agent import Agent
from opendevin.logger import opendevin_logger as logger
from opendevin.schema.config import ConfigType
from opendevin.server.agent import agent_manager
from opendevin.server.auth import get_sid_from_token, sign_token
from opendevin.server.session import message_stack, session_manager

View File

@ -1,11 +1,12 @@
import atexit
import json
import os
from typing import Dict, Callable
from typing import Callable, Dict
from fastapi import WebSocket
from opendevin.logger import opendevin_logger as logger
from .msg_stack import message_stack
from .session import Session

View File

@ -1,12 +1,11 @@
import os
import json
import atexit
import json
import os
import uuid
from typing import Dict, List
from opendevin.schema.action import ActionType
from opendevin.logger import opendevin_logger as logger
from opendevin.schema.action import ActionType
CACHE_DIR = os.getenv('CACHE_DIR', 'cache')
MSG_CACHE_FILE = os.path.join(CACHE_DIR, 'messages.json')

View File

@ -1,9 +1,10 @@
import time
from typing import Dict, Callable
from typing import Callable, Dict
from fastapi import WebSocket, WebSocketDisconnect
from opendevin.logger import opendevin_logger as logger
from .msg_stack import message_stack
DEL_DELT_SEC = 60 * 60 * 5

View File

@ -1,15 +1,14 @@
from dataclasses import dataclass, field
from typing import List, Tuple, Dict
from opendevin.plan import Plan
from typing import Dict, List, Tuple
from opendevin.action import (
Action,
)
from opendevin.observation import (
Observation,
CmdOutputObservation,
Observation,
)
from opendevin.plan import Plan
@dataclass

View File

@ -1,5 +1,5 @@
import re
import os
import re
from functools import partial
import pytest

View File

@ -1,5 +1,5 @@
import os
import asyncio
import os
import subprocess
import pytest

View File

@ -1,9 +1,10 @@
from opendevin import config
from opendevin.schema import ConfigType
from opendevin.action import fileop
from pathlib import Path
import pytest
from opendevin import config
from opendevin.action import fileop
from opendevin.schema import ConfigType
def test_resolve_path():

View File

@ -1,16 +1,17 @@
from opendevin import config
from unittest.mock import MagicMock, call, patch
import pytest
from agenthub.dummy_agent.agent import DummyAgent
from opendevin import config
from opendevin.action.github import GitHubPushAction, GitHubSendPRAction
from opendevin.controller.agent_controller import AgentController
from opendevin.llm.llm import LLM
from opendevin.observation.error import AgentErrorObservation
from opendevin.observation.message import AgentMessageObservation
from opendevin.observation.run import CmdOutputObservation
from opendevin.schema.config import ConfigType
import pytest
from unittest.mock import MagicMock, call, patch
@pytest.fixture

View File

@ -1,17 +1,17 @@
from opendevin.action import (
action_from_dict,
Action,
AddTaskAction,
AgentFinishAction,
AgentRecallAction,
AgentThinkAction,
BrowseURLAction,
CmdKillAction,
CmdRunAction,
BrowseURLAction,
GitHubPushAction,
FileReadAction,
FileWriteAction,
AgentRecallAction,
AgentFinishAction,
AddTaskAction,
GitHubPushAction,
ModifyTaskAction,
action_from_dict,
)

View File

@ -1,7 +1,7 @@
from opendevin.config import get_parser
import pytest
from opendevin.config import get_parser
def test_help_message(capsys):
parser = get_parser()

View File

@ -1,4 +1,8 @@
from opendevin.observation import observation_from_dict, Observation, CmdOutputObservation
from opendevin.observation import (
CmdOutputObservation,
Observation,
observation_from_dict,
)
def test_observation_serialization_deserialization():