Files
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

39 lines
1.2 KiB
Python

"""Shared provider capability matrix for v2 tests."""
from __future__ import annotations
from typing import Any
from instructor import Provider
from instructor.v2.core.provider_specs import PROVIDER_SPECS
TEST_PROVIDER_SPECS = {
provider: spec
for provider, spec in PROVIDER_SPECS.items()
if spec.handler_module is not None and spec.from_function is not None
}
PROVIDER_HANDLER_MODES = {
provider: spec.supported_modes for provider, spec in PROVIDER_SPECS.items()
}
def legacy_config_dicts() -> dict[Provider, dict[str, Any]]:
"""Expose the old dict shape while tests migrate to ProviderSpec."""
return {
provider: {
"provider_string": spec.provider_string,
"supported_modes": list(spec.supported_modes),
"unsupported_modes": list(spec.unsupported_modes),
"legacy_modes": spec.legacy_modes,
"from_function": spec.from_function,
"sdk_module": spec.sdk_module,
"basic_modes": list(spec.basic_modes),
"async_modes": list(spec.async_modes),
"missing_sdk_message": spec.missing_sdk_message,
}
for provider, spec in TEST_PROVIDER_SPECS.items()
}