chore: format

This commit is contained in:
Timothy Jaeryang Baek
2024-11-26 20:03:06 -08:00
parent 22b5feb747
commit cbc7801b0e
5 changed files with 1019 additions and 1026 deletions

View File

@@ -367,11 +367,9 @@ export const generateQueries = async (
throw error;
}
// Step 1: Safely extract the response string
const response = res?.choices[0]?.message?.content ?? '';
try {
const jsonStartIndex = response.indexOf('{');
const jsonEndIndex = response.lastIndexOf('}');
@@ -390,7 +388,7 @@ export const generateQueries = async (
}
}
// If no valid JSON block found, return an empty array
// If no valid JSON block found, return response as is
return [response];
} catch (e) {
// Catch and safely return empty array on any parsing errors

File diff suppressed because it is too large Load Diff