Skip to content

feat(agent): add set_suggested_prompts helper#1442

Open
zimeg wants to merge 1 commit intofeat-agent-set-statusfrom
zimeg-feat-agent-set-suggested-prompts
Open

feat(agent): add set_suggested_prompts helper#1442
zimeg wants to merge 1 commit intofeat-agent-set-statusfrom
zimeg-feat-agent-set-suggested-prompts

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Feb 16, 2026

Summary

This PR adds the set_suggest_prompts helper to the Bolt agent argument 👾

Testing

from logging import Logger

from slack_bolt import BoltAgent, Say


def assistant_thread_started(
    say: Say,
    agent: BoltAgent,
    logger: Logger,
):
    """
    Handle the assistant thread start event by greeting the user and setting suggested prompts.

    Args:
        say: Function to send messages to the thread from the app
        set_suggested_prompts: Function to configure suggested prompt options
        logger: Logger instance for error tracking
    """
    try:
        say("What would you like to do today?")
        agent.set_suggested_prompts(
            prompts=[
                {
                    "title": "Prompt a task with thinking steps",
                    "message": "Wonder a few deep thoughts.",
                },
                {
                    "title": "Roll dice for a random number",
                    "message": "Roll two 12-sided dice and three 6-sided dice for a pseudo-random score.",
                },
            ]
        )
    except Exception as e:
        logger.exception(f"Failed to handle an assistant_thread_started event: {e}", e)
        say(f":warning: Something went wrong! ({e})")

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components

Notes

This mirrors an implementation found in context at the moment - I'm uncertain if duplicating this logic is best or what our longterm strategies are for these callsites with assistant classes:

https://github.com/slackapi/bolt-python/tree/main/slack_bolt/context/set_suggested_prompts

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • 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 ./scripts/install_all_and_run_tests.sh after making the changes.

@zimeg zimeg requested review from mwbrooks and srtaalej February 16, 2026 20:05
@zimeg zimeg self-assigned this Feb 16, 2026
@zimeg zimeg requested a review from a team as a code owner February 16, 2026 20:05
@zimeg zimeg added enhancement New feature or request semver:patch experiment Experimental feature documented with ExperimentalWarning and pydoc Experiment section labels Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (a9566a9) to head (956f5f5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                    Coverage Diff                    @@
##           feat-agent-set-status    #1442      +/-   ##
=========================================================
+ Coverage                  90.65%   90.66%   +0.01%     
=========================================================
  Files                        226      226              
  Lines                       7188     7202      +14     
=========================================================
+ Hits                        6516     6530      +14     
  Misses                       672      672              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request experiment Experimental feature documented with ExperimentalWarning and pydoc Experiment section semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant