Skip to content

Commit

Permalink
genai: add explicit MIME type CreateCachedContent example (#199)
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).

Fixes #198.
  • Loading branch information
jba authored Jul 26, 2024
1 parent 12dc289 commit 2bfb559
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 @@ -1223,7 +1223,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 @@ -1262,7 +1262,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 2bfb559

Please sign in to comment.