-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(vertexai): support system instruction #9330
Conversation
Add a function calling example
Fix typo in project ID string
… google-cloud-vertexai SDK Use the same example for the token count as in Python and Golang
# Conflicts: # vertexai/snippets/src/main/java/vertexai/gemini/FunctionCalling.java # vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java
…eedback, fixing region tags, and clarifying comments)
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
System.out.println(output); | ||
} | ||
|
||
// Ask the model to translate from English to French thanks to a system instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Ask the model to translate from English to French thanks to a system instruction. | |
// Ask the model to translate from English to French with a system instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks, just one nit in the comment.
…ctable output, removing an assert)
public static void main(String[] args) throws Exception { | ||
// TODO(developer): Replace these variables before running the sample. | ||
String projectId = "your-google-cloud-project-id"; | ||
String location = "us-central1"; | ||
String modelName = "gemini-1.5-pro-preview-0409"; | ||
|
||
String output = translateToFrench(projectId, location, modelName); | ||
System.out.println(output); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It is a good practice to exclude the code of main()
from the code snippet. To do this you need to place TWO region tag START/END comments around necessary imports and around the code sample method.
output = ResponseHandler.getText(response); | ||
return output; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think it can be a direct return.
* Remove the preview package Add a function calling example * Missing license header * chore(Checkstyle tweak) * Add missing region tag Fix typo in project ID string * Use the latest libraries-bom that references the 0.4.0 version of the google-cloud-vertexai SDK Use the same example for the token count as in Python and Golang * feat(vertexai): Multimodal snippets using Gemini 1.5 * feat(vertexai): Multimodal snippets using Gemini 1.5 (checkstyle and header tweaks) * feat(vertexai): Multimodal snippets using Gemini 1.5 (incorporating feedback, fixing region tags, and clarifying comments) * chore(vertexai): Update to the latest version of the libraries-bom * chore(vertexai): tweak tests * feat(vertexai): System instruction example * feat(vertexai): Add region tag for system instruction test * feat(vertexai): Add region tag for system instruction test (comment nit) * feat(vertexai): Add region tag for system instruction test (non-predictable output, removing an assert)
Description
Fixes b/338204721
(internal bug reference)
Add support for system instruction.