mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
revert: do not use MySecretStr
We don't need this if we can set it to empty string. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
bc64635835
commit
2a34226727
86 changed files with 208 additions and 263 deletions
|
@ -8,20 +8,19 @@ import json
|
|||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, Field, SecretStr
|
||||
|
||||
from llama_stack.core.request_headers import request_provider_data_context
|
||||
from llama_stack.core.secret_types import MySecretStr
|
||||
from llama_stack.providers.utils.inference.litellm_openai_mixin import LiteLLMOpenAIMixin
|
||||
|
||||
|
||||
# Test fixtures and helper classes
|
||||
class TestConfig(BaseModel):
|
||||
api_key: MySecretStr | None = Field(default=None)
|
||||
api_key: SecretStr | None = Field(default=None)
|
||||
|
||||
|
||||
class TestProviderDataValidator(BaseModel):
|
||||
test_api_key: MySecretStr | None = Field(default=None)
|
||||
test_api_key: SecretStr | None = Field(default=None)
|
||||
|
||||
|
||||
class TestLiteLLMAdapter(LiteLLMOpenAIMixin):
|
||||
|
@ -37,7 +36,7 @@ class TestLiteLLMAdapter(LiteLLMOpenAIMixin):
|
|||
@pytest.fixture
|
||||
def adapter_with_config_key():
|
||||
"""Fixture to create adapter with API key in config"""
|
||||
config = TestConfig(api_key=MySecretStr("config-api-key"))
|
||||
config = TestConfig(api_key=SecretStr("config-api-key"))
|
||||
adapter = TestLiteLLMAdapter(config)
|
||||
adapter.__provider_spec__ = MagicMock()
|
||||
adapter.__provider_spec__.provider_data_validator = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue