Skip to content
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): adds a Gemini video example #3612

Closed
wants to merge 6 commits into from

Conversation

ghchinoy
Copy link
Contributor

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed Contributing Guidelines from CONTRIBUTING.MD
  • Tests pass: go test -v ./.. (see Testing)
  • Code formatted: gofmt (see Formatting)
  • Vetting pass: go vet (see Formatting)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@ghchinoy ghchinoy requested a review from a team as a code owner December 13, 2023 07:53
Copy link

snippet-bot bot commented Dec 13, 2023

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Dec 13, 2023
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

vertexai/multimodal-video/multimodal-video.go Outdated Show resolved Hide resolved
vertexai/multimodal-video/multimodal-video.go Outdated Show resolved Hide resolved
vertexai/multimodal-video/multimodal-video.go Outdated Show resolved Hide resolved
vertexai/multimodal-video/multimodal-video.go Outdated Show resolved Hide resolved
vertexai/multimodal-video/multimodal-video.go Outdated Show resolved Hide resolved
@ghchinoy ghchinoy requested a review from jba December 14, 2023 03:55
}
defer client.Close()

ctx, cancel := context.WithTimeout(ctx, time.Second*50)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense in a sample?

)

func TestGenerateMultimodalContent(t *testing.T) {
t.Skip("TODO(muncus): remove skip")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed, now that the models are generally available.

ctx := context.Background()

// create video part
video, err := partFromGCSURI(ctx, "gs://cloud-samples-data/video/animals.mp4")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work with a genai.FileData object? If so, it would simplify the sample considerably since we could remove this helper method.

video,
}

if projectID == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary, as testutil.SystemTest ensures we have a non-empty project id.

}

var buf bytes.Buffer
if err := generateMultimodalContent(ctx, os.Stdout, prompt, projectID, location, modelName); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err := generateMultimodalContent(ctx, os.Stdout, prompt, projectID, location, modelName); err != nil {
if err := generateMultimodalContent(ctx, &buf, prompt, projectID, location, modelName); err != nil {

@Deleplace
Copy link
Contributor

Sorry, I was unaware of this PR and opened #3774 for the same purpose

@muncus
Copy link
Collaborator

muncus commented May 24, 2024

It looks like Deleplace's duplicate PR #3774 was merged, so i'll close this one. please reopen if it is still needed.

@muncus muncus closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants