@taskmagic/apps-vlm-run 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 ADDED
@@ -0,0 +1,7 @@
1
+ # apps-vlm-run
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build apps-vlm-run` to build the library.
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@taskmagic/apps-vlm-run",
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
+ "form-data": "4.0.5",
11
+ "mime-types": "2.1.35",
12
+ "nanoid": "3.3.8",
13
+ "openai": "4.67.1",
14
+ "replicate": "0.34.1",
15
+ "semver": "7.6.0",
16
+ "zod": "3.25.76",
17
+ "@taskmagic/pieces-common": "0.4.4",
18
+ "@taskmagic/pieces-framework": "0.7.46",
19
+ "@taskmagic/shared": "0.10.171",
20
+ "tslib": "1.14.1"
21
+ },
22
+ "overrides": {
23
+ "cross-spawn": "7.0.6",
24
+ "elliptic": "^6.6.1",
25
+ "fast-xml-parser": "^4.4.1",
26
+ "protobufjs": "^7.5.5",
27
+ "tmp": "^0.2.4",
28
+ "koa": "^2.16.4",
29
+ "picomatch": "^4.0.4",
30
+ "langsmith": "^0.6.0",
31
+ "serialize-javascript": "^6.0.2",
32
+ "elevenlabs": {
33
+ "form-data": "^4.0.4"
34
+ },
35
+ "@tryfabric/martian": {
36
+ "@notionhq/client": "$@notionhq/client"
37
+ },
38
+ "vite": {
39
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
40
+ }
41
+ },
42
+ "resolutions": {
43
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
44
+ },
45
+ "types": "./src/index.d.ts",
46
+ "main": "./src/index.js",
47
+ "type": "commonjs"
48
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const vlmRun: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vlmRun = 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 shared_1 = require("@taskmagic/shared");
8
+ const analyze_audio_1 = require("./lib/actions/analyze-audio");
9
+ const analyze_document_1 = require("./lib/actions/analyze-document");
10
+ const analyze_image_1 = require("./lib/actions/analyze-image");
11
+ const analyze_video_1 = require("./lib/actions/analyze-video");
12
+ const get_file_1 = require("./lib/actions/get-file");
13
+ const common_1 = require("./lib/common");
14
+ exports.vlmRun = (0, pieces_framework_1.createPiece)({
15
+ displayName: 'VLM Run',
16
+ description: 'VLM Run is a visual AI platform that extracts data from images, videos, audio, and documents. It helps automate analysis workflows, such as object detection, transcription, image/audio analysis, and document parsing.',
17
+ auth: common_1.vlmRunAuth,
18
+ minimumSupportedRelease: '0.30.0',
19
+ categories: [
20
+ shared_1.PieceCategory.BUSINESS_INTELLIGENCE,
21
+ shared_1.PieceCategory.CONTENT_AND_FILES,
22
+ ],
23
+ logoUrl: 'https://cdn.activepieces.com/pieces/vlm-run.png',
24
+ authors: ['LuizDMM', 'sanket-a11y'],
25
+ actions: [
26
+ analyze_audio_1.analyzeAudio,
27
+ analyze_image_1.analyzeImage,
28
+ analyze_document_1.analyzeDocument,
29
+ analyze_video_1.analyzeVideo,
30
+ get_file_1.getFile,
31
+ (0, pieces_common_1.createCustomApiCallAction)({
32
+ auth: common_1.vlmRunAuth,
33
+ baseUrl: () => 'https://api.vlm.run/v1',
34
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
+ return {
36
+ Authorization: `Bearer ${auth}`,
37
+ };
38
+ }),
39
+ }),
40
+ ],
41
+ triggers: [],
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/vlm-run/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,4DAAqE;AACrE,8CAAkD;AAClD,+DAA2D;AAC3D,qEAAiE;AACjE,+DAA2D;AAC3D,+DAA2D;AAC3D,qDAAiD;AACjD,yCAA0C;AAE7B,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,0NAA0N;IAC5N,IAAI,EAAE,mBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,UAAU,EAAE;QACV,sBAAa,CAAC,qBAAqB;QACnC,sBAAa,CAAC,iBAAiB;KAChC;IACD,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACnC,OAAO,EAAE;QACP,4BAAY;QACZ,4BAAY;QACZ,kCAAe;QACf,4BAAY;QACZ,kBAAO;QACP,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,mBAAU;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;YACvC,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAc,EAAE;iBAC1C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const analyzeAudio: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ audio: import("@taskmagic/pieces-framework").FileProperty<true>;
3
+ }>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analyzeAudio = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const properties_1 = require("../common/properties");
9
+ const schemas_1 = require("../common/schemas");
10
+ exports.analyzeAudio = (0, pieces_framework_1.createAction)({
11
+ auth: common_1.vlmRunAuth,
12
+ name: 'analyzeAudio',
13
+ displayName: 'Analyze Audio',
14
+ description: 'Process an audio file, extracting features or transcription',
15
+ props: properties_1.analyzeAudioProperties,
16
+ run(_a) {
17
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
18
+ yield pieces_common_1.propsValidation.validateZod(propsValue, schemas_1.analyzeAudioSchema);
19
+ const apiKey = auth;
20
+ const uploadResponse = yield common_1.vlmRunCommon.uploadFile({
21
+ apiKey,
22
+ file: propsValue.audio,
23
+ });
24
+ const response = yield common_1.vlmRunCommon.analyzeAudio({
25
+ apiKey,
26
+ file_id: uploadResponse.id,
27
+ });
28
+ return yield common_1.vlmRunCommon.getresponse(apiKey, response.id, response.status);
29
+ });
30
+ },
31
+ });
32
+ //# sourceMappingURL=analyze-audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-audio.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/actions/analyze-audio.ts"],"names":[],"mappings":";;;;AAAA,4DAA2D;AAC3D,kEAA2D;AAC3D,sCAAqD;AACrD,qDAA8D;AAC9D,+CAAuD;AAE1C,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,mBAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6DAA6D;IAC1E,KAAK,EAAE,mCAAsB;IACvB,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,4BAAkB,CAAC,CAAC;YAElE,MAAM,MAAM,GAAG,IAAc,CAAC;YAE9B,MAAM,cAAc,GAAG,MAAM,qBAAY,CAAC,UAAU,CAAC;gBACnD,MAAM;gBACN,IAAI,EAAE,UAAU,CAAC,KAAK;aACvB,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,YAAY,CAAC;gBAC/C,MAAM;gBACN,OAAO,EAAE,cAAc,CAAC,EAAE;aAC3B,CAAC,CAAC;YAEH,OAAO,MAAM,qBAAY,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const analyzeDocument: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ document: import("@taskmagic/pieces-framework").FileProperty<true>;
3
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analyzeDocument = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const properties_1 = require("../common/properties");
9
+ const schemas_1 = require("../common/schemas");
10
+ exports.analyzeDocument = (0, pieces_framework_1.createAction)({
11
+ auth: common_1.vlmRunAuth,
12
+ name: 'analyzeDocument',
13
+ displayName: 'Analyze Document',
14
+ description: 'Process a document (PDF, DOCX, etc.), extracting structured data or text.',
15
+ props: properties_1.analyzeDocumentProperties,
16
+ run(_a) {
17
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
18
+ yield pieces_common_1.propsValidation.validateZod(propsValue, schemas_1.analyzeDocumentSchema);
19
+ const apiKey = auth;
20
+ const { document, domain } = propsValue;
21
+ const uploadResponse = yield common_1.vlmRunCommon.uploadFile({
22
+ apiKey,
23
+ file: document,
24
+ });
25
+ const response = yield common_1.vlmRunCommon.analyzeDocument({
26
+ apiKey,
27
+ file_id: uploadResponse.id,
28
+ domain,
29
+ });
30
+ return yield common_1.vlmRunCommon.getresponse(apiKey, response.id, response.status);
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=analyze-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-document.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/actions/analyze-document.ts"],"names":[],"mappings":";;;;AAAA,4DAA2D;AAC3D,kEAA2D;AAC3D,sCAAqD;AACrD,qDAAiE;AACjE,+CAA0D;AAE7C,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAU;IAChB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,2EAA2E;IAC7E,KAAK,EAAE,sCAAyB;IAC1B,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,+BAAqB,CAAC,CAAC;YAErE,MAAM,MAAM,GAAG,IAAc,CAAC;YAC9B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAExC,MAAM,cAAc,GAAG,MAAM,qBAAY,CAAC,UAAU,CAAC;gBACnD,MAAM;gBACN,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,eAAe,CAAC;gBAClD,MAAM;gBACN,OAAO,EAAE,cAAc,CAAC,EAAE;gBAC1B,MAAM;aACP,CAAC,CAAC;YAEH,OAAO,MAAM,qBAAY,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const analyzeImage: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ image: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analyzeImage = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const properties_1 = require("../common/properties");
9
+ const schemas_1 = require("../common/schemas");
10
+ exports.analyzeImage = (0, pieces_framework_1.createAction)({
11
+ auth: common_1.vlmRunAuth,
12
+ name: 'analyzeImage',
13
+ displayName: 'Analyze Image',
14
+ description: 'Process an image (file or URL), extracting descriptions, detecting objects, etc.',
15
+ props: properties_1.analyzeImageProperties,
16
+ run(_a) {
17
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
18
+ yield pieces_common_1.propsValidation.validateZod(propsValue, schemas_1.analyzeImageSchema);
19
+ const apiKey = auth;
20
+ const { image, domain } = propsValue;
21
+ const response = yield common_1.vlmRunCommon.analyzeImage({
22
+ apiKey,
23
+ images: [image],
24
+ domain,
25
+ });
26
+ return yield common_1.vlmRunCommon.getresponse(apiKey, response.id, response.status);
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=analyze-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-image.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/actions/analyze-image.ts"],"names":[],"mappings":";;;;AAAA,4DAA2D;AAC3D,kEAA2D;AAC3D,sCAAqD;AACrD,qDAA8D;AAC9D,+CAAuD;AAE1C,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,mBAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,kFAAkF;IACpF,KAAK,EAAE,mCAAsB;IACvB,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,4BAAkB,CAAC,CAAC;YAElE,MAAM,MAAM,GAAG,IAAc,CAAC;YAC9B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAErC,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,YAAY,CAAC;gBAC/C,MAAM;gBACN,MAAM,EAAE,CAAC,KAAK,CAAC;gBACf,MAAM;aACP,CAAC,CAAC;YAEH,OAAO,MAAM,qBAAY,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const analyzeVideo: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ video: import("@taskmagic/pieces-framework").FileProperty<true>;
3
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analyzeVideo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const properties_1 = require("../common/properties");
9
+ const schemas_1 = require("../common/schemas");
10
+ exports.analyzeVideo = (0, pieces_framework_1.createAction)({
11
+ auth: common_1.vlmRunAuth,
12
+ name: 'analyzeVideo',
13
+ displayName: 'Analyze Video',
14
+ description: 'Analyze a video file or URL, e.g. extract frames, detect content, etc.',
15
+ props: properties_1.analyzeVideoProperties,
16
+ run(_a) {
17
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
18
+ yield pieces_common_1.propsValidation.validateZod(propsValue, schemas_1.analyzeVideoSchema);
19
+ const apiKey = auth;
20
+ const { video, domain } = propsValue;
21
+ const uploadResponse = yield common_1.vlmRunCommon.uploadFile({
22
+ apiKey,
23
+ file: video,
24
+ });
25
+ const response = yield common_1.vlmRunCommon.analyzeVideo({
26
+ apiKey,
27
+ file_id: uploadResponse.id,
28
+ domain,
29
+ });
30
+ return yield common_1.vlmRunCommon.getresponse(apiKey, response.id, response.status);
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=analyze-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-video.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/actions/analyze-video.ts"],"names":[],"mappings":";;;;AAAA,4DAA2D;AAC3D,kEAA2D;AAC3D,sCAAqD;AACrD,qDAA8D;AAC9D,+CAAuD;AAE1C,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,mBAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,wEAAwE;IAC1E,KAAK,EAAE,mCAAsB;IACvB,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,4BAAkB,CAAC,CAAC;YAElE,MAAM,MAAM,GAAG,IAAc,CAAC;YAC9B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAErC,MAAM,cAAc,GAAG,MAAM,qBAAY,CAAC,UAAU,CAAC;gBACnD,MAAM;gBACN,IAAI,EAAE,KAAK;aACZ,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,YAAY,CAAC;gBAC/C,MAAM;gBACN,OAAO,EAAE,cAAc,CAAC,EAAE;gBAC1B,MAAM;aACP,CAAC,CAAC;YAEH,OAAO,MAAM,qBAAY,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9E,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getFile: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ fileId: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ }>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const properties_1 = require("../common/properties");
9
+ const schemas_1 = require("../common/schemas");
10
+ exports.getFile = (0, pieces_framework_1.createAction)({
11
+ auth: common_1.vlmRunAuth,
12
+ name: 'getFile',
13
+ displayName: 'Get File',
14
+ description: "Gets file's metadata by ID.",
15
+ props: properties_1.getFileProperties,
16
+ run(_a) {
17
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
18
+ yield pieces_common_1.propsValidation.validateZod(propsValue, schemas_1.getFileSchema);
19
+ return yield common_1.vlmRunCommon.getFile({
20
+ apiKey: auth,
21
+ file_id: propsValue.fileId,
22
+ });
23
+ });
24
+ },
25
+ });
26
+ //# sourceMappingURL=get-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/actions/get-file.ts"],"names":[],"mappings":";;;;AAAA,4DAA2D;AAC3D,kEAA2D;AAC3D,sCAAqD;AACrD,qDAAyD;AACzD,+CAAkD;AAErC,QAAA,OAAO,GAAG,IAAA,+BAAY,EAAC;IAClC,IAAI,EAAE,mBAAU;IAChB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE,8BAAiB;IAClB,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,+BAAe,CAAC,WAAW,CAAC,UAAU,EAAE,uBAAa,CAAC,CAAC;YAC7D,OAAO,MAAM,qBAAY,CAAC,OAAO,CAAC;gBAChC,MAAM,EAAE,IAAc;gBACtB,OAAO,EAAE,UAAU,CAAC,MAAM;aAC3B,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { AnalyzeAudioParams, AnalyzeDocumentParams, AnalyzeImageParams, AnalyzeVideoParams, FileResponse, GetFileParams, PredictionResponse, UploadFileParams } from './types';
2
+ export declare const vlmRunAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
3
+ export declare const vlmRunCommon: {
4
+ baseUrl: string;
5
+ baseHeaders: (apiKey: string) => {
6
+ 'Content-Type': string;
7
+ Authorization: string;
8
+ };
9
+ endpoints: {
10
+ uploadFile: string;
11
+ listFiles: string;
12
+ analyzeAudio: string;
13
+ analyzeImage: string;
14
+ analyzeDocument: string;
15
+ analyzeVideo: string;
16
+ getresponse: string;
17
+ getFile: (fileId: string) => string;
18
+ };
19
+ getresponse: (apiKey: string, requestId: string, status: string) => Promise<unknown>;
20
+ uploadFile: ({ apiKey, file }: UploadFileParams) => Promise<FileResponse>;
21
+ listFiles: (apiKey: string) => Promise<FileResponse[]>;
22
+ analyzeAudio: ({ apiKey, ...params }: AnalyzeAudioParams) => Promise<PredictionResponse>;
23
+ analyzeImage: ({ apiKey, ...params }: AnalyzeImageParams) => Promise<PredictionResponse>;
24
+ analyzeDocument: ({ apiKey, ...params }: AnalyzeDocumentParams) => Promise<PredictionResponse>;
25
+ analyzeVideo: ({ apiKey, ...params }: AnalyzeVideoParams) => Promise<PredictionResponse>;
26
+ getFile: ({ apiKey, file_id }: GetFileParams) => Promise<FileResponse>;
27
+ };
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vlmRunCommon = exports.vlmRunAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const form_data_1 = tslib_1.__importDefault(require("form-data"));
8
+ exports.vlmRunAuth = pieces_framework_1.PieceAuth.SecretText({
9
+ displayName: 'API Key',
10
+ description: 'Your VLM Run API Key',
11
+ required: true,
12
+ });
13
+ exports.vlmRunCommon = {
14
+ baseUrl: 'https://api.vlm.run/v1',
15
+ baseHeaders: (apiKey) => ({
16
+ 'Content-Type': 'application/json',
17
+ Authorization: `Bearer ${apiKey}`,
18
+ }),
19
+ endpoints: {
20
+ uploadFile: '/files',
21
+ listFiles: '/files',
22
+ analyzeAudio: '/audio/generate',
23
+ analyzeImage: '/image/generate',
24
+ analyzeDocument: '/document/generate',
25
+ analyzeVideo: '/video/generate',
26
+ getresponse: '/predictions',
27
+ getFile: (fileId) => `/files/${fileId}`,
28
+ },
29
+ // Methods
30
+ getresponse: (apiKey, requestId, status) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
31
+ var _a;
32
+ let statusnow = status;
33
+ const timeoutAt = Date.now() + 5 * 60 * 1000;
34
+ while (statusnow !== 'completed' && Date.now() < timeoutAt) {
35
+ yield new Promise((resolve) => setTimeout(resolve, 5000));
36
+ const pollRes = yield pieces_common_1.httpClient.sendRequest({
37
+ method: pieces_common_1.HttpMethod.GET,
38
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.getresponse}/${requestId}`,
39
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
40
+ });
41
+ statusnow = (_a = pollRes.body) === null || _a === void 0 ? void 0 : _a.status;
42
+ if (statusnow === 'completed') {
43
+ return pollRes.body.response;
44
+ }
45
+ }
46
+ throw new Error('generation timed out or failed.');
47
+ }),
48
+ uploadFile: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ apiKey, file }) {
49
+ const formData = new form_data_1.default();
50
+ formData.append('file', file.data, { filename: file.filename });
51
+ const response = yield pieces_common_1.httpClient.sendRequest({
52
+ method: pieces_common_1.HttpMethod.POST,
53
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.uploadFile}`,
54
+ headers: Object.assign(Object.assign({}, exports.vlmRunCommon.baseHeaders(apiKey)), { 'Content-Type': 'multipart/form-data' }),
55
+ body: formData,
56
+ });
57
+ return response.body;
58
+ }),
59
+ listFiles: (apiKey) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
60
+ const response = yield pieces_common_1.httpClient.sendRequest({
61
+ method: pieces_common_1.HttpMethod.GET,
62
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.listFiles}`,
63
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
64
+ });
65
+ return response.body;
66
+ }),
67
+ analyzeAudio: (_a) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
68
+ var { apiKey } = _a, params = tslib_1.__rest(_a, ["apiKey"]);
69
+ const response = yield pieces_common_1.httpClient.sendRequest({
70
+ method: pieces_common_1.HttpMethod.POST,
71
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.analyzeAudio}`,
72
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
73
+ body: Object.assign({ domain: 'audio.transcription' }, params),
74
+ });
75
+ return response.body;
76
+ }),
77
+ analyzeImage: (_a) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
78
+ var { apiKey } = _a, params = tslib_1.__rest(_a, ["apiKey"]);
79
+ const response = yield pieces_common_1.httpClient.sendRequest({
80
+ method: pieces_common_1.HttpMethod.POST,
81
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.analyzeImage}`,
82
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
83
+ body: params,
84
+ });
85
+ return response.body;
86
+ }),
87
+ analyzeDocument: (_a) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
88
+ var { apiKey } = _a, params = tslib_1.__rest(_a, ["apiKey"]);
89
+ const response = yield pieces_common_1.httpClient.sendRequest({
90
+ method: pieces_common_1.HttpMethod.POST,
91
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.analyzeDocument}`,
92
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
93
+ body: params,
94
+ });
95
+ return response.body;
96
+ }),
97
+ analyzeVideo: (_a) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
98
+ var { apiKey } = _a, params = tslib_1.__rest(_a, ["apiKey"]);
99
+ const response = yield pieces_common_1.httpClient.sendRequest({
100
+ method: pieces_common_1.HttpMethod.POST,
101
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.analyzeVideo}`,
102
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
103
+ body: params,
104
+ });
105
+ return response.body;
106
+ }),
107
+ getFile: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ apiKey, file_id }) {
108
+ const response = yield pieces_common_1.httpClient.sendRequest({
109
+ method: pieces_common_1.HttpMethod.GET,
110
+ url: `${exports.vlmRunCommon.baseUrl}${exports.vlmRunCommon.endpoints.getFile(file_id)}`,
111
+ headers: exports.vlmRunCommon.baseHeaders(apiKey),
112
+ });
113
+ return response.body;
114
+ }),
115
+ };
116
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,4DAAkE;AAClE,kEAAwD;AACxD,kEAAiC;AAYpB,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,WA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Q,CAAC,IAAI,CAAC;IACvB,CAAC,CAAA;IACD,YAAY,EAAE,CAAO,EAAyC,EAAE,EAAE;YAA7C,EAAE,MAAM,OAAiC,EAA5B,MAAM,sBAAnB,UAAqB,CAAF;QACtC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAqB;YAChE,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,oBAAY,CAAC,OAAO,GAAG,oBAAY,CAAC,SAAS,CAAC,YAAY,EAAE;YACpE,OAAO,EAAE,oBAAY,CAAC,WAAW,CAAC,MAAM,CAAC;YACzC,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC,CAAA;IACD,OAAO,EAAE,KAA2C,EAAE,oDAAtC,EAAE,MAAM,EAAE,OAAO,EAAiB;QAChD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAe;YAC1D,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,oBAAY,CAAC,OAAO,GAAG,oBAAY,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACxE,OAAO,EAAE,oBAAY,CAAC,WAAW,CAAC,MAAM,CAAC;SAC1C,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC,CAAA;CACF,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const analyzeAudioProperties: {
2
+ audio: import("@taskmagic/pieces-framework").FileProperty<true>;
3
+ };
4
+ export declare const analyzeImageProperties: {
5
+ image: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
6
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
7
+ };
8
+ export declare const analyzeDocumentProperties: {
9
+ document: import("@taskmagic/pieces-framework").FileProperty<true>;
10
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
11
+ };
12
+ export declare const analyzeVideoProperties: {
13
+ video: import("@taskmagic/pieces-framework").FileProperty<true>;
14
+ domain: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
15
+ };
16
+ export declare const getFileProperties: {
17
+ fileId: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
18
+ };
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileProperties = exports.analyzeVideoProperties = exports.analyzeDocumentProperties = exports.analyzeImageProperties = exports.analyzeAudioProperties = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const _1 = require(".");
7
+ // Action Properties
8
+ exports.analyzeAudioProperties = {
9
+ audio: pieces_framework_1.Property.File({
10
+ displayName: 'Audio File',
11
+ description: 'The audio file to get the transcription from. Only MP3 supported.',
12
+ required: true,
13
+ }),
14
+ };
15
+ exports.analyzeImageProperties = {
16
+ image: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Image File',
18
+ description: 'The image file to be analyzed.',
19
+ required: true,
20
+ }),
21
+ domain: pieces_framework_1.Property.StaticDropdown({
22
+ displayName: 'Domain',
23
+ description: 'The specific analysis domain for the image.',
24
+ required: true,
25
+ options: {
26
+ options: [
27
+ { label: 'Image Classification', value: 'image.classification' },
28
+ { label: 'Image Caption', value: 'image.caption' },
29
+ { label: 'Image TV News', value: 'image.tv-news' },
30
+ { label: 'Image Q and A', value: 'image.q-and-a' },
31
+ ],
32
+ },
33
+ }),
34
+ };
35
+ exports.analyzeDocumentProperties = {
36
+ document: pieces_framework_1.Property.File({
37
+ displayName: 'Document File',
38
+ description: 'The document file to be analyzed.',
39
+ required: true,
40
+ }),
41
+ domain: pieces_framework_1.Property.StaticDropdown({
42
+ displayName: 'Domain',
43
+ description: 'The specific analysis domain for the document.',
44
+ required: true,
45
+ options: {
46
+ options: [
47
+ { label: 'Bank Statement', value: 'document.bank-statement' },
48
+ { label: 'Document Classification', value: 'document.classification' },
49
+ { label: 'Invoice', value: 'document.invoice' },
50
+ { label: 'Markdown', value: 'document.markdown' },
51
+ { label: 'Q and A', value: 'document.q-and-a' },
52
+ { label: 'Receipt', value: 'document.receipt' },
53
+ { label: 'Resume', value: 'document.resume' },
54
+ { label: "US Driver's License", value: 'document.us-drivers-license' },
55
+ { label: 'Utility Bill', value: 'document.utility-bill' },
56
+ ],
57
+ },
58
+ }),
59
+ };
60
+ exports.analyzeVideoProperties = {
61
+ video: pieces_framework_1.Property.File({
62
+ displayName: 'Video File',
63
+ description: 'The video file to be analyzed.',
64
+ required: true,
65
+ }),
66
+ domain: pieces_framework_1.Property.StaticDropdown({
67
+ displayName: 'Domain',
68
+ description: 'The specific analysis domain for the video.',
69
+ required: true,
70
+ options: {
71
+ options: [
72
+ { label: 'Video Transcription', value: 'video.transcription' },
73
+ {
74
+ label: 'Video Transcription Summary',
75
+ value: 'video.transcription-summary',
76
+ },
77
+ {
78
+ label: 'Video Product Demo Summary',
79
+ value: 'video.product-demo-summary',
80
+ },
81
+ {
82
+ label: 'Video Conferencing Summary',
83
+ value: 'video.conferencing-summary',
84
+ },
85
+ { label: 'Video Podcast Summary', value: 'video.podcast-summary' },
86
+ { label: 'Video Summary', value: 'video.summary' },
87
+ { label: 'Video Dashcam Analytics', value: 'video.dashcam-analytics' },
88
+ ],
89
+ },
90
+ }),
91
+ };
92
+ exports.getFileProperties = {
93
+ fileId: pieces_framework_1.Property.Dropdown({
94
+ displayName: 'File',
95
+ description: 'Select a file to retrieve its details.',
96
+ required: true,
97
+ refreshers: ['auth'],
98
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
99
+ if (!auth) {
100
+ return {
101
+ disabled: true,
102
+ placeholder: 'Connect your VLM Run account to see files',
103
+ options: [],
104
+ };
105
+ }
106
+ const files = yield _1.vlmRunCommon.listFiles(auth);
107
+ return {
108
+ disabled: false,
109
+ options: files.map((file) => ({
110
+ label: file.filename,
111
+ value: file.id,
112
+ })),
113
+ };
114
+ }),
115
+ }),
116
+ };
117
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/common/properties.ts"],"names":[],"mappings":";;;;AAAA,kEAAuD;AACvD,wBAAiC;AAEjC,oBAAoB;AACP,QAAA,sBAAsB,GAAG;IACpC,KAAK,EAAE,2BAAQ,CAAC,IAAI,CAAC;QACnB,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,mEAAmE;QAChF,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;QACxB,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,gCAAgC;QAC7C,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;QAC9B,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,6CAA6C;QAC1D,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE;gBAChE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;gBAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;gBAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;aACnD;SACF;KACF,CAAC;CACH,CAAC;AAEW,QAAA,yBAAyB,GAAG;IACvC,QAAQ,EAAE,2BAAQ,CAAC,IAAI,CAAC;QACtB,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,mCAAmC;QAChD,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;QAC9B,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,gD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A4B;oBACnC,KAAK,EAAE,4BAA4B;iBACpC;gBACD,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,uBAAuB,EAAE;gBAClE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;gBAClD,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,yBAAyB,EAAE;aACvE;SACF;KACF,CAAC;CACH,CAAC;AAEW,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACxB,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;YACtB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,2CAA2C;oBACxD,OAAO,EAAE,EAAE;iBACZ,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,eAAY,CAAC,SAAS,CAAC,IAAc,CAAC,CAAC;YAC3D,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAC5B,KAAK,EAAE,IAAI,CAAC,QAAQ;oBACpB,KAAK,EAAE,IAAI,CAAC,EAAE;iBACf,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;CACH,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ export declare const analyzeAudioSchema: {
3
+ audio: z.ZodObject<{
4
+ filename: z.ZodString;
5
+ data: z.ZodType<Buffer, z.ZodTypeDef, Buffer>;
6
+ extension: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ filename: string;
9
+ data: Buffer;
10
+ extension?: string | undefined;
11
+ }, {
12
+ filename: string;
13
+ data: Buffer;
14
+ extension?: string | undefined;
15
+ }>;
16
+ };
17
+ export declare const analyzeImageSchema: {
18
+ image: z.ZodString;
19
+ domain: z.ZodEnum<["image.classification", "image.caption", "image.tv-news", "image.q-and-a"]>;
20
+ };
21
+ export declare const analyzeDocumentSchema: {
22
+ document: z.ZodObject<{
23
+ filename: z.ZodString;
24
+ data: z.ZodType<Buffer, z.ZodTypeDef, Buffer>;
25
+ extension: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ filename: string;
28
+ data: Buffer;
29
+ extension?: string | undefined;
30
+ }, {
31
+ filename: string;
32
+ data: Buffer;
33
+ extension?: string | undefined;
34
+ }>;
35
+ domain: z.ZodEnum<["document.bank-statement", "document.classification", "document.invoice", "document.markdown", "document.q-and-a", "document.receipt", "document.resume", "document.us-drivers-license", "document.utility-bill"]>;
36
+ };
37
+ export declare const analyzeVideoSchema: {
38
+ video: z.ZodObject<{
39
+ filename: z.ZodString;
40
+ data: z.ZodType<Buffer, z.ZodTypeDef, Buffer>;
41
+ extension: z.ZodOptional<z.ZodString>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ filename: string;
44
+ data: Buffer;
45
+ extension?: string | undefined;
46
+ }, {
47
+ filename: string;
48
+ data: Buffer;
49
+ extension?: string | undefined;
50
+ }>;
51
+ domain: z.ZodEnum<["video.transcription", "video.transcription-summary", "video.product-demo-summary", "video.conferencing-summary", "video.podcast-summary", "video.summary", "video.dashcam-analytics"]>;
52
+ };
53
+ export declare const getFileSchema: {
54
+ fileId: z.ZodString;
55
+ };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileSchema = exports.analyzeVideoSchema = exports.analyzeDocumentSchema = exports.analyzeImageSchema = exports.analyzeAudioSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const imageDomains = [
6
+ 'image.classification',
7
+ 'image.caption',
8
+ 'image.tv-news',
9
+ 'image.q-and-a',
10
+ ];
11
+ const documentDomains = [
12
+ 'document.bank-statement',
13
+ 'document.classification',
14
+ 'document.invoice',
15
+ 'document.markdown',
16
+ 'document.q-and-a',
17
+ 'document.receipt',
18
+ 'document.resume',
19
+ 'document.us-drivers-license',
20
+ 'document.utility-bill',
21
+ ];
22
+ const videoDomains = [
23
+ 'video.transcription',
24
+ 'video.transcription-summary',
25
+ 'video.product-demo-summary',
26
+ 'video.conferencing-summary',
27
+ 'video.podcast-summary',
28
+ 'video.summary',
29
+ 'video.dashcam-analytics',
30
+ ];
31
+ const apFileSchema = zod_1.z.object({
32
+ filename: zod_1.z.string(),
33
+ data: zod_1.z.instanceof(Buffer),
34
+ extension: zod_1.z.string().optional(),
35
+ });
36
+ // Schemas
37
+ exports.analyzeAudioSchema = {
38
+ audio: apFileSchema,
39
+ };
40
+ exports.analyzeImageSchema = {
41
+ image: zod_1.z.string().url(),
42
+ domain: zod_1.z.enum(imageDomains),
43
+ };
44
+ exports.analyzeDocumentSchema = {
45
+ document: apFileSchema,
46
+ domain: zod_1.z.enum(documentDomains),
47
+ };
48
+ exports.analyzeVideoSchema = {
49
+ video: apFileSchema,
50
+ domain: zod_1.z.enum(videoDomains),
51
+ };
52
+ exports.getFileSchema = {
53
+ fileId: zod_1.z.string(),
54
+ };
55
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/common/schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,YAAY,GAAG;IACnB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,eAAe;CACP,CAAC;AAEX,MAAM,eAAe,GAAG;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,6BAA6B;IAC7B,uBAAuB;CACf,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,qBAAqB;IACrB,6BAA6B;IAC7B,4BAA4B;IAC5B,4BAA4B;IAC5B,uBAAuB;IACvB,eAAe;IACf,yBAAyB;CACjB,CAAC;AAEX,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAEH,UAAU;AACG,QAAA,kBAAkB,GAAG;IAChC,KAAK,EAAE,YAAY;CACpB,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,YAAY,CAAC;CAC7B,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,eAAe,CAAC;CAChC,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,YAAY,CAAC;CAC7B,CAAC;AAEW,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;CACnB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { ApFile } from '@taskmagic/pieces-framework';
2
+ export interface AuthenticationParams {
3
+ apiKey: string;
4
+ }
5
+ export interface UploadFileParams extends AuthenticationParams {
6
+ file: ApFile;
7
+ }
8
+ export interface AnalyzeAudioParams extends AuthenticationParams {
9
+ file_id: string;
10
+ }
11
+ export interface AnalyzeImageParams extends AuthenticationParams {
12
+ images: string[];
13
+ domain: string;
14
+ }
15
+ export interface AnalyzeDocumentParams extends AuthenticationParams {
16
+ file_id: string;
17
+ domain: string;
18
+ }
19
+ export interface AnalyzeVideoParams extends AuthenticationParams {
20
+ file_id: string;
21
+ domain: string;
22
+ }
23
+ export interface GetFileParams extends AuthenticationParams {
24
+ file_id: string;
25
+ }
26
+ export interface FileResponse {
27
+ id: string;
28
+ filename: string;
29
+ bytes: number;
30
+ purpose: string;
31
+ created_at: string;
32
+ object: 'file';
33
+ }
34
+ type JobStatus = string;
35
+ interface CreditUsage {
36
+ elements_processed?: number;
37
+ element_type?: 'image' | 'page' | 'video' | 'audio';
38
+ credits_used?: number;
39
+ }
40
+ export interface PredictionResponse {
41
+ id: string;
42
+ created_at: string;
43
+ completed_at?: string;
44
+ response?: unknown;
45
+ status: JobStatus;
46
+ message?: string;
47
+ usage?: CreditUsage;
48
+ }
49
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vlm-run/src/lib/common/types.ts"],"names":[],"mappings":""}