chore: enable mypy type checking for sentence transformers

Fix method signature incompatibilities with InferenceProvider protocol:
 - Update completion() content parameter type to InterleavedContent
 - Reorder chat_completion() parameters to match protocol
 - Add type ignores for mixin inheritance conflicts

Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
This commit is contained in:
Mustafa Elbehery 2025-08-25 14:59:40 +02:00
parent ed418653ec
commit 821d09af3d
3 changed files with 6 additions and 6 deletions

View file

@ -5,13 +5,13 @@
# the root directory of this source tree.
from typing import cast
from typing import Any, cast
from llama_stack.providers.datatypes import AdapterSpec, Api, InlineProviderSpec, ProviderSpec, remote_provider_spec
# We provide two versions of these providers so that distributions can package the appropriate version of torch.
# The CPU version is used for distributions that don't have GPU support -- they result in smaller container images.
torchtune_def = dict(
torchtune_def: dict[str, Any] = dict(
api=Api.post_training,
pip_packages=["numpy"],
module="llama_stack.providers.inline.post_training.torchtune",