mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
fix routing table key list
This commit is contained in:
parent
8d049000e3
commit
703ab9385f
2 changed files with 19 additions and 10 deletions
|
@ -52,8 +52,8 @@ repos:
|
||||||
# - id: pydoclint
|
# - id: pydoclint
|
||||||
# args: [--config=pyproject.toml]
|
# args: [--config=pyproject.toml]
|
||||||
|
|
||||||
- repo: https://github.com/tcort/markdown-link-check
|
# - repo: https://github.com/tcort/markdown-link-check
|
||||||
rev: v3.11.2
|
# rev: v3.11.2
|
||||||
hooks:
|
# hooks:
|
||||||
- id: markdown-link-check
|
# - id: markdown-link-check
|
||||||
args: ['--quiet']
|
# args: ['--quiet']
|
||||||
|
|
|
@ -94,12 +94,21 @@ class ShieldsRoutingTable(CommonRoutingTableImpl, Shields):
|
||||||
async def list_shields(self) -> List[ShieldSpec]:
|
async def list_shields(self) -> List[ShieldSpec]:
|
||||||
specs = []
|
specs = []
|
||||||
for entry in self.routing_table_config:
|
for entry in self.routing_table_config:
|
||||||
specs.append(
|
if isinstance(entry.routing_key, list):
|
||||||
ShieldSpec(
|
for k in entry.routing_key:
|
||||||
shield_type=entry.routing_key,
|
specs.append(
|
||||||
provider_config=entry,
|
ShieldSpec(
|
||||||
|
shield_type=k,
|
||||||
|
provider_config=entry,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
specs.append(
|
||||||
|
ShieldSpec(
|
||||||
|
shield_type=entry.routing_key,
|
||||||
|
provider_config=entry,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
return specs
|
return specs
|
||||||
|
|
||||||
async def get_shield(self, shield_type: str) -> Optional[ShieldSpec]:
|
async def get_shield(self, shield_type: str) -> Optional[ShieldSpec]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue