From ac0386ae1f299dc5b528d0df04c61a764df0b8ef Mon Sep 17 00:00:00 2001 From: Coffee Date: Sun, 14 Sep 2025 14:21:57 +0800 Subject: [PATCH] fix: completion chat id --- litellm/litellm_core_utils/streaming_handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index 2e9e6770a1..b6a504031e 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -950,6 +950,8 @@ class CustomStreamWrapper: return def chunk_creator(self, chunk: Any): # type: ignore # noqa: PLR0915 + if hasattr(chunk, 'id'): + self.response_id = chunk.id model_response = self.model_response_creator() response_obj: Dict[str, Any] = {} try: