Skip to content

Commit 975a341

Browse files
committed
Get Execution Response action
1 parent 0d337d5 commit 975a341

File tree

2 files changed

+21
-33
lines changed

2 files changed

+21
-33
lines changed
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
import tess_ai_by_pareto from "../../tess_ai_by_pareto.app.mjs";
1+
import app from "../../tess_ai_by_pareto.app.mjs";
22

33
export default {
44
key: "tess_ai_by_pareto-get-execution-response",
5-
name: "Get AI Execution Response",
6-
description: "Retrieves the result of a previously executed AI template (image, text, or video). [See the documentation]().",
7-
version: "0.0.{{ts}}",
5+
name: "Get Agent Execution Response",
6+
description:
7+
"Retrieves the result of a previously executed AI Agent (template). [See the documentation](https://tess.pareto.io/api/swagger#/default/370b6709c5d9e8c17a76e1abb288e7ad)",
8+
version: "0.0.1",
89
type: "action",
910
props: {
10-
tess_ai_by_pareto,
11+
app,
1112
executionId: {
12-
propDefinition: [
13-
"tess_ai_by_pareto",
14-
"executionId",
15-
],
13+
type: "string",
14+
label: "Agent Execution ID",
15+
description:
16+
"The ID of the AI Agent (template) execution to retrieve the result for.",
1617
},
1718
},
1819
async run({ $ }) {
19-
const result = await this.tess_ai_by_pareto.getAiTemplateResult({
20+
const result = await this.app.getTemplateResponse({
21+
$,
2022
executionId: this.executionId,
2123
});
22-
$.export("$summary", `Retrieved AI Execution Result for Execution ID ${this.executionId}`);
24+
$.export(
25+
"$summary",
26+
`Retrieved response for execution ID ${this.executionId}`,
27+
);
2328
return result;
2429
},
2530
};

components/tess_ai_by_pareto/tess_ai_by_pareto.app.mjs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@ export default {
2424
}));
2525
},
2626
},
27-
executionId: {
28-
type: "string",
29-
label: "AI Execution ID",
30-
description: "The ID of the AI template execution to retrieve the result for.",
31-
async options() {
32-
const executions = await this.listExecutions();
33-
return executions.executions.map((execution) => ({
34-
label: execution.id,
35-
value: execution.id,
36-
}));
37-
},
38-
},
3927
},
4028
methods: {
4129
_baseUrl() {
@@ -73,17 +61,12 @@ export default {
7361
...args,
7462
});
7563
},
76-
async getAiTemplateResult({ executionId }) {
77-
return this._makeRequest({
78-
method: "GET",
79-
path: `/ai-executions/${executionId}/result`,
80-
});
81-
},
82-
async listExecutions(opts = {}) {
64+
async getTemplateResponse({
65+
executionId, ...args
66+
}) {
8367
return this._makeRequest({
84-
method: "GET",
85-
path: "/ai-executions",
86-
...opts,
68+
path: `/template-responses/${executionId}`,
69+
...args,
8770
});
8871
},
8972
},

0 commit comments

Comments
 (0)