chore: indicate to mypy that InferenceProvider.batch_completion/batch_chat_completion is concrete (#3239)

# What does this PR do?

closes https://github.com/llamastack/llama-stack/issues/3236

mypy considered our default implementations (raise NotImplementedError)
to be trivial. the result was we implemented the same stubs in
providers.

this change puts enough into the default impls so mypy considers them
non-trivial. this allows us to remove the duplicate implementations.
This commit is contained in:
Matthew Farrellee 2025-08-22 16:17:30 -05:00 committed by GitHub
parent 2ee898cc4c
commit 3d119a86d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 89 deletions

View file

@ -1068,6 +1068,7 @@ class InferenceProvider(Protocol):
:returns: A BatchCompletionResponse with the full completions.
"""
raise NotImplementedError("Batch completion is not implemented")
return # this is so mypy's safe-super rule will consider the method concrete
@webmethod(route="/inference/chat-completion", method="POST")
async def chat_completion(
@ -1132,6 +1133,7 @@ class InferenceProvider(Protocol):
:returns: A BatchChatCompletionResponse with the full completions.
"""
raise NotImplementedError("Batch chat completion is not implemented")
return # this is so mypy's safe-super rule will consider the method concrete
@webmethod(route="/inference/embeddings", method="POST")
async def embeddings(