This commit is contained in:
Xi Yan 2025-03-13 17:14:45 -07:00
parent 9347a646db
commit 2d1cebad88

View file

@ -4,14 +4,11 @@
# This source code is licensed under the terms described in the LICENSE file in # This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree. # the root directory of this source tree.
from typing import Optional
from pydantic import BaseModel from pydantic import BaseModel
from llama_stack.apis.providers import ( from llama_stack.apis.providers import ListProvidersResponse, ProviderInfo, Providers
GetProviderResponse,
ListProvidersResponse,
ProviderInfo,
Providers,
)
from .datatypes import StackRunConfig from .datatypes import StackRunConfig
from .stack import redact_sensitive_fields from .stack import redact_sensitive_fields
@ -52,7 +49,7 @@ class ProviderImpl(Providers):
return ListProvidersResponse(data=ret) return ListProvidersResponse(data=ret)
async def inspect_provider(self, provider_id: str) -> GetProviderResponse: async def inspect_provider(self, provider_id: str) -> Optional[ProviderInfo]:
run_config = self.config.run_config run_config = self.config.run_config
safe_config = StackRunConfig(**redact_sensitive_fields(run_config.model_dump())) safe_config = StackRunConfig(**redact_sensitive_fields(run_config.model_dump()))
for api, providers in safe_config.providers.items(): for api, providers in safe_config.providers.items():