Function: vocabularyRefusalOfBody()
@kortexya/reasoninglayer / vocabularyRefusalOfBody
Function: vocabularyRefusalOfBody()
Section titled “Function: vocabularyRefusalOfBody()”vocabularyRefusalOfBody(
body):VocabularyRefusal|undefined
Defined in: src/utils/vocabulary-refusal.ts:254
The vocabulary refusal a body carries, or undefined when it carries none.
Parameters
Section titled “Parameters”unknown
A parsed error body, as ApiError.body holds it.
Returns
Section titled “Returns”VocabularyRefusal | undefined
The refusal, or undefined when the body is not a vocabulary
refusal with a closed code and well-formed parts.
Example
Section titled “Example”const refusal = vocabularyRefusalOfBody(error.body);if (refusal?.code === 'stale_baseline') { // rebase the candidate}