Ir al contenido

Set the verdict a case should get

PATCH/api/public/v1/aip/drafts/{public_id}/intent-policies/{intent_policy_id}/cases/{index} beta

expect allow, ask, block or optimize for the case at index of the intent policy's cases; optimize only on an intent policy that owns an Optimize rule (422 INVALID_BODY otherwise). The expectation is kept through every regeneration of the cases (the case then reads owner: true); an ask expectation passes when the engine asks, or cannot decide and the fallback is Ask (any expectation equal to the fallback passes then). The draft's revision moves and that case runs again at once, code-only, so it works with AI authoring off; job_id is set only when it still fails and AI authoring drafts a suggestion (no case is written again). An index names a case for one call only: re-read the intent policy before the next. 404 for a case the intent policy does not hold.

Ventana de terminal
curl --fail-with-body -X PATCH 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/cases/0' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"expect":"block"}'
Rol en la organizaciónEste punto de conexión
ownerPermitido
adminPermitido
editorPermitido
viewerNo permitido

Una clave tiene el rol que su propietario ocupa en la organización. Consulte Autenticación.

Ámbito de la clave de API: aip:write

ParámetroTipoDescripción
public_idstringObligatorio.
intent_policy_idstring (uuid)Obligatorio.
indexintegerObligatorio.
ParámetroTipoDescripción
Idempotency-Keystring or nullOptional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once.
CampoTipoDescripción
expectstring — one of allow, ask, block, optimizeObligatorio.
CampoTipoDescripción
dataobjectObligatorio.
data.intent_policyobjectObligatorio. One intent policy of a draft.
data.intent_policy.busystring or nullWhat runs on the intent policy: grounding, cases (its stored cases checked again), fix, or topping_up (cases written for the values an answer added, appended when ready; it blocks nothing).
data.intent_policy.capabilitystring or null
data.intent_policy.cardsarray of objectObligatorio.
data.intent_policy.casesarray of objectObligatorio.
data.intent_policy.citationobject or nullObligatorio. The framework preset rule this intent policy came from, edited when its sentence differs; null for anything not drawn from a framework preset.
data.intent_policy.confirmedboolean or null
data.intent_policy.deferredobject or nullThe deferred part's gap class and fallback; null when it has none.
data.intent_policy.dimensionstring — one of quality, economics, security, safety, complianceObligatorio.
data.intent_policy.fallbackstring — one of Ask, Block or null
data.intent_policy.fixobject or null
data.intent_policy.idstringObligatorio.
data.intent_policy.job_idstring or null
data.intent_policy.languagestringObligatorio.
data.intent_policy.passageobject or null
data.intent_policy.refusalobject or null
data.intent_policy.request_ruleobject or null
data.intent_policy.sentencestringObligatorio. The intent policy. Empty while the drafting job still prepares it (busy is grounding and it holds no grounding yet): a sentence is served only once it is final.
data.intent_policy.steerstring or null
data.intent_policy.validateobject or null
data.job_idstring or null
{
"data": {
"intent_policy": {
"busy": "string",
"capability": "string",
"cards": [
{
"answer": {},
"key": "string",
"kind": "dictionary_values",
"question": "string",
"recommended": {}
}
],
"cases": [
{}
],
"citation": {
"edited": false,
"entries": [
{}
],
"items": [
{}
],
"license_url": "https://app.openlatch.ai/",
"preset_key": "string",
"preset_title": "string",
"rule_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"source_commit": "string",
"source_date": "string",
"source_sentence": "string",
"version": 1
},
"confirmed": false,
"deferred": {
"class": "string",
"fallback": "Ask"
},
"dimension": "quality",
"fallback": "Ask",
"fix": {
"attempts_left": 3,
"available": false,
"diff": {},
"fix_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"reason": "Never push to main without a review.",
"requested": false
},
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"language": "string",
"passage": {
"end": 3,
"start": 3
},
"refusal": {
"class": "nothing_observable",
"reason": "Never push to main without a review."
},
"request_rule": {
"lever": "effort_clamp",
"params": {}
},
"sentence": "string",
"steer": "string",
"validate": {
"example": "string",
"fires_on_every_action": false,
"never_fires": false
}
},
"job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}