Skip to content

ME-526: new method send_thinking_indicator in agent-api v3.6 #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Added
- New method `delete_event` in customer-api v3.6.
- New methods in configuration-api v3.6 for greetings: `create_greeting`, `delete_greeting`, `get_greeting`, `update_greeting`, `list_greetings`.
- New method `send_thinking_indicator` in agent-api v3.6.

### Changed
- Improved websocket response collection + extended logging in the websocket client.
Expand Down
27 changes: 27 additions & 0 deletions livechat/agent/rtm/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,33 @@ def send_typing_indicator(self,
'payload': payload
})

def send_thinking_indicator(self,
chat_id: str = None,
visibility: str = None,
title: str = None,
description: str = None,
payload: dict = None) -> RtmResponse:
''' Sends a thinking indicator.

Args:
chat_id (str): ID of the chat you want to send the thinking indicator to.
visibility (str): Possible values: `all`, `agents`.
title (str): Title of the thinking indicator.
description (str): Description of the thinking indicator.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.

Returns:
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
'''
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({
'action': 'send_thinking_indicator',
'payload': payload
})

def multicast(self,
recipients: dict = None,
content: Any = None,
Expand Down
29 changes: 29 additions & 0 deletions livechat/agent/web/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,35 @@ def send_typing_indicator(self,
json=payload,
headers=headers)

def send_thinking_indicator(self,
chat_id: str = None,
title: str = None,
description: str = None,
visibility: str = None,
payload: dict = None,
headers: dict = None) -> httpx.Response:
''' Sends thinking indicator.

Args:
chat_id (str): ID of the chat that to send the thinking indicator to.
title (str): Title of the thinking indicator.
description (str): Description of the thinking indicator.
visibility (str): Possible values: `all`, `agents`.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.
headers (dict): Custom headers to be used with session headers.
They will be merged with session-level values that are set,
however, these method-level parameters will not be persisted across requests.

Returns:
httpx.Response: The Response object from `httpx` library,
which contains a server’s response to an HTTP request. '''
if payload is None:
payload = prepare_payload(locals())
return self.session.post(f'{self.api_url}/send_thinking_indicator',
json=payload,
headers=headers)

def multicast(self,
recipients: dict = None,
content: typing.Any = None,
Expand Down