Files
wehub-resource-sync 97e91a83f3
Ruff / Ruff (push) Waiting to run
Test / Core Tests (push) Waiting to run
Test / Offline Coverage Tests (Python 3.10) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.11) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.12) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.13) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.9) (push) Waiting to run
Test / Full Coverage (Python 3.11) (push) Waiting to run
Test / Core Provider Tests (OpenAI) (push) Blocked by required conditions
Test / Core Provider Tests (Anthropic) (push) Blocked by required conditions
Test / Core Provider Tests (Google) (push) Blocked by required conditions
Test / Core Provider Tests (Other) (push) Blocked by required conditions
Test / Anthropic Tests (push) Blocked by required conditions
Test / Gemini Tests (push) Blocked by required conditions
Test / Google GenAI Tests (push) Blocked by required conditions
Test / Vertex AI Tests (push) Blocked by required conditions
Test / OpenAI Tests (push) Blocked by required conditions
Test / Writer Tests (push) Blocked by required conditions
Test / Auto Client Tests (push) Blocked by required conditions
ty / type-check (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:36:38 +08:00

26 lines
823 B
Python

"""Backwards compatibility module for instructor.hooks.
This module provides lazy imports to maintain backwards compatibility.
"""
import warnings
def __getattr__(name: str):
"""Lazy import to provide backward compatibility for hooks imports."""
warnings.warn(
f"Importing from 'instructor.hooks' is deprecated and will be removed in v2.0.0. "
f"Please update your imports to use 'instructor.core.hooks.{name}' instead:\n"
" from instructor.core.hooks import Hooks, HookName",
DeprecationWarning,
stacklevel=2,
)
from .core import hooks as core_hooks
# Try to get the attribute from the core.hooks module
if hasattr(core_hooks, name):
return getattr(core_hooks, name)
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")