Skip to content

Commit 3b1add3

Browse files
author
Omar Abdelwahab
committed
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.
1 parent 69dadaf commit 3b1add3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/unit/server/test_resolver.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@
99
from typing import Any, Protocol
1010
from unittest.mock import AsyncMock, MagicMock
1111

12-
from pydantic import BaseModel, Field
13-
14-
from llama_stack.apis.inference import Inference
15-
from llama_stack.core.datatypes import (
16-
Api,
17-
Provider,
18-
StackRunConfig,
19-
)
12+
from llama_stack.apis.inference import Inference, SamplingParams
13+
from llama_stack.core.datatypes import Api, Provider, StackRunConfig
2014
from llama_stack.core.resolver import resolve_impls
2115
from llama_stack.core.routers.inference import InferenceRouter
2216
from llama_stack.core.routing_tables.models import ModelsRoutingTable
2317
from llama_stack.providers.datatypes import InlineProviderSpec, ProviderSpec
2418

19+
from pydantic import BaseModel, Field
20+
2521

2622
def add_protocol_methods(cls: type, protocol: type[Protocol]) -> None:
2723
"""Dynamically add protocol methods to a class by inspecting the protocol."""
@@ -54,7 +50,12 @@ def sample_run_config(cls, **kwargs: Any) -> dict[str, Any]:
5450

5551

5652
class SampleImpl:
57-
def __init__(self, config: SampleConfig, deps: dict[Api, Any], provider_spec: ProviderSpec = None):
53+
def __init__(
54+
self,
55+
config: SampleConfig,
56+
deps: dict[Api, Any],
57+
provider_spec: ProviderSpec = None,
58+
):
5859
self.__provider_id__ = "test_provider"
5960
self.__provider_spec__ = provider_spec
6061
self.__provider_config__ = config

0 commit comments

Comments
 (0)