mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-10 04:08:31 +00:00
update
This commit is contained in:
parent
194d86a232
commit
a715debcb8
4 changed files with 9 additions and 25 deletions
9
docs/_static/llama-stack-spec.html
vendored
9
docs/_static/llama-stack-spec.html
vendored
|
@ -2159,14 +2159,7 @@
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"oneOf": [
|
"$ref": "#/components/schemas/ProviderInfo"
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/ProviderInfo"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
docs/_static/llama-stack-spec.yaml
vendored
4
docs/_static/llama-stack-spec.yaml
vendored
|
@ -1452,9 +1452,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
oneOf:
|
$ref: '#/components/schemas/ProviderInfo'
|
||||||
- $ref: '#/components/schemas/ProviderInfo'
|
|
||||||
- type: 'null'
|
|
||||||
'400':
|
'400':
|
||||||
$ref: '#/components/responses/BadRequest400'
|
$ref: '#/components/responses/BadRequest400'
|
||||||
'429':
|
'429':
|
||||||
|
|
|
@ -33,4 +33,4 @@ class Providers(Protocol):
|
||||||
async def list_providers(self) -> ListProvidersResponse: ...
|
async def list_providers(self) -> ListProvidersResponse: ...
|
||||||
|
|
||||||
@webmethod(route="/providers/{provider_id}", method="GET")
|
@webmethod(route="/providers/{provider_id}", method="GET")
|
||||||
async def inspect_provider(self, provider_id: str) -> Optional[ProviderInfo]: ...
|
async def inspect_provider(self, provider_id: str) -> ProviderInfo: ...
|
||||||
|
|
|
@ -51,17 +51,10 @@ class ProviderImpl(Providers):
|
||||||
|
|
||||||
return ListProvidersResponse(data=ret)
|
return ListProvidersResponse(data=ret)
|
||||||
|
|
||||||
async def inspect_provider(self, provider_id: str) -> Optional[ProviderInfo]:
|
async def inspect_provider(self, provider_id: str) -> ProviderInfo:
|
||||||
run_config = self.config.run_config
|
all_providers = await self.list_providers()
|
||||||
safe_config = StackRunConfig(**redact_sensitive_fields(run_config.model_dump()))
|
for p in all_providers.data:
|
||||||
for api, providers in safe_config.providers.items():
|
if p.provider_id == provider_id:
|
||||||
for p in providers:
|
return p
|
||||||
if p.provider_id == provider_id:
|
|
||||||
return ProviderInfo(
|
|
||||||
api=api,
|
|
||||||
provider_id=p.provider_id,
|
|
||||||
provider_type=p.provider_type,
|
|
||||||
config=p.config,
|
|
||||||
)
|
|
||||||
|
|
||||||
return None
|
raise ValueError(f"Provider {provider_id} not found")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue