Skip to content

Commit 2ae41d7

Browse files
committed
chore: typing
1 parent c45dc29 commit 2ae41d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/llmling/config/runtime.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
import os
1212
from typing import TYPE_CHECKING, Any, Literal, Self
1313

14+
from upath import UPath
15+
1416
from llmling.config.manager import ConfigManager
15-
from llmling.config.models import PathResource
17+
from llmling.config.models import Config, PathResource
1618
from llmling.config.utils import prepare_runtime, toolset_config_to_toolset
1719
from llmling.core import exceptions
1820
from llmling.core.chain import ChainTool
@@ -37,7 +39,7 @@
3739

3840
from upath.types import JoinablePathLike
3941

40-
from llmling.config.models import BaseResource, Config
42+
from llmling.config.models import BaseResource
4143
from llmling.processors.base import ProcessorResult
4244
from llmling.prompts.models import BasePrompt
4345
from llmling.resources.models import LoadedResource
@@ -319,7 +321,7 @@ def from_file(cls, path: JoinablePathLike) -> Self:
319321
return cls.from_config(manager.config)
320322

321323
@classmethod
322-
def from_config(cls, config: Config | str | os.PathLike[str]) -> Self:
324+
def from_config(cls, config: Config | JoinablePathLike) -> Self:
323325
"""Create a fully initialized runtime config from static config.
324326
325327
Args:
@@ -328,7 +330,7 @@ def from_config(cls, config: Config | str | os.PathLike[str]) -> Self:
328330
Returns:
329331
Initialized runtime configuration
330332
"""
331-
if isinstance(config, str | os.PathLike):
333+
if isinstance(config, str | os.PathLike | UPath):
332334
config = ConfigManager.load(config).config
333335
loader_registry = ResourceLoaderRegistry()
334336
processor_registry = ProcessorRegistry()
@@ -338,7 +340,7 @@ def from_config(cls, config: Config | str | os.PathLike[str]) -> Self:
338340
)
339341
prompt_registry = PromptRegistry()
340342
tool_registry = ToolRegistry()
341-
343+
assert isinstance(config, Config)
342344
runtime = cls(
343345
config=config,
344346
loader_registry=loader_registry,

0 commit comments

Comments
 (0)