Skip to content

chore(mypy): add type hints to provider_inline and provider_utils#5400

Closed
Elbehery wants to merge 1 commit intollamastack:mainfrom
Elbehery:20260401_add_type_hints_providers_remote_module
Closed

chore(mypy): add type hints to provider_inline and provider_utils#5400
Elbehery wants to merge 1 commit intollamastack:mainfrom
Elbehery:20260401_add_type_hints_providers_remote_module

Conversation

@Elbehery
Copy link
Copy Markdown
Contributor

@Elbehery Elbehery commented Apr 1, 2026

What does this PR do?

Add type hints to make the following files pass strict mypy checking:

  • src/llama_stack/providers/inline/eval/builtin/eval.py: Add type annotations for dicts, fix variable shadowing, add assertions for non-streaming responses and non-None content, use proper union types for message lists
  • src/llama_stack/providers/utils/inference/embedding_mixin.py: Change model_store type from ModelStore to ModelStore | None to match InferenceProvider protocol

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 1, 2026
Add type hints to make the following files pass strict mypy checking:
- src/llama_stack/providers/inline/eval/builtin/eval.py: Add type
  annotations for dicts, fix variable shadowing, add assertions for
  non-streaming responses and non-None content, use proper union types
  for message lists
- src/llama_stack/providers/utils/inference/embedding_mixin.py: Add
  config attribute declaration (Any type) and import Any from typing
  to fix "has no attribute config" error. Add sentence_transformers
  to mypy ignore_missing_imports list.

Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
@Elbehery Elbehery force-pushed the 20260401_add_type_hints_providers_remote_module branch from 455ccea to 6fafd77 Compare April 1, 2026 10:44
@Elbehery Elbehery changed the title chore(mypy): remove CLI and provider files from mypy exclude list chore(mypy): add type hints to provider_inline and provider_utils Apr 1, 2026
@Elbehery
Copy link
Copy Markdown
Contributor Author

Elbehery commented Apr 1, 2026

closed in favor of #5399

@Elbehery Elbehery closed this Apr 1, 2026
@Elbehery Elbehery deleted the 20260401_add_type_hints_providers_remote_module branch April 1, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant