Skip to content

Commit 541ba3a

Browse files
MinsterMindManoj Mali
andauthored
Feat/call score (#54)
* call score api * add features and metadata to async call & add callscore apis * test for get call score * add experience url call --------- Co-authored-by: Manoj Mali <manojmali@Manojs-MacBook-Pro-2.local>
1 parent 4db6543 commit 541ba3a

File tree

6 files changed

+54
-4
lines changed

6 files changed

+54
-4
lines changed

example/Async_API/Text_API/process_text.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
payload = {
1313

1414
"name": "TextAPI", # you can update the name of the conversation
15+
16+
"features": {
17+
"featureList": [
18+
"insights",
19+
"callScore"
20+
]
21+
},
22+
"metadata": {
23+
"salesStage": "qualification",
24+
"prospectName": "DeepMind AI"
25+
},
1526

1627
#"trackers": trackers, #To detect the trackers
1728

@@ -52,6 +63,7 @@
5263

5364
# To get the message from the conversation
5465
print(conversation_object.get_messages())
66+
print(conversation_object.get_call_score_status())
5567

5668
#To get the conversation data from the conversation
5769
#print(conversation_object.get_conversation())

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
symbl_rest >= 1.0.11
1+
symbl_rest >= 1.0.14
22
websocket-client >= 0.59.0
33
pyaudio ~= 0.2.12
44
numpy

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
setup(
2222
name="symbl",
23-
version="2.0.0",
23+
version="2.0.5",
2424
description="symbl.ai SDK",
2525
author_email="info@symbl.ai",
2626
url="",
2727
keywords=["Symbl.ai SDK"],
28-
install_requires=["symbl_rest >= 1.0.11", "websocket-client >= 0.59.0", "pyaudio ~= 0.2.12", "numpy"],
28+
install_requires=["symbl_rest >= 1.0.14", "websocket-client >= 0.59.0", "pyaudio ~= 0.2.12", "numpy"],
2929
packages=find_packages(),
3030
include_package_data=True,
3131
long_description="""\

symbl/Conversations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@ def delete_conversation(self):
104104
@validate_conversation_id
105105
def get_formatted_transcript(self, parameters={}):
106106
return self.__conversation_api.get_formatted_transcript(self.__conversation_id,parameters,credentials=self.__credentials)
107+
108+
@validate_conversation_id
109+
def get_call_score(self):
110+
return self.__conversation_api.get_call_score(self.__conversation_id, credentials=self.__credentials)
111+
112+
@validate_conversation_id
113+
def get_call_score_status(self):
114+
return self.__conversation_api.get_call_score_status(self.__conversation_id, credentials=self.__credentials)
107115

symbl/callScore.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from conversations_api.ConversationsApi import ConversationsApi
2+
3+
conversations = ConversationsApi();
4+
5+
conversation_id=6750867925630976 # Update with the conversation Id of your conversation
6+
7+
print(conversations.get_call_score_insights_url(conversation_id))

symbl/conversations_api/ConversationsApi.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,30 @@ def get_action_items(self, conversation_id, credentials=None):
1717
return self.conversations_api_rest.get_action_items_by_conversation_id(conversation_id)
1818
except:
1919
return {'message': 'The conversationId is either invalid or does not exist.'}
20-
20+
21+
22+
@initialize_api_client
23+
def get_call_score(self, conversation_id, credentials=None):
24+
try:
25+
return self.conversations_api_rest.get_call_score_by_conversation_id(conversation_id)
26+
except:
27+
return {'message': 'The conversationId is either invalid or does not exist.'}
28+
29+
@initialize_api_client
30+
def get_call_score_insights_url(self, conversation_id, credentials=None):
31+
try:
32+
params = {'include_call_score': True}
33+
return self.conversations_api_rest.get_experience_url_by_conversation_id(conversation_id, **correct_boolean_values(params))
34+
except Exception as e:
35+
return {'message': 'The conversationId is either invalid or does not exist.'}
36+
37+
@initialize_api_client
38+
def get_call_score_status(self, conversation_id, credentials=None):
39+
try:
40+
res = self.conversations_api_rest.get_call_score_status_by_conversation_id(conversation_id)
41+
return res
42+
except Exception as e:
43+
return {'message': 'The conversationId is either invalid or does not exist.'}
2144

2245
@initialize_api_client
2346
def get_follow_ups(self, conversation_id, credentials=None ):

0 commit comments

Comments
 (0)