Skip to content

Commit 0ffc13f

Browse files
authored
feat: make thread_ts optional for assistant.threads.setSuggestedPrompts (#1901)
1 parent e23b181 commit 0ffc13f

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

slack_sdk/web/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,15 +2131,17 @@ async def assistant_threads_setSuggestedPrompts(
21312131
self,
21322132
*,
21332133
channel_id: str,
2134-
thread_ts: str,
2134+
thread_ts: Optional[str] = None,
21352135
title: Optional[str] = None,
21362136
prompts: List[Dict[str, str]],
21372137
**kwargs,
21382138
) -> AsyncSlackResponse:
21392139
"""Set suggested prompts for the given assistant thread.
21402140
https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts
21412141
"""
2142-
kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts})
2142+
kwargs.update({"channel_id": channel_id, "prompts": prompts})
2143+
if thread_ts is not None:
2144+
kwargs.update({"thread_ts": thread_ts})
21432145
if title is not None:
21442146
kwargs.update({"title": title})
21452147
return await self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs)

slack_sdk/web/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,15 +2121,17 @@ def assistant_threads_setSuggestedPrompts(
21212121
self,
21222122
*,
21232123
channel_id: str,
2124-
thread_ts: str,
2124+
thread_ts: Optional[str] = None,
21252125
title: Optional[str] = None,
21262126
prompts: List[Dict[str, str]],
21272127
**kwargs,
21282128
) -> SlackResponse:
21292129
"""Set suggested prompts for the given assistant thread.
21302130
https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts
21312131
"""
2132-
kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts})
2132+
kwargs.update({"channel_id": channel_id, "prompts": prompts})
2133+
if thread_ts is not None:
2134+
kwargs.update({"thread_ts": thread_ts})
21332135
if title is not None:
21342136
kwargs.update({"title": title})
21352137
return self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs)

slack_sdk/web/legacy_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,15 +2132,17 @@ def assistant_threads_setSuggestedPrompts(
21322132
self,
21332133
*,
21342134
channel_id: str,
2135-
thread_ts: str,
2135+
thread_ts: Optional[str] = None,
21362136
title: Optional[str] = None,
21372137
prompts: List[Dict[str, str]],
21382138
**kwargs,
21392139
) -> Union[Future, SlackResponse]:
21402140
"""Set suggested prompts for the given assistant thread.
21412141
https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts
21422142
"""
2143-
kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "prompts": prompts})
2143+
kwargs.update({"channel_id": channel_id, "prompts": prompts})
2144+
if thread_ts is not None:
2145+
kwargs.update({"thread_ts": thread_ts})
21442146
if title is not None:
21452147
kwargs.update({"title": title})
21462148
return self.api_call("assistant.threads.setSuggestedPrompts", json=kwargs)

0 commit comments

Comments
 (0)