mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Gemini inline images (#3681)
* Gemini images for non-streaming * Parse images on stream * Add toggle for image request * Add extraction params to extractImageFromData * Add explicit break and return * Add more JSdoc to processImageAttachment * Add file name prefix * Add object argument for saveReply * Add defaults to saveReply params * Use type for saveReply result * Change type check in saveReply backward compat
This commit is contained in:
@ -138,10 +138,11 @@ async function* parseStreamData(json) {
|
||||
for (let i = 0; i < json.candidates.length; i++) {
|
||||
const isNotPrimary = json.candidates?.[0]?.index > 0;
|
||||
const hasToolCalls = json?.candidates?.[0]?.content?.parts?.some(p => p?.functionCall);
|
||||
const hasInlineData = json?.candidates?.[0]?.content?.parts?.some(p => p?.inlineData);
|
||||
if (isNotPrimary || json.candidates.length === 0) {
|
||||
return null;
|
||||
}
|
||||
if (hasToolCalls) {
|
||||
if (hasToolCalls || hasInlineData) {
|
||||
yield { data: json, chunk: '' };
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user