From 5df6dae5c98cf67c5ac97084f7e32bd9a00d400e Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 29 Jun 2026 15:26:01 -0700 Subject: [PATCH] feat: make thread_ts optional for assistant.threads.setSuggestedPrompts The thread_ts argument is no longer required by the API. In the Messages tab agent experience, suggested prompts live at the top of the Messages tab rather than within a thread, so a thread_ts is not needed. Defaults thread_ts to None across the sync, async, and legacy WebClient and only sends it when provided. --- slack_sdk/web/async_client.py | 6 ++++-- slack_sdk/web/client.py | 6 ++++-- slack_sdk/web/legacy_client.py | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/slack_sdk/web/async_client.py b/slack_sdk/web/async_client.py index 79293d8b9..0458b14c4 100644 --- a/slack_sdk/web/async_client.py +++ b/slack_sdk/web/async_client.py @@ -2131,7 +2131,7 @@ async def assistant_threads_setSuggestedPrompts( self, *, channel_id: str, - thread_ts: str, + thread_ts: Optional[str] = None, title: Optional[str] = None, prompts: List[Dict[str, str]], **kwargs, @@ -2139,7 +2139,9 @@ async def assistant_threads_setSuggestedPrompts( """Set suggested prompts for the given assistant thread. https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ - kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts}) + kwargs.update({"channel_id": channel_id, "prompts": prompts}) + if thread_ts is not None: + kwargs.update({"thread_ts": thread_ts}) if title is not None: kwargs.update({"title": title}) return await self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs) diff --git a/slack_sdk/web/client.py b/slack_sdk/web/client.py index 4c597c2df..967713b4e 100644 --- a/slack_sdk/web/client.py +++ b/slack_sdk/web/client.py @@ -2121,7 +2121,7 @@ def assistant_threads_setSuggestedPrompts( self, *, channel_id: str, - thread_ts: str, + thread_ts: Optional[str] = None, title: Optional[str] = None, prompts: List[Dict[str, str]], **kwargs, @@ -2129,7 +2129,9 @@ def assistant_threads_setSuggestedPrompts( """Set suggested prompts for the given assistant thread. https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ - kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts}) + kwargs.update({"channel_id": channel_id, "prompts": prompts}) + if thread_ts is not None: + kwargs.update({"thread_ts": thread_ts}) if title is not None: kwargs.update({"title": title}) return self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs) diff --git a/slack_sdk/web/legacy_client.py b/slack_sdk/web/legacy_client.py index afc4e4f64..ccbd09666 100644 --- a/slack_sdk/web/legacy_client.py +++ b/slack_sdk/web/legacy_client.py @@ -2132,7 +2132,7 @@ def assistant_threads_setSuggestedPrompts( self, *, channel_id: str, - thread_ts: str, + thread_ts: Optional[str] = None, title: Optional[str] = None, prompts: List[Dict[str, str]], **kwargs, @@ -2140,7 +2140,9 @@ def assistant_threads_setSuggestedPrompts( """Set suggested prompts for the given assistant thread. https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ - kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts}) + kwargs.update({"channel_id": channel_id, "prompts": prompts}) + if thread_ts is not None: + kwargs.update({"thread_ts": thread_ts}) if title is not None: kwargs.update({"title": title}) return self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs)