Skip to content

Commit a148f75

Browse files
committed
ragie init
1 parent 080252d commit a148f75

File tree

8 files changed

+730
-5
lines changed

8 files changed

+730
-5
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import ragie from "../../ragie.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "ragie-create-document",
6+
name: "Create Document",
7+
description: "Creates a new document in Ragie. [See the documentation](https://docs.ragie.ai/reference/createdocument)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
ragie,
12+
file: {
13+
propDefinition: [
14+
ragie,
15+
"createDocumentFile",
16+
],
17+
},
18+
mode: {
19+
propDefinition: [
20+
ragie,
21+
"createDocumentMode",
22+
],
23+
optional: true,
24+
},
25+
metadata: {
26+
propDefinition: [
27+
ragie,
28+
"createDocumentMetadata",
29+
],
30+
optional: true,
31+
},
32+
externalId: {
33+
propDefinition: [
34+
ragie,
35+
"createDocumentExternalId",
36+
],
37+
optional: true,
38+
},
39+
name: {
40+
propDefinition: [
41+
ragie,
42+
"createDocumentName",
43+
],
44+
optional: true,
45+
},
46+
partition: {
47+
propDefinition: [
48+
ragie,
49+
"createDocumentPartition",
50+
],
51+
optional: true,
52+
},
53+
},
54+
async run({ $ }) {
55+
const response = await this.ragie.createDocument({
56+
createDocumentFile: this.file,
57+
createDocumentMode: this.mode,
58+
createDocumentMetadata: this.metadata,
59+
createDocumentExternalId: this.externalId,
60+
createDocumentName: this.name,
61+
createDocumentPartition: this.partition,
62+
});
63+
64+
$.export("$summary", `Created document: ${response.name} (ID: ${response.id})`);
65+
return response;
66+
},
67+
};
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import ragie from "../../ragie.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "ragie-create-instruction",
6+
name: "Create Instruction",
7+
description: "Creates a new instruction in Ragie. [See the documentation](https://docs.ragie.ai/reference/createinstruction)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
ragie,
12+
name: {
13+
propDefinition: [
14+
ragie,
15+
"createInstructionName",
16+
],
17+
},
18+
prompt: {
19+
propDefinition: [
20+
ragie,
21+
"createInstructionPrompt",
22+
],
23+
},
24+
active: {
25+
propDefinition: [
26+
ragie,
27+
"createInstructionActive",
28+
],
29+
},
30+
scope: {
31+
propDefinition: [
32+
ragie,
33+
"createInstructionScope",
34+
],
35+
},
36+
filter: {
37+
propDefinition: [
38+
ragie,
39+
"createInstructionFilter",
40+
],
41+
},
42+
partition: {
43+
propDefinition: [
44+
ragie,
45+
"createInstructionPartition",
46+
],
47+
},
48+
},
49+
async run({ $ }) {
50+
const response = await this.ragie.createInstruction({
51+
createInstructionName: this.name,
52+
createInstructionPrompt: this.prompt,
53+
...(this.active !== undefined && {
54+
createInstructionActive: this.active,
55+
}),
56+
...(this.scope !== undefined && {
57+
createInstructionScope: this.scope,
58+
}),
59+
...(this.filter !== undefined && {
60+
createInstructionFilter: this.filter,
61+
}),
62+
...(this.partition !== undefined && {
63+
createInstructionPartition: this.partition,
64+
}),
65+
});
66+
$.export("$summary", `Created instruction ${this.name}`);
67+
return response;
68+
},
69+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import ragie from "../../ragie.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "ragie-update-document-file",
6+
name: "Update Document File",
7+
description: "Updates an existing document file in Ragie. [See the documentation]().",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
ragie,
12+
updateDocumentId: {
13+
propDefinition: [
14+
ragie,
15+
"updateDocumentId",
16+
],
17+
},
18+
updateDocumentFile: {
19+
propDefinition: [
20+
ragie,
21+
"updateDocumentFile",
22+
],
23+
},
24+
updateDocumentMode: {
25+
propDefinition: [
26+
ragie,
27+
"updateDocumentMode",
28+
],
29+
optional: true,
30+
},
31+
updateDocumentPartition: {
32+
propDefinition: [
33+
ragie,
34+
"updateDocumentPartition",
35+
],
36+
optional: true,
37+
},
38+
},
39+
async run({ $ }) {
40+
const response = await this.ragie.updateDocumentFile({
41+
updateDocumentId: this.updateDocumentId,
42+
updateDocumentFile: this.updateDocumentFile,
43+
updateDocumentMode: this.updateDocumentMode,
44+
updateDocumentPartition: this.updateDocumentPartition,
45+
});
46+
$.export("$summary", `Successfully updated document file with ID: ${this.updateDocumentId}`);
47+
return response;
48+
},
49+
};

components/ragie/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"publishConfig": {
1313
"access": "public"
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)