File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ def test_textgen_with_multi_img() -> None:
3434
3535
3636def test_textgen_with_multi_local_img () -> None :
37- response = textgen_with_multi_local_img .generate_content ()
37+ response = textgen_with_multi_local_img .generate_content (
38+ "./test_data/latte.jpg" ,
39+ "./test_data/scones.jpg" ,
40+ )
3841 assert response
3942
4043
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515
16- def generate_content () -> str :
16+ def generate_content (image_path_1 : str , image_path_2 : str ) -> str :
1717 # [START googlegenaisdk_textgen_with_multi_local_img]
1818 from google import genai
1919 from google .genai .types import Part
2020
2121 client = genai .Client ()
2222
2323 # TODO(Developer): Update the below file paths to your images
24- with open ("path/to/your/image1.jpeg" , "rb" ) as f :
24+ # image_path_1 = "path/to/your/image1.jpg"
25+ # image_path_2 = "path/to/your/image2.jpg"
26+ with open (image_path_1 , "rb" ) as f :
2527 image_1_bytes = f .read ()
26- with open ("path/to/your/image2.jpeg" , "rb" ) as f :
28+ with open (image_path_2 , "rb" ) as f :
2729 image_2_bytes = f .read ()
2830
2931 response = client .models .generate_content (
@@ -49,4 +51,7 @@ def generate_content() -> str:
4951
5052
5153if __name__ == "__main__" :
52- generate_content ()
54+ generate_content (
55+ "./test_data/latte.jpg" ,
56+ "./test_data/scones.jpg" ,
57+ )
You can’t perform that action at this time.
0 commit comments