Skip to content

Function: errorBodyComponent()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / errorBodyComponent

errorBodyComponent(error): string | undefined

Defined in: src/utils/error-code.ts:73

The /health component a model refusal names, from an ApiError’s body.

unknown

Anything caught from an SDK call.

string | undefined

The body’s component (text_model, agent_model, …) when the engine refused for want of a model (llm_unconfigured, llm_provider_failed); undefined otherwise.

try {
await client.inference.draftRules({ description: 'A person over 65 is a senior.' });
} catch (error) {
if (errorBodyCode(error) === 'llm_unconfigured') console.log(errorBodyComponent(error));
}