You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: [vertexai] adding system instruction support (#10775)
* feat(systeminstructions): adding system instructions support
* feat(systeminstructions): formatting tweaks
* feat(systeminstructions): use an optional for system instructions
* feat(systeminstructions): update field name, add getter and setter
* feat(systeminstructions): adding integration test for system instructions
Copy file name to clipboardExpand all lines: java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/GenerativeModel.java
+82-18Lines changed: 82 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@
36
36
importjava.io.IOException;
37
37
importjava.util.Arrays;
38
38
importjava.util.List;
39
+
importjava.util.Optional;
39
40
40
41
/** This class holds a generative model that can complete what you provided. */
41
42
publicfinalclassGenerativeModel {
@@ -45,6 +46,7 @@ public final class GenerativeModel {
Copy file name to clipboardExpand all lines: java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/GenerativeModelTest.java
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -324,6 +324,28 @@ public void testGenerateContentwithContents() throws Exception {
Copy file name to clipboardExpand all lines: java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/it/ITGenerativeModelIntegrationTest.java
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ public class ITGenerativeModelIntegrationTest {
58
58
59
59
// Tested content
60
60
privatestaticfinalStringTEXT = "What do you think about Google Pixel?";
61
+
privatestaticfinalStringPIRATE_INSTRUCTION = "Speak like a pirate when answering questions.";
61
62
privatestaticfinalStringIMAGE_INQUIRY = "Please describe this image: ";
0 commit comments