Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Dec 11, 2025

Summary

This PR introduces the chunks argument to the following methods:

⚠️ This feature is experimental at the moment!

Testing

The following code snippet might be interesting to experiment with:

import time
...

streamer = client.chat_startStream(
    channel=channel_id,
    recipient_team_id=team_id,
    recipient_user_id=user_id,
    thread_ts=thread_ts,
    chunks=[
        MarkdownTextChunk(text="**onwards processing**"),
        TaskUpdateChunk(
            id="12",
            title="counting bytes...",
            status="in_progress",
        ),
    ],
)

time.sleep(4)

client.chat_appendStream(
    channel=channel_id,
    ts=streamer.get("ts"),
    markdown_text="",
    chunks=[
        TaskUpdateChunk(
            id="12",
            title="adding numbers...",
            status="in_progress",
            details="sums have increased",
        )
    ],
)

time.sleep(4)

client.chat_stopStream(
    channel=channel_id,
    ts=streamer.get("ts"),
    chunks=[
        TaskUpdateChunk(
            id="12",
            title="solved equation!",
            status="complete",
            sources=[
                URLSource(
                    url="https://oeis.org",
                    text="The On-Line Encyclopedia of Integer Sequences (OEIS)",
                ),
            ],
        ),
        MarkdownTextChunk(text="that computes."),
    ],
)

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.models (UI component builders)
  • /docs (Documents)
  • tests/integration_tests (Automated tests for this library)

Notes

  • Planning to add tests alongside these methods soon!
  • Unsure if these are the best naming for "models" and I'm open to suggestions!

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@zimeg zimeg requested review from mwbrooks and srtaalej December 11, 2025 02:20
@zimeg zimeg self-assigned this Dec 11, 2025
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor web-client Version: 3x labels Dec 11, 2025
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 82.97872% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.90%. Comparing base (96c0f84) to head (1fb7355).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_sdk/models/messages/chunk.py 77.77% 16 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           feat-ai-apps-thinking-steps    #1806      +/-   ##
===============================================================
- Coverage                        83.91%   83.90%   -0.01%     
===============================================================
  Files                              115      116       +1     
  Lines                            13080    13168      +88     
===============================================================
+ Hits                             10976    11049      +73     
- Misses                            2104     2119      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@srtaalej srtaalej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! except does the helper function not have to change the way it updates the buffer now that we can use chunks instead of markdown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Version: 3x web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants