Releases: slackapi/bolt-python
version 1.23.0
Changes
fixes 🏗️
- fix: honor passing bolt logger in default web client installation by @WilliamBergamin in #1272
- test: fix broken tests due to wild card import by @WilliamBergamin in #1240
- fix: configure dependabot to group react deps by @WilliamBergamin in #1263
- test: add tests around the logger experience of bolt by @WilliamBergamin in #1270
docs 📚
- docs: Syncing config files with Deno Slack SDK and Slack CLI docs by @slackapi in #1228
- docs - nested sidebar by @lukegalbraithrussell in #1230
- docs: fix broken link to the WebClient by @WilliamBergamin in #1235
- docs: Update Bolt Python Assistant doc to match JS structure. by @technically-tracy in #1239
- docs: reorganizes nav to match Bolt JS style by @lukegalbraithrussell in #1241
- docs: Reorganize nav to match Bolt JS follow-up. by @technically-tracy in #1242
- docs: fix broken link in commands.md by @WilliamBergamin in #1248
- docs: Move Modals tutorial to Bolt for Python site. by @technically-tracy in #1250
- docs: Migrate custom steps tutorials. by @technically-tracy in #1253
- docs: remove mention of assistants and replace with AI apps by @haleychaas in #1254
- docs: matches site css to slack.dev and docs.slack.dev by @slackapi in #1256
- docs: fixes broken apps navbar link by @slackapi in #1264
- docs: Update reference to "Concepts guides". by @technically-tracy in #1266
- docs: update packaging notation for local development requirements by @zimeg in #1271
dependabot 
- chore(deps): bump mypy from 1.13.0 to 1.14.1 by @dependabot in #1234
- chore(deps): bump prism-react-renderer from 2.4.0 to 2.4.1 in /docs by @dependabot in #1232
- chore(deps): update sanic requirement from <24,>=22 to >=22,<25 by @dependabot in #1233
- chore(deps): bump actions/stale from 9.0.0 to 9.1.0 by @dependabot in #1244
- chore(deps): bump the docusaurus group in /docs with 5 updates by @dependabot in #1243
- chore(deps): bump mypy from 1.14.1 to 1.15.0 by @dependabot in #1258
- chore(deps): update websockets requirement from <15 to <16 by @dependabot in #1260
- chore(deps): bump flake8 from 6.0.0 to 7.1.2 by @dependabot in #1259
- chore(deps): bump the react group in /docs with 2 updates by @dependabot in #1265
- chore(deps): bump prismjs from 1.29.0 to 1.30.0 in /docs by @dependabot in #1269
- chore(deps): bump @babel/runtime from 7.26.0 to 7.26.10 in /docs by @dependabot in #1275
- chore(deps): bump @babel/helpers from 7.26.0 to 7.26.10 in /docs by @dependabot in #1273
- chore(deps): bump @babel/runtime-corejs3 from 7.26.9 to 7.26.10 in /docs by @dependabot in #1274
Relevant changes
We've fixed a regression around the logger
, by default the logger used by the WebClient
will be the same as the one used by the Bolt application. If the WebClient
defines its own logger then it will be used:
my_logger = logging.Logger("my_logger")
app = App(client=WebClient(token=os.environ.get("SLACK_BOT_TOKEN"), logger=my_logger))
@app.command("/sample-command")
def sample_command(ack: Ack, client: WebClient):
ack()
assert client.logger.name == my_logger.name
New Contributors
- @haleychaas made their first contribution in #1254
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/91?closed=1
- All Diff: v1.22.0...v1.23.0
version 1.22.0
Changes
- docs: Custom steps for JIRA tutorial. by @technically-tracy in #1214
- feat: support python 3.13 by @WilliamBergamin in #1221
- docs(examples): update aws lambda tooling and iam role names by @zimeg in #1224
- chore: improve maintainers docs by @WilliamBergamin in #1226
Dependabot
- chore(deps): bump path-to-regexp and express in /docs by @dependabot in #1218
- chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /docs by @dependabot in #1223
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/90?closed=1
- All Diff: v1.21.3...v1.22.0
version 1.21.3
Changes
- #1187 Add title argument to SetSuggestedPrompts arguments - Thanks @seratch
- #1216 Expose loop param on asyncio-based AsyncSocketModeHandler - Thanks @jantman
- #1202 Socket Mode: Failed to connect (error: string argument without an encoding) w/ Azure App Service + aiohttp 3.11.2 - Thanks @seratch @jeremybeeman
- #1199 Resolve Falcon 5.x type hint compatibility issue - Thanks @seratch
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/89?closed=1
- All Diff: v1.21.2...v1.21.3
version 1.21.2
Changes
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/88?closed=1
- All Diff: v1.21.1...v1.21.2
version 1.21.1
Changes
- #1184 Fix a bug where parsing assistant thread message event fails for beta feature enabled apps - Thanks @seratch
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/87?closed=1
- All Diff: v1.21.0...v1.21.1
version 1.21.0
New Features
Agents & Assistants
A better Agents & Assistants support in Bolt is now available!
While you already can implement your agents using app.event(...)
listeners for assistant_thread_started
, assistant_thread_context_changed
, and message
events, Bolt offers a simpler approach. You just need to create an Assistant
instance, attach the needed event handlers to it, and then add the assistant to your App
instance.
assistant = Assistant()
# This listener is invoked when a human user opened an assistant thread
@assistant.thread_started
def start_assistant_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts):
# Send the first reply to the human who started chat with your app's assistant bot
say(":wave: Hi, how can I help you today?")
# Setting suggested prompts is optional
set_suggested_prompts(
prompts=[
# If the suggested prompt is long, you can use {"title": "short one to display", "message": "full prompt"} instead
"What does SLACK stand for?",
"When Slack was released?",
],
)
# This listener is invoked when the human user sends a reply in the assistant thread
@assistant.user_message
def respond_in_assistant_thread(
payload: dict,
logger: logging.Logger,
context: BoltContext,
set_status: SetStatus,
say: Say,
client: WebClient,
):
try:
# Tell the human user the assistant bot acknowledges the request and is working on it
set_status("is typing...")
# Collect the conversation history with this user
replies_in_thread = client.conversations_replies(
channel=context.channel_id,
ts=context.thread_ts,
oldest=context.thread_ts,
limit=10,
)
messages_in_thread: List[Dict[str, str]] = []
for message in replies_in_thread["messages"]:
role = "user" if message.get("bot_id") is None else "assistant"
messages_in_thread.append({"role": role, "content": message["text"]})
# Pass the latest prompt and chat history to the LLM (call_llm is your own code)
returned_message = call_llm(messages_in_thread)
# Post the result in the assistant thread
say(text=returned_message)
except Exception as e:
logger.exception(f"Failed to respond to an inquiry: {e}")
# Don't forget sending a message telling the error
# Without this, the status 'is typing...' won't be cleared, therefore the end-user is unable to continue the chat
say(f":warning: Sorry, something went wrong during processing your request (error: {e})")
# Enable this assistant middleware in your Bolt app
app.use(assistant)
Please refer to https://tools.slack.dev/bolt-python/concepts/assistant/ and https://github.com/slack-samples/bolt-python-assistant-template for more details.
Changes
- #1162 Add Agents & Assistants support - Thanks @seratch
- #1142 Add listener_runner to context object to enable developers to leverage lazy listeners in middleware - Thanks @seratch
- #1170 Fix double quoted img alt text in the default OAuth page rendering - @toofishes
- #1173 Expose
auto_acknowledge
option for custom function handlers - Thanks @WilliamBergamin - #1143 Remove
Optional
typing ofcontext.client
- Thanks @WilliamBergamin - #1164 Simplify Python code snippets in authorization.md - Thanks @arkid15r
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/86?closed=1
- All Diff: v1.20.1...v1.21.0
version 1.20.1
Changes
- bug: Fix #1131, async classes with "__call__" method are now accepted as middleware by @seratch in #1132
- health: Use the mypy type analyzer by @WilliamBergamin in #1130
- feat: Add option for additional context to Sanic adapter handler by @RohanArepally in #1135
- chore: naming of is_coroutine_function by @WilliamBergamin in #1134
- chore: version 1.20.1 by @WilliamBergamin in #1137
New Contributors
- @RohanArepally made their first contribution in #1135
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/83?closed=1
- All Diff: v1.20.0...v1.20.1
version 1.20.0
Changes
Support for custom steps
- feat: add custom step support by @WilliamBergamin in #1021
- docs: document custom step usage by @WilliamBergamin in #1125
Documentation
- docs: adds Docusaurus site by @lukegalbraithrussell in #1113
- docs: sidebar reference link needs to be full URL by @lukegalbraithrussell in #1117
- docs: docusaurus migration nits by @lukegalbraithrussell in #1118
- docs: google analytics tag by @lukegalbraithrussell in #1123
- docs: document custom step usage by @WilliamBergamin in #1125
- chore: purge the "workflow step" terminology by @WilliamBergamin in #1124
Speed up tests
- chore: improve unit test speed by @WilliamBergamin in #1109
Dependencies
- Update pytest requirement from <8.2,>=6.2.5 to >=6.2.5,<8.4 by @dependabot in #1116
Misc
- chore: version 1.20.0 by @WilliamBergamin in #1128
New Contributors
- @lukegalbraithrussell made their first contribution in #1113
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/84?closed=1
- All Diff: v1.19.1...v1.20.0
version 1.19.1
Changes
- #1104 Add bot|user_scopes to context.authorize_result set by SingleTeamAuthorization - Thanks @seratch
References
- Release Milestone: https://github.com/slackapi/bolt-python/milestone/84?closed=1
- All Diff: v1.19.0...v1.19.1
version 1.19.0
New Features
WSGI Adapter
#1085 by @WilliamBergamin introduces an WSGI adapter, this allows bolt to be deployed in production without the need of a 3rd party WSGI compatible web framework. check out the examples in examples/wsgi
Deprecate Steps From Apps
#1089 by @WilliamBergamin adds deprecation warnings to Steps from Apps components and documentation.
What's Changed
Fixes
- Fix typo in ja_listening_events.md by @johtani in #1022
- Fix #1074 Customize user-facing message sent when an installation is not managed by bolt-python app by @seratch in #1077
Tests
- Improve socket mode tests by @WilliamBergamin in #991
- remove unused multiprocessing test mode by @WilliamBergamin in #1011
- Replace Flask-Sockets with aiohttp for testing by @WilliamBergamin in #1012
- feat: improve test speed by @WilliamBergamin in #1017
Dependabot
- Bump actions/checkout from 3 to 4 by @dependabot in #1038
- Bump actions/setup-python from 4 to 5 by @dependabot in #1040
- Bump actions/stale from 4.0.0 to 9.0.0 by @dependabot in #1042
- Update werkzeug requirement from <3,>=2 to >=2,<4 by @dependabot in #1041
- Update pytest requirement from <7,>=6.2.5 to >=6.2.5,<9 by @dependabot in #1043
- Update flask requirement from <3,>=1 to >=1,<4 by @dependabot in #1044
- Update gunicorn requirement from <21,>=20 to >=20,<22 by @dependabot in #1045
- Update moto requirement from <5,>=3 to >=3,<6 by @dependabot in #1046
- Bump codecov/codecov-action from 3 to 4 by @dependabot in #1039
- Update django requirement from <5,>=3 to >=3,<6 by @dependabot in #1051
- Update docker requirement from <6,>=5 to >=5,<8 by @dependabot in #1052
- Update websockets requirement from <11 to <13 by @dependabot in #1054
- Update sanic requirement from <23,>=22 to >=22,<24 by @dependabot in #1055
- Update click requirement from <=8.0.4 to <=8.1.7 by @dependabot in #1057
- Update pytest-cov requirement from <5,>=3 to >=3,<6 by @dependabot in #1067
- Update gunicorn requirement from <22,>=20 to >=20,<23 by @dependabot in #1073
Misc
- Configuring with pyproject.toml by @WilliamBergamin in #996
- Maintain metadata by @WilliamBergamin in #999
- feat: use dependabot to maintain packages by @WilliamBergamin in #1037
- release: version 1.19.0 by @WilliamBergamin in #1091
New Contributors
- @johtani made their first contribution in #1022
- @dependabot made their first contribution in #1038
Full Changelog: v1.18.1...v1.19.0