Skip to content

Commit 7501ff2

Browse files
PR feedback
1 parent 976fcf5 commit 7501ff2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/content/basic/assistant.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you don't have a paid workspace for development, you can join the [Developer
1010

1111
Agents and assistants comprise a new messaging experience for Slack. If you're unfamiliar with using agents and assistants within Slack, you'll want to read the [API documentation on the subject](https://api.slack.com/docs/apps/ai). Then come back here to implement them with Bolt!
1212

13-
## Configuring your app to support assistants
13+
## Configuring your app to support assistants {#configuring-your-app}
1414

1515
1. Within [App Settings](https://api.slack.com/apps), enable the **Agents & Assistants** feature.
1616

@@ -28,9 +28,9 @@ Agents and assistants comprise a new messaging experience for Slack. If you're u
2828
You _could_ implement your own assistants by [listening](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below). That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you!
2929
:::
3030

31-
## The `Assistant` class instance
31+
## The `Assistant` class instance {#assistant-class}
3232

33-
The `Assistant` can be used to handle the incoming events expected from a user interacting with an assistant in Slack. A typical flow would look like:
33+
The `Assistant` class can be used to handle the incoming events expected from a user interacting with an assistant in Slack. A typical flow would look like:
3434

3535
1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](https://api.slack.com/events/assistant_thread_started) event.
3636
2. [The thread context may change at any point](#handling-thread-context-changes). The Assistant class can handle any incoming [`assistant_thread_context_changed`](https://api.slack.com/events/assistant_thread_context_changed) events. The class also provides a default context store to keep track of thread context changes as the user moves through Slack.
@@ -105,15 +105,15 @@ If you do provide your own `threadContextStore` property, it must feature `get`
105105
Refer to the [module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments.
106106
:::
107107

108-
## Handling a new thread
108+
## Handling a new thread {#handling-a-new-thread}
109109

110110
When the user opens a new thread with your assistant, the [`assistant_thread_started`](https://api.slack.com/events/assistant_thread_started) event will be sent to your app.
111111

112112
:::tip
113113
When a user opens an assistant thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data. You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info.
114114
:::
115115

116-
### Block Kit interactions in the assistant thread
116+
### Block Kit interactions in the assistant thread {#block-kit-interactions}
117117

118118
For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](https://api.slack.com/metadata) to trigger subsequent interactions with the user.
119119

@@ -239,7 +239,7 @@ def respond_to_bot_messages(logger: logging.Logger, set_status: SetStatus, say:
239239
...
240240
```
241241

242-
## Handling thread context changes
242+
## Handling thread context changes {#handling-thread-context-changes}
243243

244244
When the user switches channels, the [`assistant_thread_context_changed`](https://api.slack.com/events/assistant_thread_context_changed) event will be sent to your app.
245245

@@ -254,7 +254,7 @@ from slack_bolt import FileAssistantThreadContextStore
254254
assistant = Assistant(thread_context_store=FileAssistantThreadContextStore())
255255
```
256256

257-
## Handling the user response
257+
## Handling the user response {#handling-the-user-response}
258258

259259
When the user messages your assistant, the [`message.im`](https://api.slack.com/events/message.im) event will be sent to your app.
260260

@@ -282,7 +282,7 @@ def respond_to_user_messages(logger: logging.Logger, set_status: SetStatus, say:
282282
app.use(assistant)
283283
```
284284

285-
## Full example: Assistant Template
285+
## Full example: Assistant Template {#full-example}
286286

287287
Below is the `assistant.py` listener file of the [Assistant Template repo](https://github.com/slack-samples/bolt-python-assistant-template) we've created for you to build off of.
288288

0 commit comments

Comments
 (0)