Skip to content

Commit 89b574b

Browse files
committed
Meetstream AI #16452
Actions - Create Bot - Get Bot Status - Get Audio - Get Transcription - Remove Bot
1 parent f584d10 commit 89b574b

File tree

7 files changed

+113
-140
lines changed

7 files changed

+113
-140
lines changed

components/meetstream_ai/actions/create-bot/create-bot.mjs

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,71 @@
1-
import meetstream_ai from "../../meetstream_ai.app.mjs";
2-
import { axios } from "@pipedream/platform";
1+
import meetstreamAi from "../../meetstream_ai.app.mjs";
32

43
export default {
54
key: "meetstream_ai-create-bot",
65
name: "Create Bot",
76
description: "Creates a new bot instance to join a meeting. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)",
8-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
98
type: "action",
109
props: {
11-
meetstream_ai,
10+
meetstreamAi,
1211
meetingLink: {
13-
propDefinition: [
14-
meetstream_ai,
15-
"meetingLink",
16-
],
12+
type: "string",
13+
label: "Meeting Link",
14+
description: "The link to the meeting where the bot should join",
1715
},
1816
botName: {
19-
propDefinition: [
20-
meetstream_ai,
21-
"botName",
22-
],
17+
type: "string",
18+
label: "Bot Name",
19+
description: "The name of the bot",
2320
optional: true,
2421
},
2522
audioRequired: {
26-
propDefinition: [
27-
meetstream_ai,
28-
"audioRequired",
29-
],
23+
type: "boolean",
24+
label: "Audio Required",
25+
description: "Whether audio is required",
3026
optional: true,
3127
},
3228
videoRequired: {
33-
propDefinition: [
34-
meetstream_ai,
35-
"videoRequired",
36-
],
29+
type: "boolean",
30+
label: "Video Required",
31+
description: "Whether video is required",
3732
optional: true,
3833
},
3934
liveAudioRequired: {
40-
propDefinition: [
41-
meetstream_ai,
42-
"liveAudioRequired",
43-
],
35+
type: "object",
36+
label: "Live Audio Websocket URL",
37+
description: "Specify websocket_url for live audio streaming",
4438
optional: true,
4539
},
4640
liveTranscriptionRequired: {
47-
propDefinition: [
48-
meetstream_ai,
49-
"liveTranscriptionRequired",
50-
],
41+
type: "object",
42+
label: "Live Transcription Webhook URL",
43+
description: "Specify webhook_url for live transcription",
44+
optional: true,
45+
},
46+
deepgramApiKey: {
47+
type: "string",
48+
label: "Deepgram API Key",
49+
description: "This key is required if you user **Google Meet** link and **Live Transcription Webhook URL** is specified",
5150
optional: true,
5251
},
5352
},
5453
async run({ $ }) {
55-
const response = await this.meetstream_ai.createBotInstance({
56-
meetingLink: this.meetingLink,
57-
botName: this.botName,
58-
audioRequired: this.audioRequired,
59-
videoRequired: this.videoRequired,
60-
liveAudioRequired: this.liveAudioRequired,
61-
liveTranscriptionRequired: this.liveTranscriptionRequired,
54+
const response = await this.meetstreamAi.createBotInstance({
55+
$,
56+
data: {
57+
meeting_link: this.meetingLink,
58+
bot_name: this.botName,
59+
audio_required: this.audioRequired,
60+
video_required: this.videoRequired,
61+
live_audio_required: {
62+
websocket_url: this.liveAudioRequired,
63+
},
64+
live_transcription_required: {
65+
deepgram_api_key: this.deepgramApiKey,
66+
webhook_url: this.liveTranscriptionRequired,
67+
},
68+
},
6269
});
6370

6471
$.export("$summary", `Successfully created bot instance for meeting link ${this.meetingLink}`);

components/meetstream_ai/actions/get-audio/get-audio.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
import meetstream_ai from "../../meetstream_ai.app.mjs";
1+
import meetstreamAi from "../../meetstream_ai.app.mjs";
22

33
export default {
44
key: "meetstream_ai-get-audio",
55
name: "Get Recorded Audio",
66
description: "Retrieves the recorded audio file for a specific bot, if available. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
10-
meetstream_ai,
10+
meetstreamAi,
1111
botId: {
1212
propDefinition: [
13-
meetstream_ai,
13+
meetstreamAi,
1414
"botId",
1515
],
1616
},
1717
},
1818
async run({ $ }) {
19-
const response = await this.meetstream_ai.getRecordedAudio({
19+
const response = await this.meetstreamAi.getRecordedAudio({
20+
$,
2021
botId: this.botId,
2122
});
2223

components/meetstream_ai/actions/get-bot-status/get-bot-status.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import meetstream_ai from "../../meetstream_ai.app.mjs";
2-
import { axios } from "@pipedream/platform";
1+
import meetstreamAi from "../../meetstream_ai.app.mjs";
32

43
export default {
54
key: "meetstream_ai-get-bot-status",
65
name: "Get Bot Status",
7-
description: "Retrieves the current status of a specific bot. [See the documentation]()",
8-
version: "0.0.{{ts}}",
6+
description: "Retrieves the current status of a specific bot. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)",
7+
version: "0.0.1",
98
type: "action",
109
props: {
11-
meetstream_ai,
10+
meetstreamAi,
1211
botId: {
1312
propDefinition: [
14-
meetstream_ai,
13+
meetstreamAi,
1514
"botId",
1615
],
1716
},
1817
},
1918
async run({ $ }) {
20-
const response = await this.meetstream_ai.getBotStatus({
19+
const response = await this.meetstreamAi.getBotStatus({
20+
$,
2121
botId: this.botId,
2222
});
2323
$.export("$summary", `Successfully retrieved status for Bot ID ${this.botId}`);
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
import meetstream_ai from "../../meetstream_ai.app.mjs";
1+
import meetstreamAi from "../../meetstream_ai.app.mjs";
22

33
export default {
44
key: "meetstream_ai-get-transcription",
55
name: "Get Transcription",
66
description: "Retrieves the transcript file for a specific bot, if available. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)",
7-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
88
type: "action",
99
props: {
10-
meetstream_ai,
10+
meetstreamAi,
1111
botId: {
1212
propDefinition: [
13-
meetstream_ai,
13+
meetstreamAi,
1414
"botId",
1515
],
1616
},
1717
},
1818
async run({ $ }) {
19-
const response = await this.meetstream_ai.getTranscript({
20-
botId: this.botId,
21-
});
22-
$.export("$summary", `Successfully retrieved transcription for bot ID: ${this.botId}`);
23-
return response;
19+
try {
20+
const response = await this.meetstreamAi.getTranscript({
21+
$,
22+
botId: this.botId,
23+
});
24+
$.export("$summary", `Successfully retrieved transcription for bot ID: ${this.botId}`);
25+
return response;
26+
} catch ({ response }) {
27+
throw new Error(response.data);
28+
}
2429
},
2530
};

components/meetstream_ai/actions/remove-bot/remove-bot.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import meetstream_ai from "../../meetstream_ai.app.mjs";
2-
import { axios } from "@pipedream/platform";
1+
import meetstreamAi from "../../meetstream_ai.app.mjs";
32

43
export default {
54
key: "meetstream_ai-remove-bot",
65
name: "Remove Bot",
76
description: "Removes a bot from its meeting and deletes its associated data. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)",
8-
version: "0.0.{{ts}}",
7+
version: "0.0.1",
98
type: "action",
109
props: {
11-
meetstream_ai,
10+
meetstreamAi,
1211
botId: {
1312
propDefinition: [
14-
meetstream_ai,
13+
meetstreamAi,
1514
"botId",
1615
],
1716
},
1817
},
1918
async run({ $ }) {
20-
const response = await this.meetstream_ai.removeBotInstance({
19+
const response = await this.meetstreamAi.removeBotInstance({
20+
$,
2121
botId: this.botId,
2222
});
2323

components/meetstream_ai/meetstream_ai.app.mjs

Lines changed: 34 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,110 +4,67 @@ export default {
44
type: "app",
55
app: "meetstream_ai",
66
propDefinitions: {
7-
meetingLink: {
8-
type: "string",
9-
label: "Meeting Link",
10-
description: "The link to the meeting where the bot should join",
11-
},
127
botId: {
138
type: "string",
149
label: "Bot ID",
1510
description: "The ID of the bot",
1611
},
17-
botName: {
18-
type: "string",
19-
label: "Bot Name",
20-
description: "The name of the bot",
21-
optional: true,
22-
},
23-
audioRequired: {
24-
type: "boolean",
25-
label: "Audio Required",
26-
description: "Whether audio is required",
27-
optional: true,
28-
},
29-
videoRequired: {
30-
type: "boolean",
31-
label: "Video Required",
32-
description: "Whether video is required",
33-
optional: true,
34-
},
35-
liveAudioRequired: {
36-
type: "boolean",
37-
label: "Live Audio Required",
38-
description: "Whether live audio is required",
39-
optional: true,
40-
},
41-
liveTranscriptionRequired: {
42-
type: "boolean",
43-
label: "Live Transcription Required",
44-
description: "Whether live transcription is required",
45-
optional: true,
46-
},
4712
},
4813
methods: {
4914
_baseUrl() {
50-
return "https://api.meetstream.ai";
15+
return "https://api-meetstream-tst-hack.meetstream.ai/api/v1/bots";
16+
},
17+
_headers() {
18+
return {
19+
"Authorization": `Token ${this.$auth.api_key}`,
20+
};
5121
},
52-
async _makeRequest(opts = {}) {
53-
const {
54-
$ = this, method = "GET", path = "/", headers, ...otherOpts
55-
} = opts;
22+
_makeRequest({
23+
$ = this, path = "", ...opts
24+
}) {
5625
return axios($, {
57-
...otherOpts,
58-
method,
5926
url: this._baseUrl() + path,
60-
headers: {
61-
...headers,
62-
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
63-
},
27+
headers: this._headers(),
28+
...opts,
6429
});
6530
},
66-
async createBotInstance(opts = {}) {
67-
const {
68-
meetingLink,
69-
botName,
70-
audioRequired,
71-
videoRequired,
72-
liveAudioRequired,
73-
liveTranscriptionRequired,
74-
} = opts;
31+
createBotInstance(opts = {}) {
7532
return this._makeRequest({
7633
method: "POST",
77-
path: "/bots",
78-
data: {
79-
meeting_link: meetingLink,
80-
bot_name: botName,
81-
audio_required: audioRequired,
82-
video_required: videoRequired,
83-
live_audio_required: liveAudioRequired,
84-
live_transcription_required: liveTranscriptionRequired,
85-
},
34+
path: "/create_bot",
35+
...opts,
8636
});
8737
},
88-
async getBotStatus(opts = {}) {
89-
const { botId } = opts;
38+
getBotStatus({
39+
botId, ...opts
40+
}) {
9041
return this._makeRequest({
91-
path: `/bots/${botId}/status`,
42+
path: `/${botId}/status`,
43+
...opts,
9244
});
9345
},
94-
async getRecordedAudio(opts = {}) {
95-
const { botId } = opts;
46+
getRecordedAudio({
47+
botId, ...opts
48+
}) {
9649
return this._makeRequest({
97-
path: `/bots/${botId}/audio`,
50+
path: `/${botId}/get_audio`,
51+
...opts,
9852
});
9953
},
100-
async getTranscript(opts = {}) {
101-
const { botId } = opts;
54+
getTranscript({
55+
botId, ...opts
56+
}) {
10257
return this._makeRequest({
103-
path: `/bots/${botId}/transcript`,
58+
path: `/${botId}/get_transcript`,
59+
...opts,
10460
});
10561
},
106-
async removeBotInstance(opts = {}) {
107-
const { botId } = opts;
62+
removeBotInstance({
63+
botId, ...opts
64+
}) {
10865
return this._makeRequest({
109-
method: "DELETE",
110-
path: `/bots/${botId}`,
66+
path: `/${botId}/remove_bot`,
67+
...opts,
11168
});
11269
},
11370
},

components/meetstream_ai/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/meetstream_ai",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Meetstream AI Components",
55
"main": "meetstream_ai.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
1518
}

0 commit comments

Comments
 (0)