Skip to content

Commit 3a85cd5

Browse files
adds experiments page
1 parent 0492aa0 commit 3a85cd5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/english/experiments.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Experiments
2+
3+
Bolt for Python includes experimental features still under active development. These features may be fleeting, may not be perfectly polished, and should be thought of as available for use "at your own risk."
4+
5+
Experimental features are categorized as `semver:patch` until the experimental status is removed.
6+
7+
We love feedback from our community, so we encourage you to explore and interact with the [GitHub repo](https://github.com/slackapi/bolt-python). Contributions, bug reports, and any feedback are all helpful; let us nurture the Slack CLI together to help make building Slack apps more pleasant for everyone.
8+
9+
## Available experiments
10+
* [Agent listener argument](#agent)
11+
12+
## Agent listener argument {#agent}
13+
14+
The `agent: BoltAgent` listener argument provides access to AI agent-related features.
15+
16+
The `BoltAgent` and `AsyncBoltAgent` classes offer a `chat_stream()` method that comes pre-configured with event context defaults: `channel_id`, `thread_ts`, `team_id`, and `user_id` fields.
17+
18+
The listener argument is wired into the Bolt `kwargs` injection system, so listeners can declare it as a parameter or access it via the `context.agent` property.
19+
20+
### Example
21+
22+
```python
23+
from slack_bolt import BoltAgent
24+
25+
@app.event("app_mention")
26+
def handle_mention(agent: BoltAgent):
27+
stream = agent.chat_stream()
28+
stream.append(markdown_text="Hello!")
29+
stream.stop()
30+
```
31+
32+
### Limitations
33+
34+
The `chat_stream()` method currently only works when the `thread_ts` field is available in the event context (DMs and threaded replies). Top-level channel messages do not have a `thread_ts` field, and the `ts` field is not yet provided to `BoltAgent`.

0 commit comments

Comments
 (0)