File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/vertexai/src/methods Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,17 @@ const VALID_PART_FIELDS: Array<keyof Part> = [
30
30
const VALID_PARTS_PER_ROLE : { [ key in Role ] : Array < keyof Part > } = {
31
31
user : [ 'text' , 'inlineData' ] ,
32
32
function : [ 'functionResponse' ] ,
33
- model : [ 'text' , 'functionCall' ]
33
+ model : [ 'text' , 'functionCall' ] ,
34
+ // System instructions shouldn't be in history anyway.
35
+ system : [ 'text' ]
34
36
} ;
35
37
36
38
const VALID_PREVIOUS_CONTENT_ROLES : { [ key in Role ] : Role [ ] } = {
37
39
user : [ 'model' ] ,
38
40
function : [ 'model' ] ,
39
- model : [ 'user' , 'function' ]
41
+ model : [ 'user' , 'function' ] ,
42
+ // System instructions shouldn't be in history.
43
+ system : [ ]
40
44
} ;
41
45
42
46
export function validateChatHistory ( history : Content [ ] ) : void {
You can’t perform that action at this time.
0 commit comments