From 5f3bda06a4fe436ee948897544a3971170d4d4cb Mon Sep 17 00:00:00 2001 From: Stephan Fitzpatrick Date: Sat, 11 Jan 2025 05:09:36 -0800 Subject: [PATCH] Update version to 4.1.2 and refine stream response handling in .message() method - Bump version number in promptic.py to 4.1.2. - Improve the check for 'stream' in kwargs to enhance response handling for streaming scenarios. - Maintain existing functionality for non-streaming responses. --- promptic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promptic.py b/promptic.py index ff20aaa..801fff1 100644 --- a/promptic.py +++ b/promptic.py @@ -15,7 +15,7 @@ from pydantic import BaseModel from litellm.utils import CustomStreamWrapper -__version__ = "4.1.1" +__version__ = "4.1.2" SystemPrompt = Optional[Union[str, List[str], List[Dict[str, str]]]] @@ -171,7 +171,7 @@ def message(self, message: str, **kwargs): messages = [{"content": message, "role": "user"}] response = self._completion(messages, **kwargs) - if "stream" in self.litellm_kwargs | kwargs: + if (self.litellm_kwargs | kwargs).get("stream"): return self._stream_response(response) else: content = response.choices[0].message.content