fix: adjust website tools; trim gemini intermediate response

This commit is contained in:
ikechan8370 2025-02-17 22:45:39 +08:00
parent 41be6befec
commit 0fae49d5d1
2 changed files with 56 additions and 61 deletions

View file

@ -281,10 +281,10 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient {
// functionCall
const functionCall = responseContent.parts.filter(i => i.functionCall).map(i => i.functionCall)
const text = responseContent.parts.find(i => i.text)?.text
if (text) {
if (text && text.trim()) {
// send reply first
logger.info('send message: ' + text)
opt.replyPureTextCallback && await opt.replyPureTextCallback(text)
logger.info('send message: ' + text.trim())
opt.replyPureTextCallback && await opt.replyPureTextCallback(text.trim())
}
let /** @type {FunctionResponse[]} **/ fcResults = []
for (let fc of functionCall) {