Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions cascadeflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ def __getattr__(self, name: str):
# ==================== EAGER IMPORTS ====================
# Only the harness API is loaded eagerly β€” it uses only stdlib imports.

from .harness import ( # noqa: E402
from .harness import (
HarnessConfig,
HarnessInitReport,
HarnessRunContext,
)
from .harness import agent as harness_agent # noqa: E402
from .harness import (
get_current_run,
get_harness_callback_manager,
get_harness_config,
init,
reset,
run,
agent as harness_agent,
get_harness_config,
get_current_run,
get_harness_callback_manager,
set_harness_callback_manager,
)

Expand All @@ -97,6 +99,7 @@ def __getattr__(self, name: str):
# Agent & result
"CascadeAgent": (".agent", "CascadeAgent"),
"CascadeResult": (".schema.result", "CascadeResult"),
"agent": (".agent", None),
# Providers
"BaseProvider": (".providers", "BaseProvider"),
"ModelResponse": (".providers", "ModelResponse"),
Expand Down Expand Up @@ -245,7 +248,10 @@ def __getattr__(name: str):
import importlib

module = importlib.import_module(module_path, __package__)
value = getattr(module, attr_name)
if attr_name is None:
value = module
else:
value = getattr(module, attr_name)
globals()[name] = value
return value
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Expand Down