From 8667b137f6590d188caaf33a6e963261927e8977 Mon Sep 17 00:00:00 2001 From: Botao Chen Date: Tue, 11 Mar 2025 20:46:19 -0700 Subject: [PATCH] refine --- .../providers/remote/inference/passthrough/passthrough.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llama_stack/providers/remote/inference/passthrough/passthrough.py b/llama_stack/providers/remote/inference/passthrough/passthrough.py index eae5c48f0..8f3a0d147 100644 --- a/llama_stack/providers/remote/inference/passthrough/passthrough.py +++ b/llama_stack/providers/remote/inference/passthrough/passthrough.py @@ -159,7 +159,10 @@ class PassthroughInferenceAdapter(Inference): async def _nonstream_chat_completion(self, json_params: Dict[str, Any]) -> ChatCompletionResponse: client = self._get_client() response = await client.inference.chat_completion(**json_params) + response = response.to_dict() + + # temporary hack to remove the metrics from the response response["metrics"] = [] return convert_to_pydantic(ChatCompletionResponse, response) @@ -170,6 +173,8 @@ class PassthroughInferenceAdapter(Inference): async for chunk in stream_response: chunk = chunk.to_dict() + + # temporary hack to remove the metrics from the response chunk["metrics"] = [] chunk = convert_to_pydantic(ChatCompletionResponseStreamChunk, chunk) yield chunk