Skip to content

Commit 3f56c91

Browse files
committed
Get Run Status action
1 parent e79e0ed commit 3f56c91

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import utopianLabs from "../../utopian_labs.app.mjs";
2+
3+
export default {
4+
key: "utopian_labs-get-run-status",
5+
name: "Get Run Status",
6+
description: "Retrieve the status of an initiated run. [See the documentation](https://docs.utopianlabs.ai/research#retrieve-research-run-status)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
utopianLabs,
11+
runId: {
12+
type: "string",
13+
label: "Run ID",
14+
description: "The ID of the run you want to retrieve the status for.",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.utopianLabs.getRunStatus(this.runId);
19+
$.export("$summary", `Successfully retrieved status for run ${this.runId}`);
20+
return response;
21+
},
22+
};

components/utopian_labs/utopian_labs.app.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ export default {
55
app: "utopian_labs",
66
propDefinitions: {},
77
methods: {
8-
_getClient() {
8+
_client() {
99
return new UtopianLabs({
1010
apiKey: this.$auth.api_key,
1111
});
1212
},
13+
initiateRun(args) {
14+
return this._client().agents.runs.create(args);
15+
},
16+
getRunStatus(run) {
17+
return this._client().agents.runs.get({
18+
run,
19+
});
20+
},
1321
},
1422
};

0 commit comments

Comments
 (0)