1111import os
1212from typing import TYPE_CHECKING , Any , Literal , Self
1313
14+ from upath import UPath
15+
1416from llmling .config .manager import ConfigManager
15- from llmling .config .models import PathResource
17+ from llmling .config .models import Config , PathResource
1618from llmling .config .utils import prepare_runtime , toolset_config_to_toolset
1719from llmling .core import exceptions
1820from llmling .core .chain import ChainTool
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