Skip to content

Commit 0663fd3

Browse files
authored
Added Video Summary UI and Summary actions (#2442)
* Added Post Video Summary UI action * Added Post Video Summary UI action * Added GET Summary action * Fixed eslint issues * Addressed PR review suggestions
1 parent d240752 commit 0663fd3

File tree

3 files changed

+175
-0
lines changed

3 files changed

+175
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import symblAIApp from "../../symbl_ai.app.mjs";
2+
3+
export default {
4+
key: "symbl_ai-get-summary",
5+
name: "Get Summary",
6+
description: "Get a summary of important contextual messages in a conversation. See the doc [here](https://docs.symbl.ai/docs/conversation-api/summary)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
symblAIApp,
11+
conversationId: {
12+
propDefinition: [
13+
symblAIApp,
14+
"conversationId",
15+
],
16+
},
17+
refresh: {
18+
type: "boolean",
19+
label: "Refresh",
20+
description: "Allows you to regenerate the Summary (Async APIs), create summary (Telephony and Streaming APIs) and generate the Summary for already processed conversations.",
21+
optional: true,
22+
default: false,
23+
},
24+
},
25+
async run({ $ }) {
26+
try {
27+
const { summary } = await this.symblAIApp.getSummary({
28+
$,
29+
conversationId: this.conversationId,
30+
params: {
31+
refresh: this.refresh,
32+
},
33+
});
34+
$.export("$summary", `Successfully generated ${summary.length} Summary message${summary.length === 1
35+
? ""
36+
: "s"} from the conversation`);
37+
return summary;
38+
} catch (error) {
39+
console.log("Error: ", error);
40+
$.export("$summary", "Failed to generate the Summary of the conversation");
41+
}
42+
},
43+
};
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import symblAIApp from "../../symbl_ai.app.mjs";
2+
3+
export default {
4+
key: "symbl_ai-post-video-summary-ui",
5+
name: "Submit Video Summary User Interface",
6+
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)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
symblAIApp,
11+
conversationId: {
12+
propDefinition: [
13+
symblAIApp,
14+
"conversationId",
15+
],
16+
},
17+
videoUrl: {
18+
type: "string",
19+
label: "Video URL",
20+
description: "URL of the video file for which you want to generate the video summary UI.",
21+
},
22+
logo: {
23+
type: "string",
24+
label: "Logo",
25+
description: "URL of the custom logo to be used in the Video Summary UI.",
26+
optional: true,
27+
},
28+
favicon: {
29+
type: "string",
30+
label: "Favicon",
31+
description: "URL of the custom favicon to be used in the Video Summary UI.",
32+
optional: true,
33+
},
34+
background: {
35+
type: "string",
36+
label: "Background Color",
37+
description: "Background color to be used in the Video Summary UI. Hex Color Codes accepted.",
38+
optional: true,
39+
},
40+
topicsFilter: {
41+
type: "string",
42+
label: "Topics Filter Element Color",
43+
description: "Topics Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.",
44+
optional: true,
45+
},
46+
insightsFilter: {
47+
type: "string",
48+
label: "Insights Element Color",
49+
description: "Insights (Questions, Follow-ups, Action Items, etc) Filter Element color to be used in the Video Summary UI. Hex Color Codes accepted.",
50+
optional: true,
51+
},
52+
font: {
53+
type: "string",
54+
label: "Font",
55+
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.",
56+
optional: true,
57+
},
58+
summaryURLExpiresIn: {
59+
type: "string",
60+
label: "Expiration Time of the Video Summary UI",
61+
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).",
62+
optional: true,
63+
},
64+
readOnly: {
65+
type: "boolean",
66+
label: "Read Only",
67+
description: "Disable the editing capabilities of the Video Summary UI. Default value is `false`.",
68+
optional: true,
69+
},
70+
enableCustomDomain: {
71+
type: "boolean",
72+
label: "Enable Custom Domain",
73+
description: "Enable generation of personalized URLs for the Video Summary UI.",
74+
optional: true,
75+
},
76+
},
77+
async run({ $ }) {
78+
try {
79+
const response =
80+
await this.symblAIApp.postVideoSummaryUI({
81+
$,
82+
conversationId: this.conversationId,
83+
data: {
84+
videoUrl: this.videoUrl,
85+
name: "video-summary",
86+
logo: this.logo,
87+
favicon: this.favicon,
88+
color: {
89+
background: this.background,
90+
topicsFilter: this.topicsFilter,
91+
insightsFilter: this.insightsFilter,
92+
},
93+
font: {
94+
family: this.font,
95+
},
96+
summaryURLExpiresIn: this.summaryURLExpiresIn,
97+
readOnly: this.readOnly,
98+
enableCustomDomain: this.enableCustomDomain,
99+
},
100+
});
101+
$.export("$summary", `Successfully generated Video Summary UI at: ${response.url}`);
102+
return response;
103+
} catch (error) {
104+
console.log("Error: ", error);
105+
$.export("summary", "Failed to post Video Summary UI.");
106+
}
107+
},
108+
};

components/symbl_ai/symbl_ai.app.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ export default {
7070
path: `/job/${jobId}`,
7171
});
7272
},
73+
async postVideoSummaryUI({
74+
$,
75+
conversationId,
76+
data,
77+
}) {
78+
return this.makeRequest({
79+
$,
80+
method: "post",
81+
path: `/conversations/${conversationId}/experiences`,
82+
data,
83+
});
84+
},
7385
async getSpeechToText({
7486
$,
7587
conversationId,
@@ -129,5 +141,17 @@ export default {
129141
params,
130142
});
131143
},
144+
async getSummary({
145+
$,
146+
conversationId,
147+
params,
148+
}) {
149+
return this.makeRequest({
150+
$,
151+
path: `/conversations/${conversationId}/summary`,
152+
params,
153+
});
154+
},
155+
132156
},
133157
};

0 commit comments

Comments
 (0)