Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit dfb7494

Browse files
committed
fix: type error
1 parent 873f13a commit dfb7494

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/api/providers/gemini.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
165165
// Create a new text part for the system instruction
166166
const systemPart = { text: systemInstruction }
167167
// Prepend it to the existing parts
168-
firstMessage.parts = [systemPart, ...firstMessage.parts]
168+
firstMessage.parts = [systemPart, ...(firstMessage.parts || [])]
169169
} else {
170170
// If no messages or first message is not user (e.g. starts with model),
171171
// prepend a new user message with the system instruction.

0 commit comments

Comments
 (0)