Skip to content

Commit a32421d

Browse files
committed
Remove request.systemInstruction validation
We only define system prompts via onDeviceParams initialization.
1 parent 8056bc9 commit a32421d

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

packages/vertexai/src/methods/chrome-adapter.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import {
2020
GenerateContentRequest,
2121
InferenceMode,
2222
Part,
23-
Role,
24-
TextPart
23+
Role
2524
} from '../types';
2625
import {
2726
Availability,
@@ -127,25 +126,6 @@ export class ChromeAdapter {
127126
}
128127
}
129128

130-
if (request.systemInstruction) {
131-
const systemContent = request.systemInstruction as Content;
132-
// Returns false if the role can't be represented on-device.
133-
if (systemContent.role && systemContent.role === 'function') {
134-
return false;
135-
}
136-
137-
// Returns false if the system prompt is multi-part.
138-
if (systemContent.parts && systemContent.parts.length > 1) {
139-
return false;
140-
}
141-
142-
// Returns false if the system prompt isn't text.
143-
const systemText = request.systemInstruction as TextPart;
144-
if (!systemText.text) {
145-
return false;
146-
}
147-
}
148-
149129
return true;
150130
}
151131
private download(): void {

0 commit comments

Comments
 (0)