We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 873f13a commit dfb7494Copy full SHA for dfb7494
1 file changed
src/api/providers/gemini.ts
@@ -165,7 +165,7 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
165
// Create a new text part for the system instruction
166
const systemPart = { text: systemInstruction }
167
// Prepend it to the existing parts
168
- firstMessage.parts = [systemPart, ...firstMessage.parts]
+ firstMessage.parts = [systemPart, ...(firstMessage.parts || [])]
169
} else {
170
// If no messages or first message is not user (e.g. starts with model),
171
// prepend a new user message with the system instruction.
0 commit comments