@taskmagic/apps-greenpt 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +47 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +51 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/chat-completion.d.ts +4 -0
- package/src/lib/actions/chat-completion.js +59 -0
- package/src/lib/actions/chat-completion.js.map +1 -0
- package/src/lib/actions/create-embeddings.d.ts +4 -0
- package/src/lib/actions/create-embeddings.js +55 -0
- package/src/lib/actions/create-embeddings.js.map +1 -0
- package/src/lib/actions/transcribe-audio.d.ts +13 -0
- package/src/lib/actions/transcribe-audio.js +133 -0
- package/src/lib/actions/transcribe-audio.js.map +1 -0
- package/src/lib/common/auth.d.ts +1 -0
- package/src/lib/common/auth.js +10 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +3 -0
- package/src/lib/common/client.js +27 -0
- package/src/lib/common/client.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taskmagic/apps-greenpt",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@anthropic-ai/sdk": "0.33.1",
|
|
6
|
+
"@sinclair/typebox": "0.34.11",
|
|
7
|
+
"axios": "1.17.0",
|
|
8
|
+
"axios-retry": "4.4.1",
|
|
9
|
+
"deepmerge-ts": "7.1.0",
|
|
10
|
+
"mime-types": "2.1.35",
|
|
11
|
+
"nanoid": "3.3.8",
|
|
12
|
+
"openai": "4.67.1",
|
|
13
|
+
"replicate": "0.34.1",
|
|
14
|
+
"semver": "7.6.0",
|
|
15
|
+
"zod": "3.25.76",
|
|
16
|
+
"@taskmagic/pieces-common": "0.4.4",
|
|
17
|
+
"@taskmagic/pieces-framework": "0.7.46",
|
|
18
|
+
"@taskmagic/shared": "0.10.171",
|
|
19
|
+
"tslib": "1.14.1"
|
|
20
|
+
},
|
|
21
|
+
"overrides": {
|
|
22
|
+
"cross-spawn": "7.0.6",
|
|
23
|
+
"elliptic": "^6.6.1",
|
|
24
|
+
"fast-xml-parser": "^4.4.1",
|
|
25
|
+
"protobufjs": "^7.5.5",
|
|
26
|
+
"tmp": "^0.2.4",
|
|
27
|
+
"koa": "^2.16.4",
|
|
28
|
+
"picomatch": "^4.0.4",
|
|
29
|
+
"langsmith": "^0.6.0",
|
|
30
|
+
"serialize-javascript": "^6.0.2",
|
|
31
|
+
"elevenlabs": {
|
|
32
|
+
"form-data": "^4.0.4"
|
|
33
|
+
},
|
|
34
|
+
"@tryfabric/martian": {
|
|
35
|
+
"@notionhq/client": "$@notionhq/client"
|
|
36
|
+
},
|
|
37
|
+
"vite": {
|
|
38
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"resolutions": {
|
|
42
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
43
|
+
},
|
|
44
|
+
"types": "./src/index.d.ts",
|
|
45
|
+
"main": "./src/index.js",
|
|
46
|
+
"type": "commonjs"
|
|
47
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const greenpt: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.greenpt = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const shared_1 = require("@taskmagic/shared");
|
|
7
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
const chat_completion_1 = require("./lib/actions/chat-completion");
|
|
10
|
+
const create_embeddings_1 = require("./lib/actions/create-embeddings");
|
|
11
|
+
const transcribe_audio_1 = require("./lib/actions/transcribe-audio");
|
|
12
|
+
exports.greenpt = (0, pieces_framework_1.createPiece)({
|
|
13
|
+
displayName: 'GreenPT',
|
|
14
|
+
description: 'GreenPT is a green AI and privacy friendly GPT-powered chat platform',
|
|
15
|
+
auth: auth_1.greenptAuth,
|
|
16
|
+
minimumSupportedRelease: '0.30.0',
|
|
17
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/greenpt.png',
|
|
18
|
+
authors: ['sanket-a11y'],
|
|
19
|
+
categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
|
20
|
+
ai: {
|
|
21
|
+
description: 'Chat with GreenPT, a privacy-friendly green AI: ask a question and get a completion, generate text embeddings for semantic search, and transcribe audio files to text.',
|
|
22
|
+
keywords: [
|
|
23
|
+
'green ai',
|
|
24
|
+
'privacy',
|
|
25
|
+
'chat completion',
|
|
26
|
+
'llm',
|
|
27
|
+
'ask ai',
|
|
28
|
+
'embeddings',
|
|
29
|
+
'semantic search',
|
|
30
|
+
'transcribe',
|
|
31
|
+
'speech to text',
|
|
32
|
+
'audio transcription',
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
actions: [
|
|
36
|
+
chat_completion_1.chatCompletion,
|
|
37
|
+
create_embeddings_1.createEmbeddings,
|
|
38
|
+
transcribe_audio_1.transcribeAudio,
|
|
39
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
40
|
+
auth: auth_1.greenptAuth,
|
|
41
|
+
baseUrl: () => `https://api.greenpt.ai/v1`,
|
|
42
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
return {
|
|
44
|
+
Authorization: `Bearer ${auth}`,
|
|
45
|
+
};
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
triggers: [],
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/greenpt/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4DAAqE;AACrE,4CAAgD;AAChD,mEAA+D;AAC/D,uEAAmE;AACnE,qEAAiE;AAEpD,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,sEAAsE;IACxE,IAAI,EAAE,kBAAW;IACjB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,EAAE,EAAE;QACF,WAAW,EACT,wKAAwK;QAC1K,QAAQ,EAAE;YACR,UAAU;YACV,SAAS;YACT,iBAAiB;YACjB,KAAK;YACL,QAAQ;YACR,YAAY;YACZ,iBAAiB;YACjB,YAAY;YACZ,gBAAgB;YAChB,qBAAqB;SACtB;KACF;IACD,OAAO,EAAE;QACP,gCAAc;QACd,oCAAgB;QAChB,kCAAe;QACf,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAW;YACjB,OAAO,EAAE,GAAG,EAAE,CAAC,2BAA2B;YAC1C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,EAAE;iBAChC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const chatCompletion: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
model: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
+
messages: import("@taskmagic/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatCompletion = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
const client_1 = require("../common/client");
|
|
8
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
9
|
+
exports.chatCompletion = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.greenptAuth,
|
|
11
|
+
name: 'chatCompletion',
|
|
12
|
+
displayName: 'Ask GreenPT',
|
|
13
|
+
description: '',
|
|
14
|
+
props: {
|
|
15
|
+
model: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
+
displayName: 'Model',
|
|
17
|
+
description: 'The model to use ',
|
|
18
|
+
required: true,
|
|
19
|
+
options: {
|
|
20
|
+
disabled: false,
|
|
21
|
+
options: [
|
|
22
|
+
{
|
|
23
|
+
label: 'Green L',
|
|
24
|
+
value: 'green-l',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'Green L Raw',
|
|
28
|
+
value: 'green-l-raw',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Green R',
|
|
32
|
+
value: 'green-r',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Green R Raw',
|
|
36
|
+
value: 'green-r-raw',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
messages: pieces_framework_1.Property.LongText({
|
|
42
|
+
displayName: 'Message',
|
|
43
|
+
description: 'Message to send',
|
|
44
|
+
required: true,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
run(context) {
|
|
48
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const { model, messages } = context.propsValue;
|
|
50
|
+
const response = yield (0, client_1.makeRequest)(context.auth, pieces_common_1.HttpMethod.POST, '/chat/completions', {
|
|
51
|
+
model,
|
|
52
|
+
messages: [{ role: 'user', content: messages }],
|
|
53
|
+
stream: false,
|
|
54
|
+
});
|
|
55
|
+
return response.choices[0].message.content;
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=chat-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/greenpt/src/lib/actions/chat-completion.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,yCAA6C;AAC7C,6CAA+C;AAC/C,4DAAsD;AAEzC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,EAAE;IACf,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,KAAK,EAAE,aAAa;wBACpB,KAAK,EAAE,aAAa;qBACrB;oBACD;wBACE,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,KAAK,EAAE,aAAa;wBACpB,KAAK,EAAE,aAAa;qBACrB;iBACF;aACF;SACF,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE/C,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAc,EACtB,0BAAU,CAAC,IAAI,EACf,mBAAmB,EACnB;gBACE,KAAK;gBACL,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;gBAC/C,MAAM,EAAE,KAAK;aACd,CACF,CAAC;YAEF,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAC7C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const createEmbeddings: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
input: import("@taskmagic/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
encoding_format: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEmbeddings = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
const client_1 = require("../common/client");
|
|
8
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
9
|
+
exports.createEmbeddings = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.greenptAuth,
|
|
11
|
+
name: 'createEmbeddings',
|
|
12
|
+
displayName: 'Create Embeddings',
|
|
13
|
+
description: 'Generate embeddings for text input using GreenPT models for semantic search and similarity matching',
|
|
14
|
+
props: {
|
|
15
|
+
input: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Input Text',
|
|
17
|
+
description: 'Input text to embed. Can be a single string or multiple texts separated by newlines',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
encoding_format: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
+
displayName: 'Encoding Format',
|
|
22
|
+
description: 'The format to return the embeddings in',
|
|
23
|
+
required: false,
|
|
24
|
+
defaultValue: 'float',
|
|
25
|
+
options: {
|
|
26
|
+
disabled: false,
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Float',
|
|
30
|
+
value: 'float',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'Base64',
|
|
34
|
+
value: 'base64',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
run(context) {
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const { input, encoding_format } = context.propsValue;
|
|
43
|
+
const inputData = input.includes('\n')
|
|
44
|
+
? input.split('\n').filter((line) => line.trim().length > 0)
|
|
45
|
+
: input;
|
|
46
|
+
const response = yield (0, client_1.makeRequest)(context.auth, pieces_common_1.HttpMethod.POST, '/embeddings', {
|
|
47
|
+
model: 'green-embedding',
|
|
48
|
+
input: inputData,
|
|
49
|
+
encoding_format: encoding_format,
|
|
50
|
+
});
|
|
51
|
+
return response;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=create-embeddings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-embeddings.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/greenpt/src/lib/actions/create-embeddings.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,yCAA6C;AAC7C,6CAA+C;AAC/C,4DAAsD;AAEzC,QAAA,gBAAgB,GAAG,IAA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AAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const transcribeAudio: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
audioUrl: import("@taskmagic/pieces-framework").FileProperty<true>;
|
|
3
|
+
model: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
|
|
4
|
+
language: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
diarize: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
6
|
+
punctuate: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
smart_format: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
filler_words: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
numerals: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
sentiment: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
topics: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
intents: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transcribeAudio = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
7
|
+
const auth_1 = require("../common/auth");
|
|
8
|
+
exports.transcribeAudio = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.greenptAuth,
|
|
10
|
+
name: 'transcribeAudio',
|
|
11
|
+
displayName: 'Transcribe Audio',
|
|
12
|
+
description: 'Transcribe pre-recorded audio files with speaker diarization and advanced features',
|
|
13
|
+
props: {
|
|
14
|
+
audioUrl: pieces_framework_1.Property.File({
|
|
15
|
+
displayName: 'Audio File',
|
|
16
|
+
description: 'Audio file to transcribe (WAV, MP3, FLAC, etc.)',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
model: pieces_framework_1.Property.StaticDropdown({
|
|
20
|
+
displayName: 'Model',
|
|
21
|
+
description: 'Speech-to-text model to use',
|
|
22
|
+
required: false,
|
|
23
|
+
defaultValue: 'green-s',
|
|
24
|
+
options: {
|
|
25
|
+
disabled: false,
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
label: 'Green S',
|
|
29
|
+
value: 'green-s',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Green S Pro',
|
|
33
|
+
value: 'green-s-pro',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
language: pieces_framework_1.Property.ShortText({
|
|
39
|
+
displayName: 'Language',
|
|
40
|
+
description: 'Language code (e.g., en, fr, de). Auto-detected if not specified',
|
|
41
|
+
required: false,
|
|
42
|
+
}),
|
|
43
|
+
diarize: pieces_framework_1.Property.Checkbox({
|
|
44
|
+
displayName: 'Speaker Diarization',
|
|
45
|
+
description: 'Enable speaker diarization to identify different speakers',
|
|
46
|
+
required: false,
|
|
47
|
+
defaultValue: false,
|
|
48
|
+
}),
|
|
49
|
+
punctuate: pieces_framework_1.Property.Checkbox({
|
|
50
|
+
displayName: 'Punctuate',
|
|
51
|
+
description: 'Add punctuation and capitalization to transcript',
|
|
52
|
+
required: false,
|
|
53
|
+
defaultValue: true,
|
|
54
|
+
}),
|
|
55
|
+
smart_format: pieces_framework_1.Property.Checkbox({
|
|
56
|
+
displayName: 'Smart Format',
|
|
57
|
+
description: 'Apply formatting to transcript output for improved readability',
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: false,
|
|
60
|
+
}),
|
|
61
|
+
filler_words: pieces_framework_1.Property.Checkbox({
|
|
62
|
+
displayName: 'Include Filler Words',
|
|
63
|
+
description: 'Include filler words like "uh" and "um" in transcript',
|
|
64
|
+
required: false,
|
|
65
|
+
defaultValue: false,
|
|
66
|
+
}),
|
|
67
|
+
numerals: pieces_framework_1.Property.Checkbox({
|
|
68
|
+
displayName: 'Convert Numerals',
|
|
69
|
+
description: 'Convert numbers from written format to numerical format',
|
|
70
|
+
required: false,
|
|
71
|
+
defaultValue: false,
|
|
72
|
+
}),
|
|
73
|
+
sentiment: pieces_framework_1.Property.Checkbox({
|
|
74
|
+
displayName: 'Analyze Sentiment',
|
|
75
|
+
description: 'Analyze sentiment throughout the transcript',
|
|
76
|
+
required: false,
|
|
77
|
+
defaultValue: false,
|
|
78
|
+
}),
|
|
79
|
+
topics: pieces_framework_1.Property.Checkbox({
|
|
80
|
+
displayName: 'Detect Topics',
|
|
81
|
+
description: 'Detect topics throughout the transcript',
|
|
82
|
+
required: false,
|
|
83
|
+
defaultValue: false,
|
|
84
|
+
}),
|
|
85
|
+
intents: pieces_framework_1.Property.Checkbox({
|
|
86
|
+
displayName: 'Recognize Intents',
|
|
87
|
+
description: 'Recognize speaker intent throughout the transcript',
|
|
88
|
+
required: false,
|
|
89
|
+
defaultValue: false,
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
run(context) {
|
|
93
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const { audioUrl, model, language, diarize, punctuate, smart_format, filler_words, numerals, sentiment, topics, intents, } = context.propsValue;
|
|
95
|
+
const queryParams = new URLSearchParams();
|
|
96
|
+
if (model) {
|
|
97
|
+
queryParams.append('model', model);
|
|
98
|
+
}
|
|
99
|
+
if (language) {
|
|
100
|
+
queryParams.append('language', language);
|
|
101
|
+
}
|
|
102
|
+
if (diarize)
|
|
103
|
+
queryParams.append('diarize', 'true');
|
|
104
|
+
if (punctuate)
|
|
105
|
+
queryParams.append('punctuate', 'true');
|
|
106
|
+
if (smart_format)
|
|
107
|
+
queryParams.append('smart_format', 'true');
|
|
108
|
+
if (filler_words)
|
|
109
|
+
queryParams.append('filler_words', 'true');
|
|
110
|
+
if (numerals)
|
|
111
|
+
queryParams.append('numerals', 'true');
|
|
112
|
+
if (sentiment)
|
|
113
|
+
queryParams.append('sentiment', 'true');
|
|
114
|
+
if (topics)
|
|
115
|
+
queryParams.append('topics', 'true');
|
|
116
|
+
if (intents)
|
|
117
|
+
queryParams.append('intents', 'true');
|
|
118
|
+
const url = `https://api.greenpt.ai/v1/listen?${queryParams.toString()}`;
|
|
119
|
+
const fileData = audioUrl.data;
|
|
120
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
121
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
122
|
+
url: url,
|
|
123
|
+
headers: {
|
|
124
|
+
Authorization: `Token ${context.auth}`,
|
|
125
|
+
'Content-Type': 'audio/wav',
|
|
126
|
+
},
|
|
127
|
+
body: fileData,
|
|
128
|
+
});
|
|
129
|
+
return response.body.results.channels[0].alternatives[0].transcript;
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=transcribe-audio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcribe-audio.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/greenpt/src/lib/actions/transcribe-audio.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AAErE,4DAAkE;AAClE,yCAA6C;AAEhC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,oFAAoF;IACtF,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACtB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,6BAA6B;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,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACrD,IAAI,SAAS;gBAAE,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YACvD,IAAI,MAAM;gBAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACjD,IAAI,OAAO;gBAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAEnD,MAAM,GAAG,GAAG,oCAAoC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC;YAEzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;YAE/B,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG;gBACR,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,OAAO,CAAC,IAAc,EAAE;oBAChD,cAAc,EAAE,WAAW;iBAC5B;gBACD,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QACtE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const greenptAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.greenptAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
5
|
+
exports.greenptAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
6
|
+
displayName: 'API Key',
|
|
7
|
+
description: 'API Key for GreenPT',
|
|
8
|
+
required: true,
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/greenpt/src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,kEAAwD;AAE3C,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,qBAAqB;IAClC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BASE_URL = void 0;
|
|
4
|
+
exports.makeRequest = makeRequest;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
7
|
+
exports.BASE_URL = `https://api.greenpt.ai/v1`;
|
|
8
|
+
function makeRequest(apikey, method, path, body) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
try {
|
|
11
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
12
|
+
method,
|
|
13
|
+
url: `${exports.BASE_URL}${path}`,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${apikey}`,
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
},
|
|
18
|
+
body,
|
|
19
|
+
});
|
|
20
|
+
return response.body;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error(`Unexpected error: ${error.message || String(error)}`);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/greenpt/src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAoBC;;AAxBD,4DAAkE;AAErD,QAAA,QAAQ,GAAG,2BAA2B,CAAC;AAEpD,SAAsB,WAAW,CAC/B,MAAc,EACd,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;gBACzB,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,MAAM,EAAE;oBACjC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CAAA"}
|