- harness/es.py: append-only event store + проекции (образец — кооп-портал) - harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу - harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы - harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе (глобальный asyncio-рантайм Strands не переживает 2+ create_harness) - cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом) - 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
26 lines
967 B
Python
26 lines
967 B
Python
"""Deprecated aliases for hook events promoted to strands.hooks."""
|
|
|
|
import warnings
|
|
from typing import Any
|
|
|
|
from ...hooks.events import AfterModelCallEvent, AfterToolCallEvent, BeforeModelCallEvent, BeforeToolCallEvent
|
|
|
|
# Deprecated aliases - warning emitted on access via __getattr__
|
|
_DEPRECATED_ALIASES = {
|
|
"BeforeToolInvocationEvent": BeforeToolCallEvent,
|
|
"AfterToolInvocationEvent": AfterToolCallEvent,
|
|
"BeforeModelInvocationEvent": BeforeModelCallEvent,
|
|
"AfterModelInvocationEvent": AfterModelCallEvent,
|
|
}
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
if name in _DEPRECATED_ALIASES:
|
|
warnings.warn(
|
|
f"{name} has been moved to production with an updated name. "
|
|
f"Use {_DEPRECATED_ALIASES[name].__name__} from strands.hooks instead.",
|
|
DeprecationWarning,
|
|
stacklevel=2,
|
|
)
|
|
return _DEPRECATED_ALIASES[name]
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|