feat: log raw AI JSON response to browser console

This commit is contained in:
2025-12-22 11:33:15 +01:00
parent 83229e9c67
commit 1d98bb9947
7 changed files with 56 additions and 38 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {