delete plugin directory
This commit is contained in:
parent
83a2d23297
commit
3dc31f7ae4
10 changed files with 0 additions and 109 deletions
|
|
@ -1,26 +0,0 @@
|
|||
from typing import List
|
||||
import pluggy
|
||||
from .step import hookspecs
|
||||
from .step.libs import hello_world
|
||||
|
||||
builtin_libs = [hello_world]
|
||||
|
||||
def get_plugin_manager(use_plugins: List[str]) -> pluggy.PluginManager:
|
||||
pm = pluggy.PluginManager("continue.step")
|
||||
pm.add_hookspecs(hookspecs)
|
||||
pm.load_setuptools_entrypoints("continue.step")
|
||||
|
||||
# Only use plugins that are specified in the config file
|
||||
for plugin, name in pm.list_name_plugin():
|
||||
if name not in use_plugins:
|
||||
pm.set_blocked(plugin)
|
||||
|
||||
# Print warning if plugin not found
|
||||
for name in use_plugins:
|
||||
if not pm.has_plugin(name):
|
||||
print(f"Plugin {name} not found.")
|
||||
|
||||
for lib in builtin_libs:
|
||||
pm.register(lib)
|
||||
|
||||
return pm
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
def load_validator_plugin(config: ValidatorPluginConfig) -> Validator:
|
||||
if config.name == "continue.tb_validator":
|
||||
return PythonTracebackValidator(config.cmd, config.cwd)
|
||||
elif config.name == "continue.pytest_validator":
|
||||
return PytestValidator(cwd=config.cwd)
|
||||
else:
|
||||
raise KeyError("Unknown validator plugin name")
|
||||
|
||||
def load_llm_plugin(config: LLMPluginConfig) -> LLM:
|
||||
if config.provider == "openai":
|
||||
return OpenAI(api_key=config.api_key)
|
||||
else:
|
||||
raise KeyError("Unknown LLM provider: " + config.provider)
|
||||
|
||||
def load_policy_plugin(config: PolicyPluginConfig) -> Policy:
|
||||
if config.name == "continue.random_policy":
|
||||
return RandomPolicy()
|
||||
elif config.name == "continue.dfs_policy":
|
||||
return DFSPolicy()
|
||||
else:
|
||||
raise KeyError("Unknown policy plugin name")
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import pluggy
|
||||
|
||||
hookimpl = pluggy.HookimplMarker("continue.policy")
|
||||
"""Marker to be imported and used in plugins (and for own implementations)"""
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
from typing import List, Tuple
|
||||
import pluggy
|
||||
from ...libs.policy import Policy, Step
|
||||
|
||||
hookspec = pluggy.HookspecMarker("continue.policy")
|
||||
|
||||
class PolicyPlugin(Policy):
|
||||
@hookspec
|
||||
def next(self) -> Step:
|
||||
"""Get the next step to run"""
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
from plugins import policy
|
||||
from ....libs.observation import Observation
|
||||
from ....libs.steps import Step
|
||||
from ....libs.core import History
|
||||
|
||||
|
||||
class AlternatingPolicy:
|
||||
"""A Policy that alternates between two steps."""
|
||||
|
||||
def __init__(self, first: Step, second: Step):
|
||||
self.first = first
|
||||
self.second = second
|
||||
self.last_was_first = False
|
||||
|
||||
@policy.hookimpl
|
||||
def next(self, history: History) -> Step:
|
||||
if self.last_was_first:
|
||||
self.last_was_first = False
|
||||
return self.second
|
||||
else:
|
||||
self.last_was_first = True
|
||||
return self.first
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import pluggy
|
||||
|
||||
hookimpl = pluggy.HookimplMarker("continue.step")
|
||||
"""Marker to be imported and used in plugins (and for own implementations)"""
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
from typing import Coroutine
|
||||
import pluggy
|
||||
from ...libs.core import ContinueSDK, Step, Observation
|
||||
|
||||
hookspec = pluggy.HookspecMarker("continue.step")
|
||||
|
||||
# Perhaps Actions should be generic about what their inputs must be.
|
||||
|
||||
|
||||
class StepPlugin(Step):
|
||||
@hookspec
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
"""Run"""
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
from ....plugins import step
|
||||
from ....libs.steps import ContinueSDK
|
||||
|
||||
|
||||
class HelloWorldStep:
|
||||
"""A Step that prints "Hello World!"."""
|
||||
@step.hookimpl
|
||||
def run(sdk: ContinueSDK):
|
||||
print("Hello World!")
|
||||
Loading…
Add table
Reference in a new issue