mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 18:02:40 +00:00
tracing for APIs
This commit is contained in:
parent
c2a4850a79
commit
af8a1fe5b3
8 changed files with 126 additions and 63 deletions
|
|
@ -21,7 +21,7 @@ from llama_models.schema_utils import json_schema_type, webmethod
|
|||
from pydantic import BaseModel, Field
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from llama_stack.distribution.tracing import trace_protocol
|
||||
from llama_stack.distribution.tracing import trace_protocol, traced
|
||||
|
||||
from llama_models.llama3.api.datatypes import * # noqa: F403
|
||||
from llama_stack.apis.models import * # noqa: F403
|
||||
|
|
@ -227,6 +227,7 @@ class Inference(Protocol):
|
|||
model_store: ModelStore
|
||||
|
||||
@webmethod(route="/inference/completion")
|
||||
@traced(input="content")
|
||||
async def completion(
|
||||
self,
|
||||
model_id: str,
|
||||
|
|
@ -238,6 +239,7 @@ class Inference(Protocol):
|
|||
) -> Union[CompletionResponse, AsyncIterator[CompletionResponseStreamChunk]]: ...
|
||||
|
||||
@webmethod(route="/inference/chat-completion")
|
||||
@traced(input="messages")
|
||||
async def chat_completion(
|
||||
self,
|
||||
model_id: str,
|
||||
|
|
@ -255,6 +257,7 @@ class Inference(Protocol):
|
|||
]: ...
|
||||
|
||||
@webmethod(route="/inference/embeddings")
|
||||
@traced(input="contents")
|
||||
async def embeddings(
|
||||
self,
|
||||
model_id: str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue