Skip to content

Commit f26501f

Browse files
committed
Change to property named latest_message_stream
1 parent 6a1bb73 commit f26501f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
* The `ui.Chat()` component also gains the following:
2626
* The `.on_user_submit()` decorator method now passes the user input to the decorated function. This makes it a bit easier to access the user input. See the new templates (mentioned below) for examples. (#1801)
2727
* The assistant icon is now configurable via `ui.chat_ui()` (or the `ui.Chat.ui()` method in Shiny Express) or for individual messages in the `.append_message()` and `.append_message_stream()` methods of `ui.Chat()`. (#1853)
28-
* A new `get_message_stream()` method was added for an easy way to reactively read the stream's status, result, and also cancel an in progress stream. (#1846)
28+
* A new `latest_message_stream` property was added for an easy way to reactively read the stream's status, result, and also cancel an in progress stream. (#1846)
2929
* The `.append_message_stream()` method now returns the `reactive.extended_task` instance that it launches. (#1846)
3030
* The `ui.Chat()` component's `.update_user_input()` method gains `submit` and `focus` options that allow you to submit the input on behalf of the user and to choose whether the input receives focus after the update. (#1851)
3131

shiny/ui/_chat.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,12 @@ async def _handle_error():
673673

674674
return _stream_task
675675

676-
def get_message_stream(self) -> reactive.ExtendedTask[[], str]:
676+
@property
677+
def latest_message_stream(self) -> reactive.ExtendedTask[[], str]:
677678
"""
678679
React to changes in the latest message stream.
679680
680-
Reactively reads for the latest :class:`~shiny.reactive.ExtendedTask` behind the
681+
Reactively reads for the :class:`~shiny.reactive.ExtendedTask` behind the
681682
latest message stream.
682683
683684
From the return value (i.e., the extended task), you can then:
@@ -695,10 +696,9 @@ def get_message_stream(self) -> reactive.ExtendedTask[[], str]:
695696
696697
Note
697698
----
698-
If no stream has yet been started when this method is called, then a "mock" task
699-
is returned. This mock task behaves much like a stream that hasn't yet completed,
700-
except it has a `.status()` of "initial" instead of "running", and `.cancel()`
701-
is a no-op.
699+
If no stream has yet been started when this method is called, then it returns an
700+
extended task with `.status()` of `"initial"` and that it status doesn't change
701+
state until a message is streamed.
702702
"""
703703
return self._latest_stream()
704704

0 commit comments

Comments
 (0)