Skip to content

feat(models): add BlockChunk type to chat.{start,append,stop}Stream methods - #1872

Merged
srtaalej merged 2 commits into
mainfrom
ale-feat-block-chunks
May 6, 2026
Merged

feat(models): add BlockChunk type to chat.{start,append,stop}Stream methods#1872
srtaalej merged 2 commits into
mainfrom
ale-feat-block-chunks

Conversation

@srtaalej

Copy link
Copy Markdown
Contributor

Summary

This PR adds BlocksChunk model class to support the new blocks chunk type in the streaming API (chat.startStream, chat.appendStream, chat.stopStream). Follows the April 16, 2026 changelog which notes updates to the text-streaming API methods to support streaming blocks.

Testing

Sample app.py
fromslack_sdk.models.blocksimportCardBlock, CarouselBlockfromslack_sdk.models.messages.chunkimportBlocksChunkstreamer=client.chat_stream( channel="C0123456789", thread_ts="1700000001.123456", recipient_team_id="T0123456789", recipient_user_id="U0123456789", ) streamer.append(markdown_text="Here's a **card** streamed via `BlocksChunk`:\n\n") streamer.append( chunks=[ BlocksChunk( blocks=[ CardBlock( title="Streaming Card", subtitle="Sent via BlocksChunk", body="This card was streamed inside a chunks array.", ), ] ), ] ) streamer.stop( chunks=[
BlocksChunk( blocks=[ CarouselBlock( elements=[ CardBlock(title="Card 1", subtitle="First", body="First card in carousel."), CardBlock(title="Card 2", subtitle="Second", body="Second card in carousel."), CardBlock(title="Card 3", subtitle="Third", body="Third card in carousel."), ] ), ] ), ] ) 

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

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.

@srtaalejsrtaalej self-assigned this May 5, 2026
@srtaalej
srtaalej requested a review from a team as a code ownerMay 5, 2026 20:50
@srtaalejsrtaalej added enhancement M-T: A feature request for new functionality semver:minor labels May 5, 2026
@codecov

codecovBot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.13%. Comparing base (73d255a) to head (8b8ab8b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
slack_sdk/models/messages/chunk.py92.30%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #1872 +/- ##
==========================================
+ Coverage 84.09% 84.13% +0.04% 
==========================================
Files 117 117 Lines 13325 13337 +12 ==========================================
+ Hits 11205 11221 +16 + Misses 2120 2116 -4 

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

@srtaalejsrtaalej changed the title feat: add BlockChunk type to chat.{start,append,stop}Stream methodsfeat(models): add BlockChunk type to chat.{start,append,stop}Stream methodsMay 5, 2026

@zimegzimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@srtaalej Nice! LGTM with a note on alphabetics I'd like us to keep pattern for since it makes later finding and additions less difficult I think!

Comment threadslack_sdk/models/messages/chunk.py Outdated
Comment on lines +42 to +43
elif type == BlocksChunk.type:
return BlocksChunk(**chunk)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧮 quibble: Might this be alright to move up for alphabetical ordering to match other entries?

@zimegzimeg added this to the 3.41.1 milestone May 5, 2026
@srtaalej
srtaalej merged commit beecde2 into mainMay 6, 2026
18 checks passed
@srtaalej
srtaalej deleted the ale-feat-block-chunks branch May 6, 2026 14:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementM-T: A feature request for new functionalitysemver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@srtaalej@zimeg