donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
26 lines • 713 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GptClient = void 0;
exports.parseOrLogAndThrow = parseOrLogAndThrow;
const Logger_1 = require("../utils/Logger");
/** Generic client interface for talking to GPT providers. */
class GptClient {
constructor(config) {
this.config = config;
}
}
exports.GptClient = GptClient;
function parseOrLogAndThrow(obj, zodSchema) {
try {
return zodSchema.parse(obj);
}
catch (error) {
Logger_1.appLogger.error(`Failed to parse object of...
'''
${JSON.stringify(obj, null, 2)}
'''
as the expected schema due to exception!`, error);
throw error;
}
}
//# sourceMappingURL=GptClient.js.map