llama-stack/llama_stack
Sébastien Han f86154dff5
refactor: restructure resolver logic and improve type safety (#1323)
# What does this PR do?

- Modularized `resolve_impls` by extracting helper functions for
validation, sorting, and instantiation.
- Improved readability by introducing `validate_and_prepare_providers`,
`sort_providers_by_dependency`, and `instantiate_providers`.
- Enhanced type safety with explicit type hints (`Tuple`, `Dict`, `Set`,
etc.).
- Fixed potential issues with provider module imports and added error
handling.
- Updated `pyproject.toml` to enforce type checking on `resolver.py`
using `mypy`.

Signed-off-by: Sébastien Han <seb@redhat.com>

- [//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

Run the server.

[//]: # (## Documentation)

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-03 10:45:12 -08:00
..
apis feat: enhance OpenAPI spec to include Error types (#1320) 2025-02-28 11:16:12 -08:00
cli chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
distribution refactor: restructure resolver logic and improve type safety (#1323) 2025-03-03 10:45:12 -08:00
models/llama chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
providers feat: unify max_infer_iters in client/server agent loop (#1309) 2025-03-03 10:08:36 -08:00
scripts chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
strong_typing Ensure that deprecations for fields follow through to OpenAPI 2025-02-19 13:54:04 -08:00
templates chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
__init__.py export LibraryClient 2024-12-13 12:08:00 -08:00
logcat.py feat: add a configurable category-based logger (#1352) 2025-03-02 18:51:14 -08:00
schema_utils.py ci: add mypy for static type checking (#1101) 2025-02-21 13:15:40 -08:00