Simplify deps
This commit is contained in:
parent
122da834d7
commit
a0c4ddbd01
3 changed files with 7 additions and 7 deletions
|
|
@ -6,8 +6,6 @@ from haiku.rag.store.models import Document, SearchResult
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from haiku.rag.agents.rlm.docker_sandbox import DockerSandbox
|
from haiku.rag.agents.rlm.docker_sandbox import DockerSandbox
|
||||||
from haiku.rag.agents.rlm.models import CodeExecution
|
from haiku.rag.agents.rlm.models import CodeExecution
|
||||||
from haiku.rag.client import HaikuRAG
|
|
||||||
from haiku.rag.config.models import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
@ -24,7 +22,5 @@ class RLMContext:
|
||||||
class RLMDeps:
|
class RLMDeps:
|
||||||
"""Dependencies for RLM agent."""
|
"""Dependencies for RLM agent."""
|
||||||
|
|
||||||
client: "HaikuRAG"
|
|
||||||
config: "AppConfig"
|
|
||||||
sandbox: "DockerSandbox"
|
sandbox: "DockerSandbox"
|
||||||
context: RLMContext = field(default_factory=RLMContext)
|
context: RLMContext = field(default_factory=RLMContext)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,12 @@ class DockerSandbox:
|
||||||
|
|
||||||
DEFAULT_IMAGE = "ghcr.io/ggozad/haiku.rag-slim:latest"
|
DEFAULT_IMAGE = "ghcr.io/ggozad/haiku.rag-slim:latest"
|
||||||
|
|
||||||
|
haiku_client: "HaikuRAG"
|
||||||
|
config: RLMConfig
|
||||||
|
context: RLMContext
|
||||||
|
image: str
|
||||||
|
_process: subprocess.Popen[bytes] | None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
client: "HaikuRAG",
|
client: "HaikuRAG",
|
||||||
|
|
@ -47,7 +53,7 @@ class DockerSandbox:
|
||||||
self.config = config
|
self.config = config
|
||||||
self.context = context
|
self.context = context
|
||||||
self.image = image or self.DEFAULT_IMAGE
|
self.image = image or self.DEFAULT_IMAGE
|
||||||
self._process: subprocess.Popen[bytes] | None = None
|
self._process = None
|
||||||
|
|
||||||
def _build_docker_cmd(self) -> list[str]:
|
def _build_docker_cmd(self) -> list[str]:
|
||||||
"""Build the docker run command."""
|
"""Build the docker run command."""
|
||||||
|
|
|
||||||
|
|
@ -1364,8 +1364,6 @@ class HaikuRAG:
|
||||||
image=self._config.rlm.docker_image,
|
image=self._config.rlm.docker_image,
|
||||||
) as sandbox:
|
) as sandbox:
|
||||||
deps = RLMDeps(
|
deps = RLMDeps(
|
||||||
client=self,
|
|
||||||
config=self._config,
|
|
||||||
sandbox=sandbox,
|
sandbox=sandbox,
|
||||||
context=context,
|
context=context,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue