Skip to content

Commit

Permalink
genai: add explicit MIME type CreateCachedContent example
Browse files Browse the repository at this point in the history
The model seems to require it (even though it correctly infers
that the MIME type is text/plain).
  • Loading branch information
jba committed Jul 26, 2024
1 parent a0252ef commit 9f5281e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion genai/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ func ExampleCachedContent_create() {
}
defer client.Close()

file, err := uploadFile(ctx, client, filepath.Join(testDataDir, "a11.txt"), "")
file, err := uploadFile(ctx, client, filepath.Join(testDataDir, "a11.txt"), "text/plain")
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion genai/internal/samples/docs-snippets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ func ExampleCachedContent_create() {

// [START cache_create]
// [START cache_delete]
file, err := uploadFile(ctx, client, filepath.Join(testDataDir, "a11.txt"), "")
file, err := uploadFile(ctx, client, filepath.Join(testDataDir, "a11.txt"), "text/plain")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 9f5281e

Please sign in to comment.