From a62b4e939b5e51f349f2c8c12df6986776c9892b Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Tue, 10 Dec 2024 15:33:48 +0100 Subject: [PATCH] chore: cleanup --- src/llmling/config/runtime.py | 2 +- src/llmling/resources/loaders/registry.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/llmling/config/runtime.py b/src/llmling/config/runtime.py index f96a74a..2f569a7 100644 --- a/src/llmling/config/runtime.py +++ b/src/llmling/config/runtime.py @@ -89,7 +89,7 @@ def __init__( self._initialized = False # Register builtin processors proc = Jinja2Processor(config.global_settings.jinja_environment) - self._processor_registry.register("jinja_template", proc) + self._processor_registry["jinja_template"] = proc settings = self._config.global_settings self._dep_manager = depkit.DependencyManager( prefer_uv=settings.prefer_uv, diff --git a/src/llmling/resources/loaders/registry.py b/src/llmling/resources/loaders/registry.py index d518b63..70fce95 100644 --- a/src/llmling/resources/loaders/registry.py +++ b/src/llmling/resources/loaders/registry.py @@ -26,16 +26,16 @@ class ResourceLoaderRegistry(BaseRegistry[str, ResourceLoader[Any]]): """Registry for context loaders.""" - # def __init__(self) -> None: - # """Initialize with default loaders.""" - # super().__init__() - # # Always register defaults - # self.register("image", ImageResourceLoader) - # self.register("path", PathResourceLoader) - # self.register("text", TextResourceLoader) - # self.register("cli", CLIResourceLoader) - # self.register("source", SourceResourceLoader) - # self.register("callable", CallableResourceLoader) + def __init__(self, register_default_loaders: bool = False, **kwargs) -> None: + """Initialize registry. + + Args: + register_default_loaders: Register default loaders on initialization. + kwargs: Additional keyword arguments passed to the parent class. + """ + super().__init__(**kwargs) + if register_default_loaders: + self.register_default_loaders() @property def _error_class(self) -> type[exceptions.LoaderError]: