mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 17:04:31 +00:00
more idiomatic REST API
This commit is contained in:
parent
d0a25dd453
commit
b438dad8d2
29 changed files with 2144 additions and 1917 deletions
|
|
@ -38,16 +38,20 @@ class ShieldInput(CommonShieldFields):
|
|||
provider_shield_id: Optional[str] = None
|
||||
|
||||
|
||||
class ListShieldsResponse(BaseModel):
|
||||
data: List[Shield]
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
@trace_protocol
|
||||
class Shields(Protocol):
|
||||
@webmethod(route="/shields/list", method="GET")
|
||||
async def list_shields(self) -> List[Shield]: ...
|
||||
@webmethod(route="/shields", method="GET")
|
||||
async def list_shields(self) -> ListShieldsResponse: ...
|
||||
|
||||
@webmethod(route="/shields/get", method="GET")
|
||||
@webmethod(route="/shields/{identifier}", method="GET")
|
||||
async def get_shield(self, identifier: str) -> Optional[Shield]: ...
|
||||
|
||||
@webmethod(route="/shields/register", method="POST")
|
||||
@webmethod(route="/shields", method="POST")
|
||||
async def register_shield(
|
||||
self,
|
||||
shield_id: str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue