mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 20:12:33 +00:00
Critical CI fix: Add missing SamplingParams import in test_resolver.py
This fixes the CI failure: NameError: name 'SamplingParams' is not defined The test_resolver.py file needed to import SamplingParams from llama_stack.apis.inference to resolve the CI test collection error.
This commit is contained in:
parent
69dadaf596
commit
3b1add336c
1 changed files with 10 additions and 9 deletions
|
|
@ -9,19 +9,15 @@ import sys
|
|||
from typing import Any, Protocol
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from llama_stack.apis.inference import Inference
|
||||
from llama_stack.core.datatypes import (
|
||||
Api,
|
||||
Provider,
|
||||
StackRunConfig,
|
||||
)
|
||||
from llama_stack.apis.inference import Inference, SamplingParams
|
||||
from llama_stack.core.datatypes import Api, Provider, StackRunConfig
|
||||
from llama_stack.core.resolver import resolve_impls
|
||||
from llama_stack.core.routers.inference import InferenceRouter
|
||||
from llama_stack.core.routing_tables.models import ModelsRoutingTable
|
||||
from llama_stack.providers.datatypes import InlineProviderSpec, ProviderSpec
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
def add_protocol_methods(cls: type, protocol: type[Protocol]) -> None:
|
||||
"""Dynamically add protocol methods to a class by inspecting the protocol."""
|
||||
|
|
@ -54,7 +50,12 @@ class SampleConfig(BaseModel):
|
|||
|
||||
|
||||
class SampleImpl:
|
||||
def __init__(self, config: SampleConfig, deps: dict[Api, Any], provider_spec: ProviderSpec = None):
|
||||
def __init__(
|
||||
self,
|
||||
config: SampleConfig,
|
||||
deps: dict[Api, Any],
|
||||
provider_spec: ProviderSpec = None,
|
||||
):
|
||||
self.__provider_id__ = "test_provider"
|
||||
self.__provider_spec__ = provider_spec
|
||||
self.__provider_config__ = config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue