feat: log raw AI JSON response to browser console
This commit is contained in:
@@ -115,6 +115,7 @@ export async function analyzeBottleMistral(input: any): Promise<AnalysisResponse
|
||||
}
|
||||
|
||||
if (Array.isArray(jsonData)) jsonData = jsonData[0];
|
||||
console.log('[Mistral AI] JSON Response:', jsonData);
|
||||
|
||||
// Extract search_string before validation
|
||||
const searchString = jsonData.search_string;
|
||||
@@ -156,7 +157,8 @@ export async function analyzeBottleMistral(input: any): Promise<AnalysisResponse
|
||||
apiDuration: endApi - startApi,
|
||||
parseDuration: endParse - startParse,
|
||||
uploadSize: uploadSize
|
||||
}
|
||||
},
|
||||
raw: jsonData
|
||||
};
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -115,6 +115,7 @@ export async function analyzeBottle(input: any): Promise<AnalysisResponse> {
|
||||
}
|
||||
|
||||
if (Array.isArray(jsonData)) jsonData = jsonData[0];
|
||||
console.log('[Gemini AI] JSON Response:', jsonData);
|
||||
|
||||
const searchString = jsonData.search_string;
|
||||
delete jsonData.search_string;
|
||||
@@ -149,7 +150,8 @@ export async function analyzeBottle(input: any): Promise<AnalysisResponse> {
|
||||
apiDuration: endApi - startApi,
|
||||
parseDuration: endParse - startParse,
|
||||
uploadSize: uploadSize
|
||||
}
|
||||
},
|
||||
raw: jsonData
|
||||
} as any;
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -80,7 +80,8 @@ export async function magicScan(input: any): Promise<AnalysisResponse & { wb_id?
|
||||
return {
|
||||
...aiResponse,
|
||||
wb_id: cacheHit.wb_id,
|
||||
perf: aiResponse.perf
|
||||
perf: aiResponse.perf,
|
||||
raw: aiResponse.raw
|
||||
};
|
||||
}
|
||||
|
||||
@@ -108,14 +109,16 @@ export async function magicScan(input: any): Promise<AnalysisResponse & { wb_id?
|
||||
return {
|
||||
...aiResponse,
|
||||
wb_id: braveResult.id,
|
||||
perf: aiResponse.perf
|
||||
perf: aiResponse.perf,
|
||||
raw: aiResponse.raw
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...aiResponse,
|
||||
wb_id: undefined,
|
||||
perf: aiResponse.perf
|
||||
perf: aiResponse.perf,
|
||||
raw: aiResponse.raw
|
||||
};
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user