Get State by State ID
client.states.retrieve(stringstateID, RequestOptionsoptions?): State { id, agent_id, created_at, 3 more }
GET/states/{state_id}
Get State by State ID
import Agentex from 'agentex';
const client = new Agentex({
apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});
const state = await client.states.retrieve('state_id');
console.log(state.id);{
"id": "id",
"agent_id": "agent_id",
"created_at": "2019-12-27T18:11:19.117Z",
"state": {
"foo": "bar"
},
"task_id": "task_id",
"updated_at": "2019-12-27T18:11:19.117Z"
}Returns Examples
{
"id": "id",
"agent_id": "agent_id",
"created_at": "2019-12-27T18:11:19.117Z",
"state": {
"foo": "bar"
},
"task_id": "task_id",
"updated_at": "2019-12-27T18:11:19.117Z"
}