feat: add tracing to streaming interface (#2477)
This commit is contained in:
@@ -11,6 +11,7 @@ from letta.schemas.message import Message
|
||||
from letta.schemas.openai.chat_completion_response import FunctionCall, ToolCall
|
||||
from letta.server.rest_api.json_parser import OptimisticJSONParser
|
||||
from letta.streaming_utils import JSONInnerThoughtsExtractor
|
||||
from letta.tracing import trace_method
|
||||
|
||||
|
||||
class OpenAIStreamingInterface:
|
||||
@@ -64,6 +65,7 @@ class OpenAIStreamingInterface:
|
||||
function=FunctionCall(arguments=self.current_function_arguments, name=function_name),
|
||||
)
|
||||
|
||||
@trace_method
|
||||
async def process(self, stream: AsyncStream[ChatCompletionChunk]) -> AsyncGenerator[LettaMessage, None]:
|
||||
"""
|
||||
Iterates over the OpenAI stream, yielding SSE events.
|
||||
|
||||
Reference in New Issue
Block a user