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 2c0db59 commit c1c6eb1Copy full SHA for c1c6eb1
1 file changed
src/api/providers/gemini.ts
@@ -173,7 +173,7 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
173
// Create a new text part for the system instruction
174
const systemPart = { text: systemInstruction }
175
// Prepend it to the existing parts
176
- firstMessage.parts = [systemPart, ...firstMessage.parts]
+ firstMessage.parts = [systemPart, ...(firstMessage.parts || [])]
177
} else {
178
// If no messages or first message is not user (e.g. starts with model),
179
// prepend a new user message with the system instruction.
0 commit comments