diff --git a/components/meetstream_ai/actions/create-bot/create-bot.mjs b/components/meetstream_ai/actions/create-bot/create-bot.mjs new file mode 100644 index 0000000000000..dfbc7e0d1def5 --- /dev/null +++ b/components/meetstream_ai/actions/create-bot/create-bot.mjs @@ -0,0 +1,74 @@ +import meetstreamAi from "../../meetstream_ai.app.mjs"; + +export default { + key: "meetstream_ai-create-bot", + name: "Create Bot", + 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)", + version: "0.0.1", + type: "action", + props: { + meetstreamAi, + meetingLink: { + type: "string", + label: "Meeting Link", + description: "The link to the meeting where the bot should join", + }, + botName: { + type: "string", + label: "Bot Name", + description: "The name of the bot", + optional: true, + }, + audioRequired: { + type: "boolean", + label: "Audio Required", + description: "Whether audio is required", + optional: true, + }, + videoRequired: { + type: "boolean", + label: "Video Required", + description: "Whether video is required", + optional: true, + }, + liveAudioRequired: { + type: "string", + label: "Live Audio Websocket URL", + description: "Specify websocket_url for live audio streaming", + optional: true, + }, + liveTranscriptionRequired: { + type: "string", + label: "Live Transcription Webhook URL", + description: "Specify webhook_url for live transcription", + optional: true, + }, + deepgramApiKey: { + type: "string", + label: "Deepgram API Key", + description: "This key is required if you use a **Google Meet** link and **Live Transcription Webhook URL** is specified", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.meetstreamAi.createBotInstance({ + $, + data: { + meeting_link: this.meetingLink, + bot_name: this.botName, + audio_required: this.audioRequired, + video_required: this.videoRequired, + live_audio_required: { + websocket_url: this.liveAudioRequired, + }, + live_transcription_required: { + deepgram_api_key: this.deepgramApiKey, + webhook_url: this.liveTranscriptionRequired, + }, + }, + }); + + $.export("$summary", `Successfully created bot instance for meeting link ${this.meetingLink}`); + return response; + }, +}; diff --git a/components/meetstream_ai/actions/get-audio/get-audio.mjs b/components/meetstream_ai/actions/get-audio/get-audio.mjs new file mode 100644 index 0000000000000..45de9a187ff3d --- /dev/null +++ b/components/meetstream_ai/actions/get-audio/get-audio.mjs @@ -0,0 +1,27 @@ +import meetstreamAi from "../../meetstream_ai.app.mjs"; + +export default { + key: "meetstream_ai-get-audio", + name: "Get Recorded Audio", + 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)", + version: "0.0.1", + type: "action", + props: { + meetstreamAi, + botId: { + propDefinition: [ + meetstreamAi, + "botId", + ], + }, + }, + async run({ $ }) { + const response = await this.meetstreamAi.getRecordedAudio({ + $, + botId: this.botId, + }); + + $.export("$summary", `Successfully retrieved recorded audio for bot ID ${this.botId}`); + return response; + }, +}; diff --git a/components/meetstream_ai/actions/get-bot-status/get-bot-status.mjs b/components/meetstream_ai/actions/get-bot-status/get-bot-status.mjs new file mode 100644 index 0000000000000..97d92d92f95bb --- /dev/null +++ b/components/meetstream_ai/actions/get-bot-status/get-bot-status.mjs @@ -0,0 +1,26 @@ +import meetstreamAi from "../../meetstream_ai.app.mjs"; + +export default { + key: "meetstream_ai-get-bot-status", + name: "Get Bot Status", + description: "Retrieves the current status of a specific bot. [See the documentation](https://vento.so/view/35d0142d-f91f-47f6-8175-d42e1953d6f1?utm_medium=share)", + version: "0.0.1", + type: "action", + props: { + meetstreamAi, + botId: { + propDefinition: [ + meetstreamAi, + "botId", + ], + }, + }, + async run({ $ }) { + const response = await this.meetstreamAi.getBotStatus({ + $, + botId: this.botId, + }); + $.export("$summary", `Successfully retrieved status for Bot ID ${this.botId}`); + return response; + }, +}; diff --git a/components/meetstream_ai/actions/get-transcription/get-transcription.mjs b/components/meetstream_ai/actions/get-transcription/get-transcription.mjs new file mode 100644 index 0000000000000..a96154ef22714 --- /dev/null +++ b/components/meetstream_ai/actions/get-transcription/get-transcription.mjs @@ -0,0 +1,30 @@ +import meetstreamAi from "../../meetstream_ai.app.mjs"; + +export default { + key: "meetstream_ai-get-transcription", + name: "Get Transcription", + 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)", + version: "0.0.1", + type: "action", + props: { + meetstreamAi, + botId: { + propDefinition: [ + meetstreamAi, + "botId", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.meetstreamAi.getTranscript({ + $, + botId: this.botId, + }); + $.export("$summary", `Successfully retrieved transcription for bot ID: ${this.botId}`); + return response; + } catch ({ response }) { + throw new Error(response.data); + } + }, +}; diff --git a/components/meetstream_ai/actions/remove-bot/remove-bot.mjs b/components/meetstream_ai/actions/remove-bot/remove-bot.mjs new file mode 100644 index 0000000000000..809269f627902 --- /dev/null +++ b/components/meetstream_ai/actions/remove-bot/remove-bot.mjs @@ -0,0 +1,27 @@ +import meetstreamAi from "../../meetstream_ai.app.mjs"; + +export default { + key: "meetstream_ai-remove-bot", + name: "Remove Bot", + 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)", + version: "0.0.1", + type: "action", + props: { + meetstreamAi, + botId: { + propDefinition: [ + meetstreamAi, + "botId", + ], + }, + }, + async run({ $ }) { + const response = await this.meetstreamAi.removeBotInstance({ + $, + botId: this.botId, + }); + + $.export("$summary", `Successfully removed bot with ID ${this.botId}`); + return response; + }, +}; diff --git a/components/meetstream_ai/meetstream_ai.app.mjs b/components/meetstream_ai/meetstream_ai.app.mjs index cb10fae67a7b4..831666fb3da80 100644 --- a/components/meetstream_ai/meetstream_ai.app.mjs +++ b/components/meetstream_ai/meetstream_ai.app.mjs @@ -1,11 +1,71 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "meetstream_ai", - propDefinitions: {}, + propDefinitions: { + botId: { + type: "string", + label: "Bot ID", + description: "The ID of the bot", + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api-meetstream-tst-hack.meetstream.ai/api/v1/bots"; + }, + _headers() { + return { + "Authorization": `Token ${this.$auth.api_key}`, + }; + }, + _makeRequest({ + $ = this, path = "", ...opts + }) { + return axios($, { + url: this._baseUrl() + path, + headers: this._headers(), + ...opts, + }); + }, + createBotInstance(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/create_bot", + ...opts, + }); + }, + getBotStatus({ + botId, ...opts + }) { + return this._makeRequest({ + path: `/${botId}/status`, + ...opts, + }); + }, + getRecordedAudio({ + botId, ...opts + }) { + return this._makeRequest({ + path: `/${botId}/get_audio`, + ...opts, + }); + }, + getTranscript({ + botId, ...opts + }) { + return this._makeRequest({ + path: `/${botId}/get_transcript`, + ...opts, + }); + }, + removeBotInstance({ + botId, ...opts + }) { + return this._makeRequest({ + path: `/${botId}/remove_bot`, + ...opts, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/meetstream_ai/package.json b/components/meetstream_ai/package.json index cd6b73f7e1283..15f981e278964 100644 --- a/components/meetstream_ai/package.json +++ b/components/meetstream_ai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/meetstream_ai", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Meetstream AI Components", "main": "meetstream_ai.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0e174ac54173..a952a928a4de6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7878,7 +7878,11 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/meetstream_ai: {} + components/meetstream_ai: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/meetup: {}