From 3199192fb4b0adc9a87c6c16072cc9f359663022 Mon Sep 17 00:00:00 2001 From: Roshani Jawale <76408217+roshanijawale@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:28:14 +0530 Subject: [PATCH] Added Conversation data API (#35) * Added Conversation Data API * Fixed hyperlink issues of readme doc * Fixed Append video URL link --- .../Async_API/Audio_API/append_audio_file.py | 3 ++ .../Async_API/Audio_API/append_audio_url.py | 3 ++ .../Async_API/Audio_API/process_audio_file.py | 4 ++ .../Async_API/Audio_API/process_audio_url.py | 3 ++ example/Async_API/Text_API/append_text.py | 3 ++ example/Async_API/Text_API/process_text.py | 3 ++ .../Async_API/Video_API/append_video_file.py | 3 ++ .../Async_API/Video_API/append_video_url.py | 3 ++ .../Async_API/Video_API/process_video_file.py | 3 ++ .../Async_API/Video_API/process_video_url.py | 3 ++ .../Conversation_Class/conversation_class.py | 1 + example/Streaming_API/streaming.py | 3 ++ example/Telephony_API/telephony_pstn.py | 9 ++--- example/Telephony_API/telephony_sip.py | 3 ++ readme.md | 4 +- symbl/Conversations.py | 4 ++ symbl/conversations_api/ConversationsApi.py | 4 ++ symbl/readme.md | 38 +++++++++++-------- 18 files changed, 74 insertions(+), 23 deletions(-) diff --git a/example/Async_API/Audio_API/append_audio_file.py b/example/Async_API/Audio_API/append_audio_file.py index bd49d62..c69bac2 100644 --- a/example/Async_API/Audio_API/append_audio_file.py +++ b/example/Async_API/Audio_API/append_audio_file.py @@ -9,6 +9,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Audio_API/append_audio_url.py b/example/Async_API/Audio_API/append_audio_url.py index 71b9ea5..778272f 100644 --- a/example/Async_API/Audio_API/append_audio_url.py +++ b/example/Async_API/Audio_API/append_audio_url.py @@ -9,6 +9,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Audio_API/process_audio_file.py b/example/Async_API/Audio_API/process_audio_file.py index a6fe3ca..7f2589a 100644 --- a/example/Async_API/Audio_API/process_audio_file.py +++ b/example/Async_API/Audio_API/process_audio_file.py @@ -1,6 +1,7 @@ import symbl file = "" + ''' like this you can pass the parameter params = { 'name': "Meeting", @@ -31,6 +32,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Audio_API/process_audio_url.py b/example/Async_API/Audio_API/process_audio_url.py index fcc8729..40a2430 100644 --- a/example/Async_API/Audio_API/process_audio_url.py +++ b/example/Async_API/Audio_API/process_audio_url.py @@ -31,6 +31,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Text_API/append_text.py b/example/Async_API/Text_API/append_text.py index e231653..01c0ff8 100644 --- a/example/Async_API/Text_API/append_text.py +++ b/example/Async_API/Text_API/append_text.py @@ -22,6 +22,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Text_API/process_text.py b/example/Async_API/Text_API/process_text.py index 4436a78..6bab81e 100644 --- a/example/Async_API/Text_API/process_text.py +++ b/example/Async_API/Text_API/process_text.py @@ -31,6 +31,9 @@ # To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + # To get the action items from the conversation # print(conversation_object.get_action_items()) diff --git a/example/Async_API/Video_API/append_video_file.py b/example/Async_API/Video_API/append_video_file.py index 7a044e6..3018055 100644 --- a/example/Async_API/Video_API/append_video_file.py +++ b/example/Async_API/Video_API/append_video_file.py @@ -10,6 +10,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Video_API/append_video_url.py b/example/Async_API/Video_API/append_video_url.py index 6c4a225..42b3185 100644 --- a/example/Async_API/Video_API/append_video_url.py +++ b/example/Async_API/Video_API/append_video_url.py @@ -9,6 +9,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Video_API/process_video_file.py b/example/Async_API/Video_API/process_video_file.py index fc0ac7d..328387c 100644 --- a/example/Async_API/Video_API/process_video_file.py +++ b/example/Async_API/Video_API/process_video_file.py @@ -31,6 +31,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Async_API/Video_API/process_video_url.py b/example/Async_API/Video_API/process_video_url.py index 04f7e38..562fa03 100644 --- a/example/Async_API/Video_API/process_video_url.py +++ b/example/Async_API/Video_API/process_video_url.py @@ -37,6 +37,9 @@ #To get the message from the conversation print(conversation_object.get_messages()) +#To get the conversation data from the conversation +#print(conversation_object.get_conversation()) + #To get the action items from the conversation #print(conversation_object.get_action_items()) diff --git a/example/Conversation_Class/conversation_class.py b/example/Conversation_Class/conversation_class.py index a65937a..1da5b59 100644 --- a/example/Conversation_Class/conversation_class.py +++ b/example/Conversation_Class/conversation_class.py @@ -3,6 +3,7 @@ conversation_id=1234567890 # Update with the conversation Id of your conversation print(symbl.Conversations.get_messages(conversation_id)) +print(symbl.Conversations.get_conversation(conversation_id)) print(symbl.Conversations.get_action_items(conversation_id)) print(symbl.Conversations.get_follow_ups(conversation_id)) print(symbl.Conversations.get_members(conversation_id)) diff --git a/example/Streaming_API/streaming.py b/example/Streaming_API/streaming.py index aca9fed..0f0c840 100644 --- a/example/Streaming_API/streaming.py +++ b/example/Streaming_API/streaming.py @@ -30,6 +30,9 @@ #To get the message from the conversation #print(connection_object.conversation.get_messages()) +#To get the conversation data from the conversation +#print(connection_object.conversation.get_conversation()) + #To get the action items from the conversation #print(connection_object.conversation.get_action_items()) diff --git a/example/Telephony_API/telephony_pstn.py b/example/Telephony_API/telephony_pstn.py index 6671458..9d07e0d 100644 --- a/example/Telephony_API/telephony_pstn.py +++ b/example/Telephony_API/telephony_pstn.py @@ -37,15 +37,12 @@ # you can get the response from the conversation object, when you will stop the connection explicitly using keyboard interrupt or by using # connection_object.stop() # you can also stop the connection after sspecifying some interval of timing -''' need to fix this block -you will need to import time module -time.sleep(10) -connection_object.stop() -''' - # To get the message from the meeting #print(connection_object.conversation.get_messages()) +#To get the conversation data from the conversation +#print(connection_object.conversation.get_conversation()) + # To get the action items from the meeting # print(connection_object.conversation.get_action_items()) diff --git a/example/Telephony_API/telephony_sip.py b/example/Telephony_API/telephony_sip.py index ba26240..5bd3c0f 100644 --- a/example/Telephony_API/telephony_sip.py +++ b/example/Telephony_API/telephony_sip.py @@ -22,6 +22,9 @@ # To get the message from the conversation #print(connection_object.conversation.get_messages()) +#To get the conversation data from the conversation +#print(connection_object.conversation.get_conversation()) + # To get the action items from the conversation # print(connection_object.conversation.get_action_items()) diff --git a/readme.md b/readme.md index fc36d0f..fa58d99 100644 --- a/readme.md +++ b/readme.md @@ -175,9 +175,9 @@ connection_object.send_audio_from_mic() ## Extended Readme -You can see all the functions provided by SDK in the **extended [readme.md](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/symbl/readme.md) file**. +You can see all the functions provided by SDK in the **extended [readme.md](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/symbl/readme.md) file**. -You can go through some examples for understanding the use of all functionality [Explore more example](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example) +You can go through some examples for understanding the use of all functionality [Explore more example](https://github.com/symblai/symbl-python/tree/roshani_Conversation_data_api/example) ## Possible Errors diff --git a/symbl/Conversations.py b/symbl/Conversations.py index 1e417a7..87704f9 100644 --- a/symbl/Conversations.py +++ b/symbl/Conversations.py @@ -72,3 +72,7 @@ def get_questions(self): @validate_conversation_id def get_topics(self, parameters={}): return self.__conversation_api.get_topics(self.__conversation_id, credentials=self.__credentials, parameters=parameters) + + @validate_conversation_id + def get_conversation(self): + return self.__conversation_api.get_conversation(self.__conversation_id, credentials=self.__credentials) diff --git a/symbl/conversations_api/ConversationsApi.py b/symbl/conversations_api/ConversationsApi.py index cce251b..374a299 100644 --- a/symbl/conversations_api/ConversationsApi.py +++ b/symbl/conversations_api/ConversationsApi.py @@ -36,3 +36,7 @@ def get_questions(self, conversation_id, credentials=None): def get_topics(self, conversation_id, credentials=None, parameters={}): params = dictionary_to_valid_json(parameters) return self.conversations_api_rest.get_topics_by_conversation_id(conversation_id, **correct_boolean_values(params)) + + @initialize_api_client + def get_conversation(self, conversation_id, credentials=None): + return self.conversations_api_rest.get_conversation_by_conversation_id(conversation_id) diff --git a/symbl/readme.md b/symbl/readme.md index 9a9c20d..9c7a8eb 100644 --- a/symbl/readme.md +++ b/symbl/readme.md @@ -45,7 +45,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.A >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Audio_API/process_audio_file.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Audio_API/process_audio_file.py) to check the example for usage of parameters/arguments and conversation object 2. process_url(payload): >Parameter Name | Required | Value @@ -57,7 +57,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.A >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Audio_API/process_audio_url.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Audio_API/process_audio_url.py) to check the example for usage of parameters/arguments and conversation object 3. append_file(file_path, conversation_id): >Parameter Name | Required | Value @@ -71,7 +71,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.A >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Audio_API/append_audio_file.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Audio_API/append_audio_file.py) to check the example for usage of parameters/arguments and conversation object 4. append_url(payload, conversation_id): >Parameter Name | Required | Value @@ -84,7 +84,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.A >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Audio_API/append_audio_url.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Audio_API/append_audio_url.py) to check the example for usage of parameters/arguments and conversation object # Video class @@ -103,7 +103,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.V >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Video_API/process_video_file.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Video_API/process_video_file.py) to check the example for usage of parameters/arguments and conversation object 2. process_url(payload): >Parameter Name | Required | Value @@ -115,7 +115,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.V >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Video_API/process_video_url.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Video_API/process_video_url.py) to check the example for usage of parameters/arguments and conversation object 3. append_file(file_path, conversation_id): >Parameter Name | Required | Value @@ -129,7 +129,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.V >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Video_API/append_video_file.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Video_API/append_video_file.py) to check the example for usage of parameters/arguments and conversation object 4. append_url(payload, conversation_id): >Parameter Name | Required | Value @@ -142,7 +142,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.V >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/blob/roshani_readme_changes/example/Async_API/Video_API/append_video_url.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Video_API/append_video_url.py) to check the example for usage of parameters/arguments and conversation object # Text class Symbl's Async APIs provide the functionality for processing textual content from a conversation. The data processed for these conversations are available via the Conversation APIs once the APIs have completed the processing. @@ -160,7 +160,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.T >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Async_API/Text_API/process_text.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Text_API/process_text.py) to check the example for usage of parameters/arguments and conversation object 2. append(payload, conversation_id): @@ -174,7 +174,7 @@ You can utilize different functions of Async APIs by directly utilizing `symbl.T >returns conversation object > - >click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Async_API/Text_API/append_text.py) to check the example for usage of parameters/arguments and conversation object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Async_API/Text_API/append_text.py) to check the example for usage of parameters/arguments and conversation object ## conversation object @@ -206,6 +206,10 @@ Conversation object is returned by Async API Text, Audio and Video classes. The >parameters:- (Optional) dictionary, takes a dictionary of parameters. For list of parameters accepted, please click [here](https://docs.symbl.ai/docs/conversation-api/get-topics#query-params) > >returns The most relevant topics of discussion from the conversation that is generated based on the combination of the overall scope of the discussion. + +7. conversation.get_conversation(): + + >returns the conversation meta-data like meeting name, member name and email, start and end time of the meeting, meeting type and meeting id. > >example for demonstrate the use of conversation class > @@ -258,6 +262,10 @@ You can utilize different functions of Conversation APIs by directly utilizing ` > >returns The most relevant topics of discussion from the conversation that is generated based on the combination of the overall scope of the discussion. +7. get_conversation(conversation_id) + + >returns the conversation meta-data like meeting name, member name and email, start and end time of the meeting, meeting type and meeting id. + >example for demonstrate the use of conversation class > ``` @@ -267,7 +275,7 @@ conversation_id=1234567890 # Update with the conversation Id of your conversatio print(symbl.Conversations.get_messages(conversation_id)) ``` ->to access more insights click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Conversation_Class/conversation_class.py) +>to access more insights click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Conversation_Class/conversation_class.py) # Telephony class @@ -287,7 +295,7 @@ Based on PSTN and SIP protocols, the Telephony API provides an interface for the >returns connection object > - >click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Telephony_API/telephony_pstn.py) to check the example for usage of parameters/arguments and connection object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Telephony_API/telephony_pstn.py) to check the example for usage of parameters/arguments and connection object > >For more details check [here][telephony-docs] @@ -305,7 +313,7 @@ Based on PSTN and SIP protocols, the Telephony API provides an interface for the >returns connection object > - >click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Telephony_API/telephony_sip.py) to check the example for usage of parameters/arguments and connection object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Telephony_API/telephony_sip.py) to check the example for usage of parameters/arguments and connection object > >For more details check [here][telephony-docs] @@ -347,7 +355,7 @@ Symbl's Streaming API is based on WebSocket protocol and can be used for real-ti >Parameter Name | Required | Value >--- | --- | --- >credentials | optional | Don't add this parameter if you have `symbl.conf` file in your home directory or working directory - >speaker | Optional | speaker object containing name and email field + >speaker | Optional | speaker object containing `name` and `email` field >insight_type | Optional | insight_types to be available in the websocket connection. >config | optional | using this parameter you can pass confidenceThreshold, languageCode >languages | optional | To provide the Language list explicitly @@ -355,7 +363,7 @@ Symbl's Streaming API is based on WebSocket protocol and can be used for real-ti >returns connection object > - >click [here](https://github.com/symblai/symbl-python/tree/roshani_readme_changes/example/Streaming_API/streaming.py) to check the example for usage of parameters/arguments and connection object + >click [here](https://github.com/symblai/symbl-python/blob/roshani_Conversation_data_api/example/Streaming_API/streaming.py) to check the example for usage of parameters/arguments and connection object > >For more details check [here][streaming-docs]