Skip to content

Commit 28d862c

Browse files
committed
feat: add aibots app and action
1 parent 5c08e0b commit 28d862c

File tree

6 files changed

+99
-0
lines changed

6 files changed

+99
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import sendQuery from './send-query'
2+
3+
export default [sendQuery]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { IRawAction } from '@plumber/types'
2+
3+
const action: IRawAction = {
4+
name: 'Send Query',
5+
key: 'sendQuery',
6+
description: 'Sends a query to your customised AI Bot',
7+
arguments: [
8+
{
9+
label: 'Query',
10+
key: 'query',
11+
type: 'rich-text' as const,
12+
required: true,
13+
variables: true,
14+
returnMarkdown: true,
15+
},
16+
],
17+
18+
async run($) {
19+
const query = $.step.parameters.query
20+
21+
// TODO: add the actual API call here
22+
const formData = new FormData()
23+
formData.append('query', query)
24+
25+
$.setActionItem({
26+
raw: {
27+
query,
28+
},
29+
})
30+
},
31+
}
32+
33+
export default action

packages/backend/src/apps/aibots/assets/favicon.svg

Lines changed: 39 additions & 0 deletions
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { IApp } from '@plumber/types'
2+
3+
import actions from './actions'
4+
5+
const app: IApp = {
6+
name: 'AIBots',
7+
key: 'aibots',
8+
description: 'Integrate with your customised AI Bot',
9+
iconUrl: '{BASE_URL}/apps/aibots/assets/favicon.svg',
10+
authDocUrl: '',
11+
baseUrl: '',
12+
apiBaseUrl: '',
13+
primaryColor: '',
14+
category: 'ai',
15+
// TODO: add the actual auth here
16+
// auth,
17+
actions,
18+
}
19+
20+
export default app

packages/backend/src/apps/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { IApp } from '@plumber/types'
22

3+
import aibotsApp from './aibots'
34
import aisayApp from './aisay'
45
import calculatorApp from './calculator'
56
import customApiApp from './custom-api'
@@ -40,6 +41,7 @@ const apps: Record<string, IApp> = {
4041
[twilioApp.key]: twilioApp,
4142
[vaultWorkspaceApp.key]: vaultWorkspaceApp,
4243
[webhookApp.key]: webhookApp,
44+
[aibotsApp.key]: aibotsApp,
4345
[aisayApp.key]: aisayApp,
4446
[gathersgApp.key]: gathersgApp,
4547
}

packages/backend/src/graphql/queries/get-apps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { IApp } from '@plumber/types'
22

3+
import aibotsApp from '@/apps/aibots'
34
import aisayApp from '@/apps/aisay'
45
import calculatorApp from '@/apps/calculator'
56
import customApiApp from '@/apps/custom-api'
@@ -52,6 +53,7 @@ export const ACTION_APPS_RANKING = [
5253
postmanSmsApp.key,
5354
telegramBotApp.key,
5455
slackApp.key,
56+
aibotsApp.key,
5557
aisayApp.key,
5658
gathersgApp.key,
5759
customApiApp.key,

0 commit comments

Comments
 (0)