Skip to content

Commit 81dfd9f

Browse files
committed
More cleanup
1 parent e386a47 commit 81dfd9f

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5252
* `ui.panel_well()` was deprecated in favor of `ui.card()`. (#2038)
5353

5454
* Numerous `ui.Chat()` features have been deprecated in preparation for future removal to simplify the API (#2050)
55-
* `Chat(messages=)` was deprecated. Use `chat.ui(messages=)` instead.
56-
* `Chat(tokenizer=)` was deprecated. This was only relevant for `.messages(token_limits=[])` which is also now deprecated.
55+
* `Chat(messages=...)` was deprecated. Use `chat.ui(messages=...)` instead.
56+
* `Chat(tokenizer=...)` was deprecated. This is only relevant for `.messages(token_limits=...)` which is also now deprecated.
5757
* All parameters to `.messages()` were deprecated. This reflects an overall change philosophy for maintaining the conversation history sent to the LLM -- `Chat` should no longer be responsible for maintaining it -- another stateful object (perhaps the one provided by chatlas, LangChain, etc.) should be used instead. That said, `.messages()` is still useful if you want to access UI message state.
58-
* The `.transform_user_input` and `.transform_assistant_response` decorators were deprecated. Instead, transformations should be done manually.
59-
* As a result of the previous deprecations, the `transform` parameter in the `.user_input()` method was also deprecated.
58+
* The `.transform_user_input` and `.transform_assistant_response` decorators were deprecated. Instead, transformation of input/responses should be done manually and independently of `Chat`.
59+
* As a result of the previous deprecations, `.user_input(transform=...)` was also deprecated.
6060

6161

6262
## [1.4.0] - 2025-04-08

shiny/ui/_chat.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,13 @@ def __init__(
186186

187187
if messages:
188188
warn_deprecated(
189-
"The `messages` parameter in Chat() is deprecated. "
190-
"Use `.ui(messages=...)` instead for starting messages."
189+
"`Chat(messages=...)` is deprecated. Use `.ui(messages=...)` instead."
191190
)
192191

193192
if tokenizer is not None:
194193
warn_deprecated(
195-
"The `tokenizer` parameter in Chat() is deprecated. "
196-
"Token counting and message trimming features will be removed in a future version."
194+
"`Chat(tokenizer=...)` is deprecated. "
195+
"This is only relevant for `.messages(token_limits=...)` which is also now deprecated."
197196
)
198197

199198
self.id = resolve_id(id)
@@ -485,26 +484,30 @@ def messages(
485484

486485
if not isinstance(format, MISSING_TYPE):
487486
warn_deprecated(
488-
"The `format` parameter in messages() is deprecated. "
489-
"Provider-specific message formatting will be removed in a future version."
487+
"`.messages(format=...)` is deprecated. "
488+
"Provider-specific message formatting will be removed in a future version. "
489+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
490490
)
491491

492492
if token_limits is not None:
493493
warn_deprecated(
494-
"The `token_limits` parameter in messages() is deprecated. "
495-
"Token counting and message trimming features will be removed in a future version."
494+
"`.messages(token_limits=...)` is deprecated. "
495+
"Token counting and message trimming features will be removed in a future version. "
496+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
496497
)
497498

498499
if transform_user != "all":
499500
warn_deprecated(
500-
"The `transform_user` parameter in messages() is deprecated. "
501-
"Message transformation features will be removed in a future version."
501+
"`.messages(transform_user=...)` is deprecated. "
502+
"Message transformation features will be removed in a future version. "
503+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
502504
)
503505

504506
if transform_assistant:
505507
warn_deprecated(
506-
"The `transform_assistant` parameter in messages() is deprecated. "
507-
"Message transformation features will be removed in a future version."
508+
"`.messages(transform_assistant=...)` is deprecated. "
509+
"Message transformation features will be removed in a future version. "
510+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
508511
)
509512

510513
messages = self._messages()
@@ -979,8 +982,9 @@ def transform_user_input(
979982
"""
980983

981984
warn_deprecated(
982-
"The transform_user_input() method is deprecated. "
983-
"User input transformation features will be removed in a future version."
985+
"The `.transform_user_input` decorator is deprecated. "
986+
"User input transformation features will be removed in a future version. "
987+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
984988
)
985989

986990
def _set_transform(fn: TransformUserInput | TransformUserInputAsync):
@@ -1010,8 +1014,9 @@ def transform_assistant_response(
10101014
"""
10111015

10121016
warn_deprecated(
1013-
"The transform_assistant_response() method is deprecated. "
1014-
"Assistant response transformation features will be removed in a future version."
1017+
"The `.transform_assistant_response` decorator is deprecated. "
1018+
"Assistant response transformation features will be removed in a future version. "
1019+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
10151020
)
10161021

10171022
def _set_transform(
@@ -1220,10 +1225,12 @@ def user_input(self, transform: bool = False) -> str | None:
12201225
2. Maintaining message state separately from `.messages()`.
12211226
12221227
"""
1228+
12231229
if transform:
12241230
warn_deprecated(
1225-
"The `transform` parameter in user_input() is deprecated. "
1226-
"User input transformation features will be removed in a future version."
1231+
"`.user_input(transform=...)` is deprecated. "
1232+
"User input transformation features will be removed in a future version. "
1233+
"See this issue for more details: https://github.com/posit-dev/py-shiny/pull/2050"
12271234
)
12281235

12291236
msg = self._latest_user_input()

0 commit comments

Comments
 (0)