Function: errorBodyComponent()
@kortexya/reasoninglayer / errorBodyComponent
Function: errorBodyComponent()
Section titled “Function: 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.
Parameters
Section titled “Parameters”unknown
Anything caught from an SDK call.
Returns
Section titled “Returns”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.
Example
Section titled “Example”try { await client.inference.draftRules({ description: 'A person over 65 is a senior.' });} catch (error) { if (errorBodyCode(error) === 'llm_unconfigured') console.log(errorBodyComponent(error));}