mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
chore: format
This commit is contained in:
@@ -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
Reference in New Issue
Block a user