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