-
Notifications
You must be signed in to change notification settings - Fork 850
feat: add task_display_mode option to the start of chat streams #1820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zimeg
merged 12 commits into
feat-ai-apps-thinking-steps
from
zimeg-feat-ai-apps-task-display-mode
Jan 17, 2026
+24
−0
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c3bdb2d
feat: accept chunks as arguments to chat.{start,append,stop}Stream me…
zimeg 8c56e22
fix: remove unsupported and unused identifiers for full support
zimeg 783ada5
style: remove mypy extra ignore comment for overriden attributes
zimeg 1fb7355
test: confirm chunks parse as expected json values
zimeg 5de794b
feat: support and flush chunks in the chat stream helper
zimeg 61d6d53
test: dump chunks json before comparison for exact parsings
zimeg 85081e1
test: update async tests to expect chunks when flushing buffer
zimeg a6bb951
style: prefer using markdown text chunks in internal calls
zimeg 92c93e0
fix: support explicit json values as chunk objects
zimeg 7c32814
fix: mirror dictionary chunk option to async streamer
zimeg efb7ba2
feat: add task_display_mode option to the start of chat streams
zimeg 41b068d
chore: merge w base branch
zimeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ def __init__( | |
| buffer_size: int, | ||
| recipient_team_id: Optional[str] = None, | ||
| recipient_user_id: Optional[str] = None, | ||
| task_display_mode: Optional[str] = None, | ||
| **kwargs, | ||
| ): | ||
| """Initialize a new ChatStream instance. | ||
|
|
@@ -44,6 +45,8 @@ def __init__( | |
| recipient_team_id: The encoded ID of the team the user receiving the streaming text belongs to. Required when | ||
| streaming to channels. | ||
| recipient_user_id: The encoded ID of the user to receive the streaming text. Required when streaming to channels. | ||
| task_display_mode: Specifies how tasks are displayed in the message. A "timeline" displays individual tasks | ||
| interleaved with text and "plan" displays all tasks together. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 lgtm |
||
| buffer_size: The length of markdown_text to buffer in-memory before calling a method. Increasing this value | ||
| decreases the number of method calls made for the same amount of text, which is useful to avoid rate limits. | ||
| **kwargs: Additional arguments passed to the underlying API calls. | ||
|
|
@@ -56,6 +59,7 @@ def __init__( | |
| "thread_ts": thread_ts, | ||
| "recipient_team_id": recipient_team_id, | ||
| "recipient_user_id": recipient_user_id, | ||
| "task_display_mode": task_display_mode, | ||
| **kwargs, | ||
| } | ||
| self._buffer = "" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(take it or leave it) we could potentially use enums here, but if it does not fall in line with existing patterns we shouldn't do it
Edit: actually maybe it would be worth having the web API return a proper error message with the possible options if an invalid value is passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I think it's good to expect the API return an error message with the the available options when an invalid option value is passed.
The display modes are aiming to support what's common in LLM UIs, so I imagine there will be more in the future that Slack will want to support. It would be nice for developers to have access to the new modes without upgrading the SDK version (I'm assuming an enum would require an SDK upgrade to support the new options?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilliamBergamin @mwbrooks Oh dang, the tradeoffs are fascinating! 😳
I think I agree letting the API error for invalid values might be best for ongoing maintenance and I hope for now this comment is quick enough to jump to for fast reference. I'll update some notes to avoid using enums in adjacent changes too 📚
Prior art for me was found just above:
python-slack-sdk/slack_sdk/web/client.py
Line 2765 in efb7ba2