Registrar heartbeat
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Observação: esses endpoints são chamados automaticamente pelo worker de ambiente pré-construído fornecido nos SDKs e na CLI, para orquestrar sessões com ambientes sandbox auto-hospedados. Eles estão incluídos aqui como referência; você não precisa invocá-los diretamente.
Registre um heartbeat para um item de trabalho para manter a concessão (lease).
Parameters
Returns
Registrar heartbeat
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
beta_self_hosted_work_heartbeat_response = client.beta.environments.work.heartbeat(
work_id="work_id",
environment_id="env_011CZkZ9X2dpNyB7HsEFoRfW",
)
print(beta_self_hosted_work_heartbeat_response.last_heartbeat)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"
}