Skip to content

Function: vocabularyRefusalOfBody()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / 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.

unknown

A parsed error body, as ApiError.body holds it.

VocabularyRefusal | undefined

The refusal, or undefined when the body is not a vocabulary refusal with a closed code and well-formed parts.

const refusal = vocabularyRefusalOfBody(error.body);
if (refusal?.code === 'stale_baseline') {
// rebase the candidate
}