|
4 | 4 |
|
5 | 5 | import importlib.util |
6 | 6 | from pathlib import Path |
7 | | -from typing import Any |
8 | 7 |
|
9 | 8 | import pytest |
10 | 9 |
|
|
23 | 22 | PROVIDER_HANDLER_MODES = { |
24 | 23 | provider: spec.supported_modes for provider, spec in PROVIDER_SPECS.items() |
25 | 24 | } |
26 | | - |
27 | | - |
28 | | -def legacy_config_dicts() -> dict[Provider, dict[str, Any]]: |
29 | | - """Expose the old dict shape while the baseline tests migrate.""" |
30 | | - return { |
31 | | - provider: { |
32 | | - "provider_string": spec.provider_string, |
33 | | - "supported_modes": list(spec.supported_modes), |
34 | | - "unsupported_modes": list(spec.unsupported_modes), |
35 | | - "legacy_modes": spec.legacy_modes, |
36 | | - "from_function": spec.from_function, |
37 | | - "sdk_module": spec.sdk_module, |
38 | | - "basic_modes": list(spec.basic_modes), |
39 | | - "async_modes": list(spec.async_modes), |
40 | | - "missing_sdk_message": spec.missing_sdk_message, |
41 | | - } |
42 | | - for provider, spec in TEST_PROVIDER_SPECS.items() |
43 | | - } |
44 | | - |
| 25 | +PARTIAL_STREAM_CASES = tuple( |
| 26 | + (provider, mode) |
| 27 | + for provider, spec in TEST_PROVIDER_SPECS.items() |
| 28 | + for mode in spec.capabilities.partial_stream_modes |
| 29 | +) |
| 30 | +ITERABLE_STREAM_CASES = tuple( |
| 31 | + (provider, mode) |
| 32 | + for provider, spec in TEST_PROVIDER_SPECS.items() |
| 33 | + for mode in spec.capabilities.iterable_stream_modes |
| 34 | +) |
| 35 | +TYPED_MULTIMODAL_PROVIDERS = tuple( |
| 36 | + provider |
| 37 | + for provider, spec in TEST_PROVIDER_SPECS.items() |
| 38 | + if spec.capabilities.multimodal_inputs |
| 39 | +) |
| 40 | +TYPED_MULTIMODAL_CASES = tuple( |
| 41 | + (provider, media_type) |
| 42 | + for provider, spec in TEST_PROVIDER_SPECS.items() |
| 43 | + for media_type in spec.capabilities.multimodal_inputs |
| 44 | +) |
| 45 | +EXPLICIT_PARALLEL_PROVIDERS = tuple( |
| 46 | + provider |
| 47 | + for provider, spec in TEST_PROVIDER_SPECS.items() |
| 48 | + if spec.capabilities.explicit_parallel_tools |
| 49 | +) |
45 | 50 |
|
46 | 51 | _PROJECT_ROOT = Path(__file__).resolve().parents[2] |
47 | 52 | _HANDLERS_LOADED: set[Provider] = set() |
|
0 commit comments