fix regex

This commit is contained in:
Nathan Price 2024-03-01 15:58:36 -05:00
parent 06c3c051ad
commit a5478ec4cc
No known key found for this signature in database

View file

@ -117,7 +117,7 @@ export default class AutoClassifierPlugin extends Plugin {
// ------- [API Processing] -------
// Call API
const responseRaw = await ChatGPT.callAPI(system_role, user_prompt, this.settings.apiKey);
const jsonRegex = /reliability.*\s*:\s*([\d.]+).*output.*\s*:\s*"?([^"^}]+)/;
const jsonRegex = /reliability[\s\S]*?:\s*([\d.]+)[\s\S]*?output[\s\S]*?:\s*"([^"^}]+)/;
const match = responseRaw.match(jsonRegex);
let resOutput;
let resReliabity;