From 7ded860f18de0b7d04ae2efa1ae96f886ab7439f Mon Sep 17 00:00:00 2001 From: Marcelo Jabali Date: Mon, 14 Mar 2022 10:41:28 -0700 Subject: [PATCH 1/5] Added Post Video Summary UI action --- .../post-video-summary-ui.mjs | 114 ++++++++++++++++++ components/symbl_ai/symbl_ai.app.mjs | 12 ++ 2 files changed, 126 insertions(+) create mode 100644 components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs diff --git a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs new file mode 100644 index 0000000000000..f1cb7d3aeffdb --- /dev/null +++ b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs @@ -0,0 +1,114 @@ +import symblAIApp from "../../symbl_ai.app.mjs"; + +export default { + key: "symbl_ai-post-video-summary-ui", + name: "Submit Video Summary User Interface", + description: "The Video Summary UI provides users the ability to interact with the Symbl elements (transcripts, Questions, Follow-Ups, Action Items, etc.) from a video conversation. See the doc [here](https://docs.symbl.ai/docs/async-api/overview/video/post-video-url)", + version: "0.0.6", + type: "action", + props: { + symblAIApp, + conversationId: { + type: "string", + label: "Conversation Id", + description: "", + default: "5746537658318848", + }, + videoUrl: { + type: "string", + label: "Video URL", + description: "URL of the video file for which you want to generate the video summary UI.", + }, + name: { + type: "string", + label: "Name", + description: "Use `video-summary` for the Video Summary UI.", + default: "video-summary", + }, + logo: { + type: "string", + label: "Logo", + description: "URL of the custom logo to be used in the Video Summary UI.", + optional: true, + }, + favicon: { + type: "string", + label: "Favicon", + description: "URL of the custom favicon to be used in the Video Summary UI.", + optional: true, + }, + background: { + type: "string", + label: "Background Color", + description: "Background color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, + }, + topicsFilter: { + type: "string", + label: "Topics Filter Element Color", + description: "Topics Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, + }, + insightsFilter: { + type: "string", + label: "Insights Element Color", + description: "Insights (Questions, Follow-ups, Action Items, etc) Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, + }, + font: { + type: "string", + label: "Font", + description: "The name of the font to be used in the Video Summary UI. All fonts available in the [Google Fonts](https://fonts.google.com/) are supported.", + optional: true, + }, + summaryURLExpiresIn: { + type: "string", + label: "Expiration Time of the Video Summary UI", + description: "Number of seconds set for expiration time of the Video Summary UI. Zero (0) will set the Video Summary UI to never expire. Default value is set to `2592000` (30 days).", + optional: true, + }, + readOnly: { + type: "boolean", + label: "Read Only", + description: "Disable the editing capabilities of the Video Summary UI. Default value is `false`.", + optional: true, + }, + enableCustomDomain: { + type: "boolean", + label: "Enable Custom Domain", + description: "Enable generation of personalized URLs for the Video Summary UI.", + optional: true, + }, + }, + async run({ $ }) { + try { + const response = + await this.symblAIApp.postVideoSummaryUI({ + $, + conversationId: this.conversationId, + data: { + videoUrl: this.videoUrl, + name: this.name, + logo: this.logo, + favicon: this.favicon, + color: { + background: this.background, + topicsFilter: this.topicsFilter, + insightsFilter: this.insightsFilter, + }, + font: { + family: this.font, + }, + summaryURLExpiresIn: this.summaryURLExpiresIn, + readOnly: this.readOnly, + enableCustomDomain: this.enableCustomDomain, + }, + }); + $.export("$summary", `Successfully generated Video Summary UI at: ${response.url}`); + return response; + } catch (error) { + console.log("Error: ", error); + $.export("summary", "Failed to post Video Summary UI."); + } + }, +}; diff --git a/components/symbl_ai/symbl_ai.app.mjs b/components/symbl_ai/symbl_ai.app.mjs index c7e4226ca44f0..3d5991ed89281 100644 --- a/components/symbl_ai/symbl_ai.app.mjs +++ b/components/symbl_ai/symbl_ai.app.mjs @@ -49,5 +49,17 @@ export default { path: `/job/${jobId}`, }); }, + async postVideoSummaryUI({ + $, + conversationId, + data, + }) { + return this.makeRequest({ + $, + method: "post", + path: `/conversations/${conversationId}/experiences`, + data, + }) + }, }, }; From 91d784afd39a51cb85e022c8904b9e0f4fe06a7b Mon Sep 17 00:00:00 2001 From: Marcelo Jabali Date: Tue, 15 Mar 2022 22:55:13 -0700 Subject: [PATCH 2/5] Added Post Video Summary UI action --- .../post-video-summary-ui/post-video-summary-ui.mjs | 10 +++++----- components/symbl_ai/symbl_ai.app.mjs | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs index f1cb7d3aeffdb..6be6618f91401 100644 --- a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs +++ b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs @@ -4,15 +4,15 @@ export default { key: "symbl_ai-post-video-summary-ui", name: "Submit Video Summary User Interface", description: "The Video Summary UI provides users the ability to interact with the Symbl elements (transcripts, Questions, Follow-Ups, Action Items, etc.) from a video conversation. See the doc [here](https://docs.symbl.ai/docs/async-api/overview/video/post-video-url)", - version: "0.0.6", + version: "0.0.1", type: "action", props: { symblAIApp, conversationId: { - type: "string", - label: "Conversation Id", - description: "", - default: "5746537658318848", + propDefinition: [ + symblAIApp, + "conversationId", + ], }, videoUrl: { type: "string", diff --git a/components/symbl_ai/symbl_ai.app.mjs b/components/symbl_ai/symbl_ai.app.mjs index bedf4e55a988f..4ac3bb7e920ed 100644 --- a/components/symbl_ai/symbl_ai.app.mjs +++ b/components/symbl_ai/symbl_ai.app.mjs @@ -141,5 +141,17 @@ export default { params, }); }, + async getSummary({ + $, + conversationId, + params, + }) { + return this.makeRequest({ + $, + path: `/conversations/${conversationId}/summary`, + params, + }); + }, + }, }; From 2b69a8b96c779effcd092b5018f6bb13350cb612 Mon Sep 17 00:00:00 2001 From: Marcelo Jabali Date: Tue, 15 Mar 2022 22:56:41 -0700 Subject: [PATCH 3/5] Added GET Summary action --- .../actions/get-summary/get-summary.mjs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 components/symbl_ai/actions/get-summary/get-summary.mjs diff --git a/components/symbl_ai/actions/get-summary/get-summary.mjs b/components/symbl_ai/actions/get-summary/get-summary.mjs new file mode 100644 index 0000000000000..b9b3a620c1606 --- /dev/null +++ b/components/symbl_ai/actions/get-summary/get-summary.mjs @@ -0,0 +1,43 @@ +import symblAIApp from "../../symbl_ai.app.mjs"; + +export default { + key: "symbl_ai-get-summary", + name: "Get Summary", + description: "Get a summary of important contextual messages in a conversation. See the doc [here](https://docs.symbl.ai/docs/conversation-api/summary)", + version: "0.0.1", + type: "action", + props: { + symblAIApp, + conversationId: { + propDefinition: [ + symblAIApp, + "conversationId", + ], + }, + refresh: { + type: "boolean", + label: "Refresh", + description: "Allows you to regenerate the Summary (Async APIs), create summary (Telephony and Streaming APIs) and generate the Summary for already processed conversations.", + optional: true, + default: false, + }, + }, + async run({ $ }) { + try { + const { summary } = await this.symblAIApp.getSummary({ + $, + conversationId: this.conversationId, + params: { + refresh: this.refresh, + }, + }); + $.export("$summary", `Successfully generated ${summary.length} Summary message${summary.length === 1 + ? "" + : "s"} from the conversation`); + return summary; + } catch (error) { + console.log("Error: ", error); + $.export("$summary", "Failed to generate the Summary of the conversation"); + } + }, +}; From be5923ad13fd51582c2313123fa49a09938c696a Mon Sep 17 00:00:00 2001 From: Marcelo Jabali Date: Tue, 15 Mar 2022 22:58:26 -0700 Subject: [PATCH 4/5] Fixed eslint issues --- .../post-video-summary-ui.mjs | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs index 6be6618f91401..c055c8fa662f5 100644 --- a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs +++ b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs @@ -35,49 +35,49 @@ export default { type: "string", label: "Favicon", description: "URL of the custom favicon to be used in the Video Summary UI.", - optional: true, + optional: true, }, background: { - type: "string", - label: "Background Color", - description: "Background color to be used in the Video Summary UI. Hex Color Codes accepted.", - optional: true, + type: "string", + label: "Background Color", + description: "Background color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, }, topicsFilter: { - type: "string", - label: "Topics Filter Element Color", - description: "Topics Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", - optional: true, + type: "string", + label: "Topics Filter Element Color", + description: "Topics Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, }, insightsFilter: { - type: "string", - label: "Insights Element Color", - description: "Insights (Questions, Follow-ups, Action Items, etc) Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", - optional: true, + type: "string", + label: "Insights Element Color", + description: "Insights (Questions, Follow-ups, Action Items, etc) Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.", + optional: true, }, font: { - type: "string", - label: "Font", - description: "The name of the font to be used in the Video Summary UI. All fonts available in the [Google Fonts](https://fonts.google.com/) are supported.", - optional: true, + type: "string", + label: "Font", + description: "The name of the font to be used in the Video Summary UI. All fonts available in the [Google Fonts](https://fonts.google.com/) are supported.", + optional: true, }, summaryURLExpiresIn: { - type: "string", - label: "Expiration Time of the Video Summary UI", - description: "Number of seconds set for expiration time of the Video Summary UI. Zero (0) will set the Video Summary UI to never expire. Default value is set to `2592000` (30 days).", - optional: true, + type: "string", + label: "Expiration Time of the Video Summary UI", + description: "Number of seconds set for expiration time of the Video Summary UI. Zero (0) will set the Video Summary UI to never expire. Default value is set to `2592000` (30 days).", + optional: true, }, readOnly: { - type: "boolean", - label: "Read Only", - description: "Disable the editing capabilities of the Video Summary UI. Default value is `false`.", - optional: true, + type: "boolean", + label: "Read Only", + description: "Disable the editing capabilities of the Video Summary UI. Default value is `false`.", + optional: true, }, enableCustomDomain: { - type: "boolean", - label: "Enable Custom Domain", - description: "Enable generation of personalized URLs for the Video Summary UI.", - optional: true, + type: "boolean", + label: "Enable Custom Domain", + description: "Enable generation of personalized URLs for the Video Summary UI.", + optional: true, }, }, async run({ $ }) { @@ -92,12 +92,12 @@ export default { logo: this.logo, favicon: this.favicon, color: { - background: this.background, - topicsFilter: this.topicsFilter, - insightsFilter: this.insightsFilter, + background: this.background, + topicsFilter: this.topicsFilter, + insightsFilter: this.insightsFilter, }, font: { - family: this.font, + family: this.font, }, summaryURLExpiresIn: this.summaryURLExpiresIn, readOnly: this.readOnly, From d2cf63aa12b22f576b39ac2bf40d0539f8848fda Mon Sep 17 00:00:00 2001 From: Marcelo Jabali Date: Wed, 16 Mar 2022 14:24:56 -0700 Subject: [PATCH 5/5] Addressed PR review suggestions --- .../post-video-summary-ui/post-video-summary-ui.mjs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs index c055c8fa662f5..6c22d2b4c4a18 100644 --- a/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs +++ b/components/symbl_ai/actions/post-video-summary-ui/post-video-summary-ui.mjs @@ -3,7 +3,7 @@ import symblAIApp from "../../symbl_ai.app.mjs"; export default { key: "symbl_ai-post-video-summary-ui", name: "Submit Video Summary User Interface", - description: "The Video Summary UI provides users the ability to interact with the Symbl elements (transcripts, Questions, Follow-Ups, Action Items, etc.) from a video conversation. See the doc [here](https://docs.symbl.ai/docs/async-api/overview/video/post-video-url)", + description: "The Video Summary UI provides users the ability to interact with the Symbl elements (Transcripts, Questions, Follow-Ups, Action Items, etc.) from a video conversation. See the doc [here](https://docs.symbl.ai/docs/api-reference/experience-api/post-video-summary-ui)", version: "0.0.1", type: "action", props: { @@ -19,12 +19,6 @@ export default { label: "Video URL", description: "URL of the video file for which you want to generate the video summary UI.", }, - name: { - type: "string", - label: "Name", - description: "Use `video-summary` for the Video Summary UI.", - default: "video-summary", - }, logo: { type: "string", label: "Logo", @@ -88,7 +82,7 @@ export default { conversationId: this.conversationId, data: { videoUrl: this.videoUrl, - name: this.name, + name: "video-summary", logo: this.logo, favicon: this.favicon, color: {