Registra heartbeat
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.
Registra un heartbeat per un elemento di lavoro per mantenere il lease.
Parameters
Returns
Registra heartbeat
require "anthropic"
anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")
beta_self_hosted_work_heartbeat_response = anthropic.beta.environments.work.heartbeat("work_id", environment_id: "env_011CZkZ9X2dpNyB7HsEFoRfW")
puts(beta_self_hosted_work_heartbeat_response)Response 200
{
"last_heartbeat": "last_heartbeat",
"lease_extended": true,
"state": "queued",
"ttl_seconds": 0,
"type": "work_heartbeat"
}Returns Examples
Response 200
{
"last_heartbeat": "last_heartbeat",
"lease_extended": true,
"state": "queued",
"ttl_seconds": 0,
"type": "work_heartbeat"
}