Skip to content

Commit d0321ce

Browse files
committed
feat(genai): Add generate content with routing option
1 parent e6893e6 commit d0321ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

genai/content_cache/contentcache_create_with_txt_gcs_pdf.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"fmt"
2323
"io"
24+
"time"
2425

2526
genai "google.golang.org/genai"
2627
)
@@ -65,7 +66,7 @@ func createContentCache(w io.Writer) (string, error) {
6566
},
6667
},
6768
DisplayName: "example-cache",
68-
TTL: "86400s",
69+
TTL: time.Duration(86400),
6970
}
7071

7172
res, err := client.Caches.Create(ctx, modelName, config)

genai/content_cache/contentcache_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func updateContentCache(w io.Writer, cacheName string) error {
3838

3939
// Update expire time using TTL
4040
resp, err := client.Caches.Update(ctx, cacheName, &genai.UpdateCachedContentConfig{
41-
TTL: int64(36000),
41+
TTL: time.Duration(36000),
4242
})
4343
if err != nil {
4444
return fmt.Errorf("failed to update content cache exp. time with TTL: %w", err)

0 commit comments

Comments
 (0)