You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Creates a new assistant in Griptape. [See the documentation](https://docs.griptape.ai/stable/griptape-cloud/api/api-reference/#/Assistants/CreateAssistant)",
7
+
version: "0.0.1",
8
+
type: "action",
9
+
props: {
10
+
app,
11
+
name: {
12
+
propDefinition: [
13
+
app,
14
+
"name",
15
+
],
16
+
},
17
+
description: {
18
+
propDefinition: [
19
+
app,
20
+
"description",
21
+
],
22
+
},
23
+
input: {
24
+
propDefinition: [
25
+
app,
26
+
"input",
27
+
],
28
+
},
29
+
knowledgeBaseIds: {
30
+
type: "string[]",
31
+
label: "Knowledge Base IDs",
32
+
description: "The knowledge base IDs of the assistant",
33
+
optional: true,
34
+
propDefinition: [
35
+
app,
36
+
"knowledgeBaseId",
37
+
],
38
+
},
39
+
rulesetIds: {
40
+
type: "string[]",
41
+
label: "Ruleset IDs",
42
+
description: "The ruleset IDs of the assistant",
43
+
optional: true,
44
+
propDefinition: [
45
+
app,
46
+
"rulesetId",
47
+
],
48
+
},
49
+
structureIds: {
50
+
type: "string[]",
51
+
label: "Structure IDs",
52
+
description: "The structure IDs of the assistant",
53
+
optional: true,
54
+
propDefinition: [
55
+
app,
56
+
"structureId",
57
+
],
58
+
},
59
+
toolIds: {
60
+
type: "string[]",
61
+
label: "Tool IDs",
62
+
description: "The tool IDs of the assistant",
63
+
optional: true,
64
+
propDefinition: [
65
+
app,
66
+
"toolId",
67
+
],
68
+
},
69
+
},
70
+
methods: {
71
+
createAssistant(args={}){
72
+
returnthis.app.post({
73
+
path: "/assistants",
74
+
...args,
75
+
});
76
+
},
77
+
},
78
+
asyncrun({ $ }){
79
+
const{
80
+
createAssistant,
81
+
name,
82
+
description,
83
+
input,
84
+
knowledgeBaseIds,
85
+
rulesetIds,
86
+
structureIds,
87
+
toolIds,
88
+
}=this;
89
+
90
+
constresponse=awaitcreateAssistant({
91
+
$,
92
+
data: {
93
+
name,
94
+
description,
95
+
input,
96
+
knowledge_base_ids: knowledgeBaseIds,
97
+
ruleset_ids: rulesetIds,
98
+
structure_ids: structureIds,
99
+
tool_ids: toolIds,
100
+
},
101
+
});
102
+
$.export("$summary",`Successfully created a new assistant with ID \`${response.assistant_id}\`.`);
description: "Deletes an existing assistant. [See the documentation](https://docs.griptape.ai/stable/griptape-cloud/api/api-reference/#/Assistants/DeleteAssistant).",
description: "Updates an existing assistant. [See the documentation](https://docs.griptape.ai/stable/griptape-cloud/api/api-reference/#/Assistants/UpdateAssistant).",
7
+
version: "0.0.1",
8
+
type: "action",
9
+
props: {
10
+
app,
11
+
assistantId: {
12
+
propDefinition: [
13
+
app,
14
+
"assistantId",
15
+
],
16
+
},
17
+
name: {
18
+
optional: true,
19
+
propDefinition: [
20
+
app,
21
+
"name",
22
+
],
23
+
},
24
+
description: {
25
+
propDefinition: [
26
+
app,
27
+
"description",
28
+
],
29
+
},
30
+
input: {
31
+
optional: true,
32
+
propDefinition: [
33
+
app,
34
+
"input",
35
+
],
36
+
},
37
+
knowledgeBaseIds: {
38
+
type: "string[]",
39
+
label: "Knowledge Base IDs",
40
+
description: "The knowledge base IDs of the assistant",
41
+
optional: true,
42
+
propDefinition: [
43
+
app,
44
+
"knowledgeBaseId",
45
+
],
46
+
},
47
+
rulesetIds: {
48
+
type: "string[]",
49
+
label: "Ruleset IDs",
50
+
description: "The ruleset IDs of the assistant",
51
+
optional: true,
52
+
propDefinition: [
53
+
app,
54
+
"rulesetId",
55
+
],
56
+
},
57
+
structureIds: {
58
+
type: "string[]",
59
+
label: "Structure IDs",
60
+
description: "The structure IDs of the assistant",
61
+
optional: true,
62
+
propDefinition: [
63
+
app,
64
+
"structureId",
65
+
],
66
+
},
67
+
toolIds: {
68
+
type: "string[]",
69
+
label: "Tool IDs",
70
+
description: "The tool IDs of the assistant",
71
+
optional: true,
72
+
propDefinition: [
73
+
app,
74
+
"toolId",
75
+
],
76
+
},
77
+
},
78
+
methods: {
79
+
updateAssistant({
80
+
assistantId, ...args
81
+
}={}){
82
+
returnthis.app.patch({
83
+
path: `/assistants/${assistantId}`,
84
+
...args,
85
+
});
86
+
},
87
+
},
88
+
asyncrun({ $ }){
89
+
const{
90
+
updateAssistant,
91
+
assistantId,
92
+
name,
93
+
description,
94
+
input,
95
+
knowledgeBaseIds,
96
+
rulesetIds,
97
+
structureIds,
98
+
toolIds,
99
+
}=this;
100
+
101
+
constresponse=awaitupdateAssistant({
102
+
$,
103
+
assistantId,
104
+
data: {
105
+
name,
106
+
description,
107
+
input,
108
+
knowledge_base_ids: knowledgeBaseIds,
109
+
ruleset_ids: rulesetIds,
110
+
structure_ids: structureIds,
111
+
tool_ids: toolIds,
112
+
},
113
+
});
114
+
$.export("$summary",`Successfully updated assistant with ID \`${response.assistant_id}\`.`);
0 commit comments