Print full Google response

This commit is contained in:
cloak1505
2025-04-25 13:05:14 -05:00
committed by GitHub
parent 74f441d0ba
commit bd1d393e5d

View File

@@ -1,6 +1,7 @@
import process from 'node:process';
import express from 'express';
import fetch from 'node-fetch';
import util from 'node:util';
import {
CHAT_COMPLETION_SOURCES,
@@ -498,7 +499,7 @@ async function sendMakerSuiteRequest(request, response) {
const responseContent = candidates[0].content ?? candidates[0].output;
const functionCall = (candidates?.[0]?.content?.parts ?? []).some(part => part.functionCall);
const inlineData = (candidates?.[0]?.content?.parts ?? []).some(part => part.inlineData);
console.warn('Google AI Studio response:', responseContent);
console.warn('Google AI Studio response:', util.inspect(generateResponseJson, {depth: 6, colors: true}));
const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.filter(part => !part.thought)?.map(part => part.text)?.join('\n\n');
if (!responseText && !functionCall && !inlineData) {