openagents_sdk::agent_lab
Account-owned Agent Lab documents and bounded experiments.
| Item | What it does |
|---|---|
AgentLabClient struct | Calls the Agent Lab routes for one signed-in session. |
Request struct | An Agent Lab request body tied to one account and deployment. |
AgentLabClient
pub struct AgentLabClient<'a> {}
Calls the Agent Lab routes for one signed-in session.
AgentLabClient::bind
pub fn bind<T>(&self, body: T) -> Request<T>
Ties body to this session's account and deployment.
AgentLabClient::delete_document
pub async fn delete_document(
&self,
id: &str,
request: &Request<DeleteDocument>,
cancel: &CancellationToken,
) -> Result<Document, Error>
Deletes the Agent Lab document id.
AgentLabClient::hosts
pub async fn hosts(&self, cancel: &CancellationToken) -> Result<Vec<Host>, Error>
Lists the computers that can run Agent Lab experiments.
AgentLabClient::heartbeat
pub async fn heartbeat(
&self,
host: &Host,
cancel: &CancellationToken,
) -> Result<Host, Error>
Reports that host is online and returns the saved host record.
AgentLabClient::documents
pub async fn documents(
&self,
after: Option<&str>,
cancel: &CancellationToken,
) -> Result<Page<Document>, Error>
Lists Agent Lab documents, starting after the cursor after.
AgentLabClient::document
pub async fn document(
&self,
id: &str,
cancel: &CancellationToken,
) -> Result<Document, Error>
Fetches the Agent Lab document id.
AgentLabClient::save
pub async fn save(
&self,
id: Option<&str>,
request: &Request<SaveDocument>,
cancel: &CancellationToken,
) -> Result<Document, Error>
Saves a document: updates id when given, or creates a new document otherwise.
AgentLabClient::start
pub async fn start(
&self,
id: &str,
request: &Request<StartRun>,
cancel: &CancellationToken,
) -> Result<Run, Error>
Starts a run of a version of the document id.
AgentLabClient::runs
pub async fn runs(
&self,
host: Option<&str>,
after: Option<&str>,
cancel: &CancellationToken,
) -> Result<Page<Run>, Error>
Lists runs, optionally for one host, starting after the cursor after.
AgentLabClient::run
pub async fn run(&self, id: &str, cancel: &CancellationToken) -> Result<Run, Error>
Fetches the run id.
AgentLabClient::change
pub async fn change(
&self,
id: &str,
request: &Request<RunChange>,
cancel: &CancellationToken,
) -> Result<Run, Error>
Applies a user action, such as stop, to the run id.
AgentLabClient::host_update
pub async fn host_update(
&self,
id: &str,
request: &Request<HostUpdate>,
cancel: &CancellationToken,
) -> Result<Run, Error>
Reports a host's progress on the run id.
AgentLabClient::promote
pub async fn promote(
&self,
id: &str,
request: &Request<Promote>,
cancel: &CancellationToken,
) -> Result<agent_contract::AgentDefinition, Error>
Saves a version of the document id as an agent definition.
Request
pub struct Request<T> {
pub body: T,
}
An Agent Lab request body tied to one account and deployment. Keep it across retries.
Re-exported from other crates
*fromagent_lab::api*fromagent_lab