chore(mypy): fix type hints for inline provider files#5399
Open
Elbehery wants to merge 2 commits intollamastack:mainfrom
Open
chore(mypy): fix type hints for inline provider files#5399Elbehery wants to merge 2 commits intollamastack:mainfrom
Elbehery wants to merge 2 commits intollamastack:mainfrom
Conversation
7a3ad27 to
1281090
Compare
14e8aaf to
8827ae4
Compare
Fix mypy strict type checking errors in 27 inline provider files: 1. Fixed SentenceTransformerEmbeddingMixin.model_store type to match InferenceProvider protocol (ModelStore | None instead of ModelStore) 2. Fixed eval.py type errors: - Added type annotations for jobs and benchmarks dicts - Fixed variable shadowing in benchmark iteration - Added proper type annotations for sampling_params (dict[str, Any]) - Fixed message type handling with proper union types - Separated completion and chat_completion variable scopes - Added assertions for non-streaming responses - Added assertion for non-None content in chat responses Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
05f6441 to
5399717
Compare
…easoning Fix mypy override errors in transformers and sentence_transformers inference providers by adding the correct return type annotation for the openai_chat_completions_with_reasoning method. Changes: - Import OpenAIChatCompletionWithReasoning and OpenAIChatCompletionChunkWithReasoning types - Update method signature from `-> None` to `-> OpenAIChatCompletionWithReasoning | AsyncIterator[OpenAIChatCompletionChunkWithReasoning]` to match the InferenceProvider protocol The methods still raise NotImplementedError as these providers don't support reasoning, but now have the correct type annotation for protocol compliance. Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
5399717 to
03a5f2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix mypy strict type checking errors in inline provider files:
Fixed SentenceTransformerEmbeddingMixin.model_store type to match InferenceProvider protocol (ModelStore | None instead of ModelStore)
Fixed eval.py type errors:
cc @leseb