| 257 | 257 | }; |
| 258 | 258 | |
| 259 | 259 | function getGeminiBody() { |
| 260 | + if (!Array.isArray(generationConfig.stopSequences) || !generationConfig.stopSequences.length) { |
| 261 | + delete generationConfig.stopSequences; |
| 262 | + } |
| 263 | + |
| 260 | 264 | const should_use_system_prompt = (model.includes('gemini-1.5-flash') || model.includes('gemini-1.5-pro')) && request.body.use_makersuite_sysprompt; |
| 261 | 265 | const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, request.body.char_name, request.body.user_name); |
| 262 | 266 | let body = { |