Skip to main content

Release: Python SDK v3.45.0

By Steven Van ·

The Python SDK v3.45.0 adds nine Slack Code API methods, including setView for rendering tabs in code channels, plus ContainerBlock support.

The Slack Python SDK v3.45.0 adds support for the Slack Code API methods and the ContainerBlock layout block.

SDK changes

  • Support for the ContainerBlock layout block (container type) and related fields.
  • The TableBlock model in slack_sdk.models.blocks now allows raw_number cells.
  • Support for nine Slack Code API methods: agents.conversations.archive, create, getCanvas, listViews, removeView, setCanvasContent, setCommands, setProperties and setView.

What setView does

agents.conversations.setView creates or updates a view in a code channel. Views let an agent render output such as diffs, plans, dashboards and reports as tabs. In Python the method is app.client.agents_conversations_setView. It needs a granular bot token with the code_channels:manage scope, and special rate limits apply.

The type argument sets the kind of view and defaults to html:

  • html: a full, self-contained HTML document passed as content.
  • diff: raw unified diff text passed as content, in the format git diff produces.
  • block_kit: Block Kit blocks.
  • canvas: a canvas_id.
  • pull_request: a pr_url.

Keys, limits and interactions

Each view is identified by an agent-assigned view_key. The first call for a key creates the content and a channel tab. Later calls with the same key update it in place and bump content_version. A channel can hold up to 5 views, and at most one of them can be a diff. Content is capped at 1,000,000 bytes.

HTML views render in a sandbox with a restricted Content-Security-Policy. The csp argument declares extra https origins, and only resource_domains is honored at render time today. Buttons, selects, datepickers and inputs in a block_kit view work as they do in messages. The owning agent bot receives a block_actions payload when a user interacts with one.

Slack
Slack
The AI work platform — channels, messaging, huddles, and workflow automation that connect your team and tools in one place.
View Slack →
Sources

Original source

Read Release: Python SDK v3.45.0 on Creators Toolbox