Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 180 additions & 0 deletions docs/reference/index.html
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 note: The docs/reference is autogenerated with the latest code changes. I'll follow up with separate PRs that both requires this and hides these from the preview since regular review ought happen with the comments elsewhere IMHO-

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔐 note: Ongoing discussion is happening for this - #1759.

Original file line number Diff line number Diff line change
Expand Up @@ -3056,6 +3056,69 @@ <h2 class="section-title" id="header-classes">Classes</h2>
kwargs = _remove_none_values(kwargs)
return self.api_call(&#34;chat.stopStream&#34;, json=kwargs)

def chat_stream(
self,
*,
buffer_size: int = 256,
channel: str,
thread_ts: str,
recipient_team_id: Optional[str] = None,
recipient_user_id: Optional[str] = None,
**kwargs,
) -&gt; ChatStream:
&#34;&#34;&#34;Stream markdown text into a conversation.

This method starts a new chat stream in a coversation that can be appended to. After appending an entire message,
the stream can be stopped with concluding arguments such as &#34;blocks&#34; for gathering feedback.

The following methods are used:

- chat.startStream: Starts a new streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.startStream).
- chat.appendStream: Appends text to an existing streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.appendStream).
- chat.stopStream: Stops a streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.stopStream).

Args:
buffer_size: The length of markdown_text to buffer in-memory before calling a method. Increasing this value
decreases the number of method calls made for the same amount of text, which is useful to avoid rate limits.
Default: 256.
channel: An encoded ID that represents a channel, private group, or DM.
thread_ts: Provide another message&#39;s ts value to reply to. Streamed messages should always be replies to a user
request.
recipient_team_id: The encoded ID of the team the user receiving the streaming text belongs to. Required when
streaming to channels.
recipient_user_id: The encoded ID of the user to receive the streaming text. Required when streaming to channels.
**kwargs: Additional arguments passed to the underlying API calls.

Returns:
ChatStream instance for managing the stream

Example:
```python
streamer = client.chat_stream(
channel=&#34;C0123456789&#34;,
thread_ts=&#34;1700000001.123456&#34;,
recipient_team_id=&#34;T0123456789&#34;,
recipient_user_id=&#34;U0123456789&#34;,
)
streamer.append(markdown_text=&#34;**hello wo&#34;)
streamer.append(markdown_text=&#34;rld!**&#34;)
streamer.stop()
```
&#34;&#34;&#34;
return ChatStream(
self,
logger=self._logger,
channel=channel,
thread_ts=thread_ts,
recipient_team_id=recipient_team_id,
recipient_user_id=recipient_user_id,
buffer_size=buffer_size,
**kwargs,
)

def chat_unfurl(
self,
*,
Expand Down Expand Up @@ -10346,6 +10409,122 @@ <h3>Methods</h3>
<div class="desc"><p>Stops a streaming conversation.
<a href="https://api.slack.com/methods/chat.stopStream">https://api.slack.com/methods/chat.stopStream</a></p></div>
</dd>
<dt id="slack_sdk.WebClient.chat_stream"><code class="name flex">
<span>def <span class="ident">chat_stream</span></span>(<span>self,<br>*,<br>buffer_size: int = 256,<br>channel: str,<br>thread_ts: str,<br>recipient_team_id: str | None = None,<br>recipient_user_id: str | None = None,<br>**kwargs) ‑> <a title="slack_sdk.web.chat_stream.ChatStream" href="web/chat_stream.html#slack_sdk.web.chat_stream.ChatStream">ChatStream</a></span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def chat_stream(
self,
*,
buffer_size: int = 256,
channel: str,
thread_ts: str,
recipient_team_id: Optional[str] = None,
recipient_user_id: Optional[str] = None,
**kwargs,
) -&gt; ChatStream:
&#34;&#34;&#34;Stream markdown text into a conversation.

This method starts a new chat stream in a coversation that can be appended to. After appending an entire message,
the stream can be stopped with concluding arguments such as &#34;blocks&#34; for gathering feedback.

The following methods are used:

- chat.startStream: Starts a new streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.startStream).
- chat.appendStream: Appends text to an existing streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.appendStream).
- chat.stopStream: Stops a streaming conversation.
[Reference](https://docs.slack.dev/reference/methods/chat.stopStream).

Args:
buffer_size: The length of markdown_text to buffer in-memory before calling a method. Increasing this value
decreases the number of method calls made for the same amount of text, which is useful to avoid rate limits.
Default: 256.
channel: An encoded ID that represents a channel, private group, or DM.
thread_ts: Provide another message&#39;s ts value to reply to. Streamed messages should always be replies to a user
request.
recipient_team_id: The encoded ID of the team the user receiving the streaming text belongs to. Required when
streaming to channels.
recipient_user_id: The encoded ID of the user to receive the streaming text. Required when streaming to channels.
**kwargs: Additional arguments passed to the underlying API calls.

Returns:
ChatStream instance for managing the stream

Example:
```python
streamer = client.chat_stream(
channel=&#34;C0123456789&#34;,
thread_ts=&#34;1700000001.123456&#34;,
recipient_team_id=&#34;T0123456789&#34;,
recipient_user_id=&#34;U0123456789&#34;,
)
streamer.append(markdown_text=&#34;**hello wo&#34;)
streamer.append(markdown_text=&#34;rld!**&#34;)
streamer.stop()
```
&#34;&#34;&#34;
return ChatStream(
self,
logger=self._logger,
channel=channel,
thread_ts=thread_ts,
recipient_team_id=recipient_team_id,
recipient_user_id=recipient_user_id,
buffer_size=buffer_size,
**kwargs,
)</code></pre>
</details>
<div class="desc"><p>Stream markdown text into a conversation.</p>
<p>This method starts a new chat stream in a coversation that can be appended to. After appending an entire message,
the stream can be stopped with concluding arguments such as "blocks" for gathering feedback.</p>
<p>The following methods are used:</p>
<ul>
<li>chat.startStream: Starts a new streaming conversation.
<a href="https://docs.slack.dev/reference/methods/chat.startStream">Reference</a>.</li>
<li>chat.appendStream: Appends text to an existing streaming conversation.
<a href="https://docs.slack.dev/reference/methods/chat.appendStream">Reference</a>.</li>
<li>chat.stopStream: Stops a streaming conversation.
<a href="https://docs.slack.dev/reference/methods/chat.stopStream">Reference</a>.</li>
</ul>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>buffer_size</code></strong></dt>
<dd>The length of markdown_text to buffer in-memory before calling a method. Increasing this value
decreases the number of method calls made for the same amount of text, which is useful to avoid rate limits.
Default: 256.</dd>
<dt><strong><code>channel</code></strong></dt>
<dd>An encoded ID that represents a channel, private group, or DM.</dd>
<dt><strong><code>thread_ts</code></strong></dt>
<dd>Provide another message's ts value to reply to. Streamed messages should always be replies to a user
request.</dd>
<dt><strong><code>recipient_team_id</code></strong></dt>
<dd>The encoded ID of the team the user receiving the streaming text belongs to. Required when
streaming to channels.</dd>
<dt><strong><code>recipient_user_id</code></strong></dt>
<dd>The encoded ID of the user to receive the streaming text. Required when streaming to channels.</dd>
<dt><strong><code>**kwargs</code></strong></dt>
<dd>Additional arguments passed to the underlying API calls.</dd>
</dl>
<h2 id="returns">Returns</h2>
<p>ChatStream instance for managing the stream</p>
<h2 id="example">Example</h2>
<pre><code class="language-python">streamer = client.chat_stream(
channel=&quot;C0123456789&quot;,
thread_ts=&quot;1700000001.123456&quot;,
recipient_team_id=&quot;T0123456789&quot;,
recipient_user_id=&quot;U0123456789&quot;,
)
streamer.append(markdown_text=&quot;**hello wo&quot;)
streamer.append(markdown_text=&quot;rld!**&quot;)
streamer.stop()
</code></pre></div>
</dd>
<dt id="slack_sdk.WebClient.chat_unfurl"><code class="name flex">
<span>def <span class="ident">chat_unfurl</span></span>(<span>self,<br>*,<br>channel: str | None = None,<br>ts: str | None = None,<br>source: str | None = None,<br>unfurl_id: str | None = None,<br>unfurls: Dict[str, Dict] | None = None,<br>user_auth_blocks: str | Sequence[Dict | <a title="slack_sdk.models.blocks.blocks.Block" href="models/blocks/blocks.html#slack_sdk.models.blocks.blocks.Block">Block</a>] | None = None,<br>user_auth_message: str | None = None,<br>user_auth_required: bool | None = None,<br>user_auth_url: str | None = None,<br>**kwargs) ‑> <a title="slack_sdk.web.slack_response.SlackResponse" href="web/slack_response.html#slack_sdk.web.slack_response.SlackResponse">SlackResponse</a></span>
</code></dt>
Expand Down Expand Up @@ -15323,6 +15502,7 @@ <h4><code><a title="slack_sdk.WebClient" href="#slack_sdk.WebClient">WebClient</
<li><code><a title="slack_sdk.WebClient.chat_scheduledMessages_list" href="#slack_sdk.WebClient.chat_scheduledMessages_list">chat_scheduledMessages_list</a></code></li>
<li><code><a title="slack_sdk.WebClient.chat_startStream" href="#slack_sdk.WebClient.chat_startStream">chat_startStream</a></code></li>
<li><code><a title="slack_sdk.WebClient.chat_stopStream" href="#slack_sdk.WebClient.chat_stopStream">chat_stopStream</a></code></li>
<li><code><a title="slack_sdk.WebClient.chat_stream" href="#slack_sdk.WebClient.chat_stream">chat_stream</a></code></li>
<li><code><a title="slack_sdk.WebClient.chat_unfurl" href="#slack_sdk.WebClient.chat_unfurl">chat_unfurl</a></code></li>
<li><code><a title="slack_sdk.WebClient.chat_update" href="#slack_sdk.WebClient.chat_update">chat_update</a></code></li>
<li><code><a title="slack_sdk.WebClient.conversations_acceptSharedInvite" href="#slack_sdk.WebClient.conversations_acceptSharedInvite">conversations_acceptSharedInvite</a></code></li>
Expand Down
Loading
Loading