Skip to content

Commit 22b7366

Browse files
matthew29tangcopybara-github
authored andcommitted
chore: Remove/update tests for the deprecated product recontext model.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#740 from googleapis:release-please--branches--main 830f5af PiperOrigin-RevId: 893758362
1 parent bbbc061 commit 22b7366

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

examples/models/recontext_image/image.go

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,47 +47,26 @@ func run(ctx context.Context) {
4747
fmt.Println("Calling GeminiAPI Backend...")
4848
}
4949

50-
fmt.Println("Product recontext example. Only supported in BackendVertexAI.")
51-
productImage := &genai.ProductImage{
52-
ProductImage: &genai.Image{GCSURI: "gs://genai-sdk-tests/inputs/images/backpack1.png"},
53-
}
54-
productImages := []*genai.ProductImage{productImage}
55-
prompt := "On a school desk."
56-
response1, err := client.Models.RecontextImage(
57-
ctx, "imagen-product-recontext-preview-06-30",
58-
&genai.RecontextImageSource{
59-
Prompt: prompt,
60-
PersonImage: nil,
61-
ProductImages: productImages},
62-
&genai.RecontextImageConfig{
63-
OutputMIMEType: "image/jpeg",
64-
},
65-
)
66-
if err != nil {
67-
log.Fatal(err)
68-
}
69-
print(response1)
70-
7150
fmt.Println("Virtual try-on example. Only supported in BackendVertexAI.")
7251
productImagePants := &genai.ProductImage{
7352
ProductImage: &genai.Image{GCSURI: "gs://genai-sdk-tests/inputs/images/pants.jpg"},
7453
}
7554
personImage := &genai.Image{GCSURI: "gs://genai-sdk-tests/inputs/images/man.jpg"}
76-
productImages2 := []*genai.ProductImage{productImagePants}
77-
response2, err := client.Models.RecontextImage(
55+
productImages := []*genai.ProductImage{productImagePants}
56+
response, err := client.Models.RecontextImage(
7857
ctx, "virtual-try-on-exp-05-31",
7958
&genai.RecontextImageSource{
8059
Prompt: "",
8160
PersonImage: personImage,
82-
ProductImages: productImages2},
61+
ProductImages: productImages},
8362
&genai.RecontextImageConfig{
8463
OutputMIMEType: "image/jpeg",
8564
},
8665
)
8766
if err != nil {
8867
log.Fatal(err)
8968
}
90-
print(response2)
69+
print(response)
9170
}
9271

9372
func main() {

0 commit comments

Comments
 (0)