From 616ea8ca4a1a7900b916f91fc53a0298706a0eb5 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Mon, 27 Jan 2025 14:44:11 +0530 Subject: [PATCH 1/6] VT-8644:Added as new role in Multiparty Add Participant API and XML creation --- CHANGELOG.md | 4 ++++ plivo/resources/multipartycall.py | 2 +- plivo/version.py | 2 +- plivo/xml/MultiPartyCallElement.py | 2 +- setup.py | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df2ff7b1..07b0b830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log + +## [4.58.4](https://github.com/plivo/plivo-python/tree/v4.58.4) (2025-01-27) +- Added `ai-agent` as new role in Multiparty Add Participant API and XML creation + ## [4.58.3](https://github.com/plivo/plivo-python/tree/v4.58.3) (2025-01-14) - Added `from_number` and `to_number` filter support for `list messages` API - diff --git a/plivo/resources/multipartycall.py b/plivo/resources/multipartycall.py index dbfc99ca..c6c4cc9b 100644 --- a/plivo/resources/multipartycall.py +++ b/plivo/resources/multipartycall.py @@ -268,7 +268,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method= is_voice_request=True, response_type=MultiPartyCall) @validate_args( - role=[of_type_exact(str), is_in(('agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower')], + role=[of_type_exact(str), is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower')], friendly_name=[optional(of_type_exact(str))], uuid=[optional(of_type_exact(str))], from_=[optional(is_phonenumber())], diff --git a/plivo/version.py b/plivo/version.py index 8a490f17..6cf34af2 100644 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.58.3' +__version__ = '4.58.4' diff --git a/plivo/xml/MultiPartyCallElement.py b/plivo/xml/MultiPartyCallElement.py index 8a01276f..a6d4ba33 100644 --- a/plivo/xml/MultiPartyCallElement.py +++ b/plivo/xml/MultiPartyCallElement.py @@ -367,7 +367,7 @@ def role(self): @validate_args( role=[ of_type_exact(str), - is_in(('agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower') + is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower') ] ) def role(self, role): diff --git a/setup.py b/setup.py index 3aa08184..4242bcc5 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='plivo', - version='4.58.3', + version='4.58.4', description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML', long_description=long_description, url='https://github.com/plivo/plivo-python', From 864d1265bd255de4f1a86d8090840de3a29177ed Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Tue, 28 Jan 2025 12:23:20 +0530 Subject: [PATCH 2/6] VT-8644 --- CHANGELOG.md | 2 +- plivo/resources/multipartycall.py | 2 +- plivo/xml/MultiPartyCallElement.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07b0b830..ff43507c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log ## [4.58.4](https://github.com/plivo/plivo-python/tree/v4.58.4) (2025-01-27) -- Added `ai-agent` as new role in Multiparty Add Participant API and XML creation +- Role param validation enhancement in Multiparty Add Participant API and XML creation ## [4.58.3](https://github.com/plivo/plivo-python/tree/v4.58.3) (2025-01-14) - Added `from_number` and `to_number` filter support for `list messages` API diff --git a/plivo/resources/multipartycall.py b/plivo/resources/multipartycall.py index c6c4cc9b..ca484fad 100644 --- a/plivo/resources/multipartycall.py +++ b/plivo/resources/multipartycall.py @@ -268,7 +268,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method= is_voice_request=True, response_type=MultiPartyCall) @validate_args( - role=[of_type_exact(str), is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower')], + role=[of_type_exact(str)], friendly_name=[optional(of_type_exact(str))], uuid=[optional(of_type_exact(str))], from_=[optional(is_phonenumber())], diff --git a/plivo/xml/MultiPartyCallElement.py b/plivo/xml/MultiPartyCallElement.py index a6d4ba33..ad837b09 100644 --- a/plivo/xml/MultiPartyCallElement.py +++ b/plivo/xml/MultiPartyCallElement.py @@ -366,8 +366,7 @@ def role(self): @role.setter @validate_args( role=[ - of_type_exact(str), - is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower') + of_type_exact(str) ] ) def role(self, role): From ea3afb44be52d904167412822264fe06241bbc71 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Tue, 28 Jan 2025 15:23:29 +0530 Subject: [PATCH 3/6] VT-8644 --- CHANGELOG.md | 1 + plivo/resources/calls.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff43507c..aa4a593d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [4.58.4](https://github.com/plivo/plivo-python/tree/v4.58.4) (2025-01-27) - Role param validation enhancement in Multiparty Add Participant API and XML creation +- Added new param `cx_bot` in Start Stream API ## [4.58.3](https://github.com/plivo/plivo-python/tree/v4.58.3) (2025-01-14) - Added `from_number` and `to_number` filter support for `list messages` API diff --git a/plivo/resources/calls.py b/plivo/resources/calls.py index 8e01dce4..c0030254 100644 --- a/plivo/resources/calls.py +++ b/plivo/resources/calls.py @@ -510,7 +510,8 @@ def start_stream(self, status_callback_url=None, status_callback_method=None, content_type=None, - extra_headers=None): + extra_headers=None, + cx_bot=None,): return self.client.request('POST', ('Call', call_uuid, 'Stream'), to_param_dict(self.start_stream, locals()), is_voice_request=True) From adfb6854afc8cbb68cc21a81553e251c86b19a6e Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Tue, 28 Jan 2025 15:24:33 +0530 Subject: [PATCH 4/6] VT-8644 --- plivo/resources/calls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plivo/resources/calls.py b/plivo/resources/calls.py index c0030254..9e28f2ae 100644 --- a/plivo/resources/calls.py +++ b/plivo/resources/calls.py @@ -511,7 +511,7 @@ def start_stream(self, status_callback_method=None, content_type=None, extra_headers=None, - cx_bot=None,): + cx_bot=None): return self.client.request('POST', ('Call', call_uuid, 'Stream'), to_param_dict(self.start_stream, locals()), is_voice_request=True) From c110b6bae17ad1de5644cad71837bb63939f6694 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Wed, 29 Jan 2025 11:01:29 +0530 Subject: [PATCH 5/6] VT-8644 --- plivo/resources/multipartycall.py | 2 +- plivo/xml/MultiPartyCallElement.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plivo/resources/multipartycall.py b/plivo/resources/multipartycall.py index ca484fad..c6c4cc9b 100644 --- a/plivo/resources/multipartycall.py +++ b/plivo/resources/multipartycall.py @@ -268,7 +268,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method= is_voice_request=True, response_type=MultiPartyCall) @validate_args( - role=[of_type_exact(str)], + role=[of_type_exact(str), is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower')], friendly_name=[optional(of_type_exact(str))], uuid=[optional(of_type_exact(str))], from_=[optional(is_phonenumber())], diff --git a/plivo/xml/MultiPartyCallElement.py b/plivo/xml/MultiPartyCallElement.py index ad837b09..a6d4ba33 100644 --- a/plivo/xml/MultiPartyCallElement.py +++ b/plivo/xml/MultiPartyCallElement.py @@ -366,7 +366,8 @@ def role(self): @role.setter @validate_args( role=[ - of_type_exact(str) + of_type_exact(str), + is_in(('ai-agent', 'agent', 'supervisor', 'customer'), case_sensitive=False, case_type='lower') ] ) def role(self, role): From ad5919c93c6b8f9e24eb9aab0e4e707ce4a5b585 Mon Sep 17 00:00:00 2001 From: ajay-plivo Date: Wed, 29 Jan 2025 11:08:00 +0530 Subject: [PATCH 6/6] VT-8644 --- tests/resources/test_multipartycalls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/test_multipartycalls.py b/tests/resources/test_multipartycalls.py index 465c0958..5f0d8063 100644 --- a/tests/resources/test_multipartycalls.py +++ b/tests/resources/test_multipartycalls.py @@ -65,7 +65,7 @@ def test_add_participant_validations(self): self.client.multi_party_calls.add_participant(role='manager') except ValidationError as e: error_message = str(e) - self.assertEqual(error_message, "[\"role should be in ('agent', 'supervisor', " + self.assertEqual(error_message, "[\"role should be in ('ai-agent', 'agent', 'supervisor', " "'customer') (actual value: manager)\"]") try: