@allma/core-sdk
Version:
Core SDK with shared utilities (logging, auth, S3 utils) for building on the Allma serverless AI orchestration platform.
19 lines • 957 B
TypeScript
/**
* Extracts a potential JSON string from a raw LLM response,
* attempts to repair it, and then parses it.
* Handles common issues like markdown code fences and leading/trailing text.
*
* @param inputText The raw string response (for example from the LLM).
* @param correlationId Optional correlation ID for logging.
* @returns The parsed JSON object.
* @throws JsonParseError if parsing fails after repair attempts.
*/
export declare function extractAndParseJson(inputText: string, correlationId?: string): any;
/**
* A safer version of extractAndParseJson that returns null on failure instead of throwing.
* @param rawLlmResponse The raw string response from the LLM.
* @param correlationId Optional correlation ID for logging.
* @returns The parsed JSON object or null if parsing fails.
*/
export declare function extractAndParseJsonSafe(rawLlmResponse: string, correlationId?: string): any | null;
//# sourceMappingURL=jsonUtils.d.ts.map