mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 16:02:39 +00:00
tracing for APIs
This commit is contained in:
parent
c2a4850a79
commit
af8a1fe5b3
8 changed files with 126 additions and 63 deletions
|
|
@ -10,6 +10,8 @@ from typing import Any, Dict, List, Protocol, runtime_checkable
|
|||
from llama_models.schema_utils import json_schema_type, webmethod
|
||||
from pydantic import BaseModel
|
||||
|
||||
from llama_stack.distribution.tracing import trace_protocol, traced
|
||||
|
||||
from llama_models.llama3.api.datatypes import * # noqa: F403
|
||||
from llama_stack.apis.shields import * # noqa: F403
|
||||
|
||||
|
|
@ -43,10 +45,12 @@ class ShieldStore(Protocol):
|
|||
|
||||
|
||||
@runtime_checkable
|
||||
@trace_protocol
|
||||
class Safety(Protocol):
|
||||
shield_store: ShieldStore
|
||||
|
||||
@webmethod(route="/safety/run-shield")
|
||||
@traced(input="messages")
|
||||
async def run_shield(
|
||||
self,
|
||||
shield_id: str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue