Skip to content

Commit 187c719

Browse files
committed
fix: improve docs to match arguments with better testing
1 parent 03566bd commit 187c719

15 files changed

Lines changed: 642 additions & 424 deletions

docs/reference/index.html

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,29 +3038,28 @@ <h2 class="section-title" id="header-classes">Classes</h2>
30383038
thread_ts: str,
30393039
recipient_team_id: Optional[str] = None,
30403040
recipient_user_id: Optional[str] = None,
3041-
unfurl_links: Optional[bool] = None,
3042-
unfurl_media: Optional[bool] = None,
30433041
**kwargs,
30443042
) -&gt; ChatStream:
30453043
&#34;&#34;&#34;Stream markdown text into a conversation.
30463044

3047-
This method provides an easy way to stream markdown text using the following endpoints:
3048-
- chat.startStream: Starts a new streaming conversation
3049-
- chat.appendStream: Appends text to an existing streaming conversation
3050-
- chat.stopStream: Stops a streaming conversation
3045+
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.
3046+
3047+
The following methods are used:
3048+
3049+
- chat.startStream: Starts a new streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.startStream).
3050+
- chat.appendStream: Appends text to an existing streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.appendStream).
3051+
- chat.stopStream: Stops a streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.stopStream).
30513052

30523053
Args:
3053-
buffer_size: Size of the internal buffer before automatically flushing (default: 256)
3054-
channel: Channel to stream to
3055-
thread_ts: Thread timestamp to stream to (required)
3056-
recipient_team_id: Team ID of the recipient (for Slack Connect)
3057-
recipient_user_id: User ID of the recipient (for Slack Connect)
3058-
unfurl_links: Whether to unfurl links
3059-
unfurl_media: Whether to unfurl media
3060-
**kwargs: Additional arguments passed to the underlying API calls
3054+
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.
3055+
channel: An encoded ID that represents a channel, private group, or DM.
3056+
thread_ts: Provide another message&#39;s ts value to reply to. Streamed messages should always be replies to a user request.
3057+
recipient_team_id: The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.
3058+
recipient_user_id: The encoded ID of the user to receive the streaming text. Required when streaming to channels.
3059+
**kwargs: Additional arguments passed to the underlying API calls.
30613060

30623061
Returns:
3063-
ChatStreamer instance for managing the stream
3062+
ChatStream instance for managing the stream
30643063

30653064
Example:
30663065
```python
@@ -3082,8 +3081,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
30823081
thread_ts=thread_ts,
30833082
recipient_team_id=recipient_team_id,
30843083
recipient_user_id=recipient_user_id,
3085-
unfurl_links=unfurl_links,
3086-
unfurl_media=unfurl_media,
30873084
buffer_size=buffer_size,
30883085
**kwargs,
30893086
)
@@ -10405,7 +10402,7 @@ <h3>Methods</h3>
1040510402
<a href="https://api.slack.com/methods/chat.stopStream">https://api.slack.com/methods/chat.stopStream</a></p></div>
1040610403
</dd>
1040710404
<dt id="slack_sdk.WebClient.chat_stream"><code class="name flex">
10408-
<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>unfurl_links: bool | None = None,<br>unfurl_media: bool | 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>
10405+
<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>
1040910406
</code></dt>
1041010407
<dd>
1041110408
<details class="source">
@@ -10420,29 +10417,28 @@ <h3>Methods</h3>
1042010417
thread_ts: str,
1042110418
recipient_team_id: Optional[str] = None,
1042210419
recipient_user_id: Optional[str] = None,
10423-
unfurl_links: Optional[bool] = None,
10424-
unfurl_media: Optional[bool] = None,
1042510420
**kwargs,
1042610421
) -&gt; ChatStream:
1042710422
&#34;&#34;&#34;Stream markdown text into a conversation.
1042810423

10429-
This method provides an easy way to stream markdown text using the following endpoints:
10430-
- chat.startStream: Starts a new streaming conversation
10431-
- chat.appendStream: Appends text to an existing streaming conversation
10432-
- chat.stopStream: Stops a streaming conversation
10424+
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.
10425+
10426+
The following methods are used:
10427+
10428+
- chat.startStream: Starts a new streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.startStream).
10429+
- chat.appendStream: Appends text to an existing streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.appendStream).
10430+
- chat.stopStream: Stops a streaming conversation. [Reference](https://docs.slack.dev/reference/methods/chat.stopStream).
1043310431

1043410432
Args:
10435-
buffer_size: Size of the internal buffer before automatically flushing (default: 256)
10436-
channel: Channel to stream to
10437-
thread_ts: Thread timestamp to stream to (required)
10438-
recipient_team_id: Team ID of the recipient (for Slack Connect)
10439-
recipient_user_id: User ID of the recipient (for Slack Connect)
10440-
unfurl_links: Whether to unfurl links
10441-
unfurl_media: Whether to unfurl media
10442-
**kwargs: Additional arguments passed to the underlying API calls
10433+
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.
10434+
channel: An encoded ID that represents a channel, private group, or DM.
10435+
thread_ts: Provide another message&#39;s ts value to reply to. Streamed messages should always be replies to a user request.
10436+
recipient_team_id: The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.
10437+
recipient_user_id: The encoded ID of the user to receive the streaming text. Required when streaming to channels.
10438+
**kwargs: Additional arguments passed to the underlying API calls.
1044310439

1044410440
Returns:
10445-
ChatStreamer instance for managing the stream
10441+
ChatStream instance for managing the stream
1044610442

1044710443
Example:
1044810444
```python
@@ -10464,38 +10460,35 @@ <h3>Methods</h3>
1046410460
thread_ts=thread_ts,
1046510461
recipient_team_id=recipient_team_id,
1046610462
recipient_user_id=recipient_user_id,
10467-
unfurl_links=unfurl_links,
10468-
unfurl_media=unfurl_media,
1046910463
buffer_size=buffer_size,
1047010464
**kwargs,
1047110465
)</code></pre>
1047210466
</details>
1047310467
<div class="desc"><p>Stream markdown text into a conversation.</p>
10474-
<p>This method provides an easy way to stream markdown text using the following endpoints:
10475-
- chat.startStream: Starts a new streaming conversation
10476-
- chat.appendStream: Appends text to an existing streaming conversation
10477-
- chat.stopStream: Stops a streaming conversation</p>
10468+
<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>
10469+
<p>The following methods are used:</p>
10470+
<ul>
10471+
<li>chat.startStream: Starts a new streaming conversation. <a href="https://docs.slack.dev/reference/methods/chat.startStream">Reference</a>.</li>
10472+
<li>chat.appendStream: Appends text to an existing streaming conversation. <a href="https://docs.slack.dev/reference/methods/chat.appendStream">Reference</a>.</li>
10473+
<li>chat.stopStream: Stops a streaming conversation. <a href="https://docs.slack.dev/reference/methods/chat.stopStream">Reference</a>.</li>
10474+
</ul>
1047810475
<h2 id="args">Args</h2>
1047910476
<dl>
1048010477
<dt><strong><code>buffer_size</code></strong></dt>
10481-
<dd>Size of the internal buffer before automatically flushing (default: 256)</dd>
10478+
<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>
1048210479
<dt><strong><code>channel</code></strong></dt>
10483-
<dd>Channel to stream to</dd>
10480+
<dd>An encoded ID that represents a channel, private group, or DM.</dd>
1048410481
<dt><strong><code>thread_ts</code></strong></dt>
10485-
<dd>Thread timestamp to stream to (required)</dd>
10482+
<dd>Provide another message's ts value to reply to. Streamed messages should always be replies to a user request.</dd>
1048610483
<dt><strong><code>recipient_team_id</code></strong></dt>
10487-
<dd>Team ID of the recipient (for Slack Connect)</dd>
10484+
<dd>The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.</dd>
1048810485
<dt><strong><code>recipient_user_id</code></strong></dt>
10489-
<dd>User ID of the recipient (for Slack Connect)</dd>
10490-
<dt><strong><code>unfurl_links</code></strong></dt>
10491-
<dd>Whether to unfurl links</dd>
10492-
<dt><strong><code>unfurl_media</code></strong></dt>
10493-
<dd>Whether to unfurl media</dd>
10486+
<dd>The encoded ID of the user to receive the streaming text. Required when streaming to channels.</dd>
1049410487
<dt><strong><code>**kwargs</code></strong></dt>
10495-
<dd>Additional arguments passed to the underlying API calls</dd>
10488+
<dd>Additional arguments passed to the underlying API calls.</dd>
1049610489
</dl>
1049710490
<h2 id="returns">Returns</h2>
10498-
<p>ChatStreamer instance for managing the stream</p>
10491+
<p>ChatStream instance for managing the stream</p>
1049910492
<h2 id="example">Example</h2>
1050010493
<pre><code class="language-python">streamer = client.chat_stream(
1050110494
channel=&quot;C0123456789&quot;,

0 commit comments

Comments
 (0)