Skip to content

Commit 7980ea9

Browse files
committed
fix build error
1 parent 1467b90 commit 7980ea9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/vertexai/src/methods/chat-session-helpers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ const VALID_PART_FIELDS: Array<keyof Part> = [
3030
const VALID_PARTS_PER_ROLE: { [key in Role]: Array<keyof Part> } = {
3131
user: ['text', 'inlineData'],
3232
function: ['functionResponse'],
33-
model: ['text', 'functionCall']
33+
model: ['text', 'functionCall'],
34+
// System instructions shouldn't be in history anyway.
35+
system: ['text']
3436
};
3537

3638
const VALID_PREVIOUS_CONTENT_ROLES: { [key in Role]: Role[] } = {
3739
user: ['model'],
3840
function: ['model'],
39-
model: ['user', 'function']
41+
model: ['user', 'function'],
42+
// System instructions shouldn't be in history.
43+
system: []
4044
};
4145

4246
export function validateChatHistory(history: Content[]): void {

0 commit comments

Comments
 (0)