mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #3914 from cloak1505/google-patch
Print full Google response
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
|
import util from 'node:util';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
|
|
||||||
@@ -498,7 +499,7 @@ async function sendMakerSuiteRequest(request, response) {
|
|||||||
const responseContent = candidates[0].content ?? candidates[0].output;
|
const responseContent = candidates[0].content ?? candidates[0].output;
|
||||||
const functionCall = (candidates?.[0]?.content?.parts ?? []).some(part => part.functionCall);
|
const functionCall = (candidates?.[0]?.content?.parts ?? []).some(part => part.functionCall);
|
||||||
const inlineData = (candidates?.[0]?.content?.parts ?? []).some(part => part.inlineData);
|
const inlineData = (candidates?.[0]?.content?.parts ?? []).some(part => part.inlineData);
|
||||||
console.warn('Google AI Studio response:', responseContent);
|
console.debug('Google AI Studio response:', util.inspect(generateResponseJson, { depth: 5, colors: true }));
|
||||||
|
|
||||||
const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.filter(part => !part.thought)?.map(part => part.text)?.join('\n\n');
|
const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.filter(part => !part.thought)?.map(part => part.text)?.join('\n\n');
|
||||||
if (!responseText && !functionCall && !inlineData) {
|
if (!responseText && !functionCall && !inlineData) {
|
||||||
|
Reference in New Issue
Block a user