The vendor's message from a decision API's error body, or an empty string when it has none. It reads,
in order:
detail as FastAPI sends it: a string, or a list of { msg } (joined with ; );
detail as an object { error_type, message } (SubQ), as error_type: message;
error.message, as OpenAI-style APIs send it (Perplexity, Inception, llama.cpp);
error as a plain string.
A detail that carries no message (a blank string, a list with no non-empty msg, an object with no
non-empty message) falls through to error, so it never hides the vendor's real message.
Parameters
bodyText: string
The response body as text; anything that is not a JSON object gives an empty string.
The vendor's message from a decision API's error body, or an empty string when it has none. It reads, in order:
detailas FastAPI sends it: a string, or a list of{ msg }(joined with;);detailas an object{ error_type, message }(SubQ), aserror_type: message;error.message, as OpenAI-style APIs send it (Perplexity, Inception, llama.cpp);erroras a plain string.A
detailthat carries no message (a blank string, a list with no non-emptymsg, an object with no non-emptymessage) falls through toerror, so it never hides the vendor's real message.