Skip to content

Commit

Permalink
Update version to 4.1.2 and refine stream response handling in .messa…
Browse files Browse the repository at this point in the history
…ge() 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.
  • Loading branch information
knowsuchagency committed Jan 11, 2025
1 parent f1f244a commit 5f3bda0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions promptic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]]

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f3bda0

Please sign in to comment.