mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 12:07:34 +00:00
add safety adapters, configuration handling, server + clients
This commit is contained in:
parent
9dafa6ad94
commit
fe582a739d
13 changed files with 286 additions and 67 deletions
|
@ -15,14 +15,19 @@ from pyopenapi import webmethod
|
|||
|
||||
@json_schema_type
|
||||
class RunShieldRequest(BaseModel):
|
||||
shield_type: ShieldType
|
||||
messages: List[Message]
|
||||
shields: List[ShieldDefinition]
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class RunShieldResponse(BaseModel):
|
||||
responses: List[ShieldResponse]
|
||||
|
||||
|
||||
class Safety(Protocol):
|
||||
|
||||
@webmethod(route="/safety/run_shield")
|
||||
async def run_shield(
|
||||
@webmethod(route="/safety/run_shields")
|
||||
async def run_shields(
|
||||
self,
|
||||
request: RunShieldRequest,
|
||||
) -> ShieldResponse: ...
|
||||
) -> RunShieldResponse: ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue