Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions slack_sdk/web/async_chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ async def stop(
chunks: Optional[Sequence[Union[Dict, Chunk]]] = None,
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
session_status: Optional[str] = None,
**kwargs,
) -> AsyncSlackResponse:
"""Stop the stream and finalize the message.
Expand All @@ -169,6 +170,7 @@ async def stop(
what will be appended to the message received so far.
metadata: JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you
post to Slack is accessible to any app or user who is a member of that workspace.
session_status: The session status to set after stopping the stream.
**kwargs: Additional arguments passed to the underlying API calls.

Returns:
Expand Down Expand Up @@ -217,6 +219,7 @@ async def stop(
blocks=blocks,
chunks=flushings,
metadata=metadata,
session_status=session_status,
**kwargs,
)
self._state = "completed"
Expand Down
2 changes: 2 additions & 0 deletions slack_sdk/web/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,7 @@ async def chat_stopStream(
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
chunks: Optional[Sequence[Union[Dict, Chunk]]] = None,
session_status: Optional[str] = None,
**kwargs,
) -> AsyncSlackResponse:
"""Stops a streaming conversation.
Expand All @@ -3042,6 +3043,7 @@ async def chat_stopStream(
"blocks": blocks,
"metadata": metadata,
"chunks": chunks,
"session_status": session_status,
}
)
_parse_web_class_objects(kwargs)
Expand Down
3 changes: 3 additions & 0 deletions slack_sdk/web/chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def stop(
chunks: Optional[Sequence[Union[Dict, Chunk]]] = None,
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
session_status: Optional[str] = None,
**kwargs,
) -> SlackResponse:
"""Stop the stream and finalize the message.
Expand All @@ -159,6 +160,7 @@ def stop(
what will be appended to the message received so far.
metadata: JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you
post to Slack is accessible to any app or user who is a member of that workspace.
session_status: The session status to set after stopping the stream.
**kwargs: Additional arguments passed to the underlying API calls.

Returns:
Expand Down Expand Up @@ -207,6 +209,7 @@ def stop(
blocks=blocks,
chunks=flushings,
metadata=metadata,
session_status=session_status,
**kwargs,
)
self._state = "completed"
Expand Down
2 changes: 2 additions & 0 deletions slack_sdk/web/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3019,6 +3019,7 @@ def chat_stopStream(
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
chunks: Optional[Sequence[Union[Dict, Chunk]]] = None,
session_status: Optional[str] = None,
**kwargs,
) -> SlackResponse:
"""Stops a streaming conversation.
Expand All @@ -3032,6 +3033,7 @@ def chat_stopStream(
"blocks": blocks,
"metadata": metadata,
"chunks": chunks,
"session_status": session_status,
}
)
_parse_web_class_objects(kwargs)
Expand Down
2 changes: 2 additions & 0 deletions slack_sdk/web/legacy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,7 @@ def chat_stopStream(
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
chunks: Optional[Sequence[Union[Dict, Chunk]]] = None,
session_status: Optional[str] = None,
**kwargs,
) -> Union[Future, SlackResponse]:
"""Stops a streaming conversation.
Expand All @@ -3042,6 +3043,7 @@ def chat_stopStream(
"blocks": blocks,
"metadata": metadata,
"chunks": chunks,
"session_status": session_status,
}
)
_parse_web_class_objects(kwargs)
Expand Down
2 changes: 2 additions & 0 deletions tests/slack_sdk/web/test_chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def test_streams_a_long_message(self):
)
],
markdown_text="*",
session_status="processing",
token="xoxb-chat_stream_test_token2",
)

Expand Down Expand Up @@ -176,6 +177,7 @@ def test_streams_a_long_message(self):
json.dumps(stop_request.get("chunks")),
'[{"text": "**", "type": "markdown_text"}]',
)
self.assertEqual(stop_request.get("session_status"), "processing")
self.assertEqual(stop_request.get("token"), "xoxb-chat_stream_test_token2")
self.assertEqual(stop_request.get("ts"), "123.123")

Expand Down
2 changes: 2 additions & 0 deletions tests/slack_sdk_async/web/test_async_chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ async def test_streams_a_long_message(self):
)
],
markdown_text="*",
session_status="processing",
token="xoxb-chat_stream_test_token2",
)

Expand Down Expand Up @@ -179,6 +180,7 @@ async def test_streams_a_long_message(self):
json.dumps(stop_request.get("chunks")),
'[{"text": "**", "type": "markdown_text"}]',
)
self.assertEqual(stop_request.get("session_status"), "processing")
self.assertEqual(stop_request.get("token"), "xoxb-chat_stream_test_token2")
self.assertEqual(stop_request.get("ts"), "123.123")

Expand Down
Loading