Files
567-labs--instructor/tests/v2/test_legacy_provider_compat.py
wehub-resource-sync 97e91a83f3
Ruff / Ruff (push) Has been cancelled
Test / Core Tests (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.10) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.11) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.12) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.13) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.9) (push) Has been cancelled
Test / Full Coverage (Python 3.11) (push) Has been cancelled
Test / Core Provider Tests (OpenAI) (push) Has been cancelled
Test / Core Provider Tests (Anthropic) (push) Has been cancelled
Test / Core Provider Tests (Google) (push) Has been cancelled
Test / Core Provider Tests (Other) (push) Has been cancelled
Test / Anthropic Tests (push) Has been cancelled
Test / Gemini Tests (push) Has been cancelled
Test / Google GenAI Tests (push) Has been cancelled
Test / Vertex AI Tests (push) Has been cancelled
Test / OpenAI Tests (push) Has been cancelled
Test / Writer Tests (push) Has been cancelled
Test / Auto Client Tests (push) Has been cancelled
ty / type-check (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:36:38 +08:00

61 lines
2.1 KiB
Python

from __future__ import annotations
import importlib
def test_legacy_provider_modules_remain_importable() -> None:
modules = [
"instructor.providers",
"instructor.providers.anthropic.client",
"instructor.providers.anthropic.utils",
"instructor.providers.bedrock.client",
"instructor.providers.bedrock.utils",
"instructor.providers.cerebras.client",
"instructor.providers.cerebras.utils",
"instructor.providers.cohere.client",
"instructor.providers.cohere.utils",
"instructor.providers.fireworks.client",
"instructor.providers.gemini.client",
"instructor.providers.gemini.utils",
"instructor.providers.genai.client",
"instructor.providers.groq.client",
"instructor.providers.mistral.client",
"instructor.providers.mistral.utils",
"instructor.providers.openai.utils",
"instructor.providers.perplexity.client",
"instructor.providers.perplexity.utils",
"instructor.providers.vertexai.client",
"instructor.providers.writer.client",
"instructor.providers.writer.utils",
"instructor.providers.xai.client",
"instructor.providers.xai.utils",
]
for module_name in modules:
importlib.import_module(module_name)
def test_legacy_provider_utils_forward_to_v2_symbols() -> None:
openai_utils = importlib.import_module("instructor.providers.openai.utils")
anthropic_utils = importlib.import_module("instructor.providers.anthropic.utils")
gemini_utils = importlib.import_module("instructor.providers.gemini.utils")
assert (
openai_utils.reask_tools
is importlib.import_module(
"instructor.v2.providers.openai.handlers"
).reask_tools
)
assert (
anthropic_utils.combine_system_messages
is importlib.import_module(
"instructor.v2.providers.anthropic.handlers"
).combine_system_messages
)
assert (
gemini_utils.map_to_gemini_function_schema
is importlib.import_module(
"instructor.v2.providers.gemini.utils"
).map_to_gemini_function_schema
)