From 31c5dfa6b2a60ff69c256c7e8f7d9df7c68d1da3 Mon Sep 17 00:00:00 2001 From: Ashpreet Bedi Date: Thu, 19 Sep 2024 00:43:30 +0100 Subject: [PATCH] Add image to run function --- cookbook/agents/image.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cookbook/agents/image.py b/cookbook/agents/image.py index 88d08b6ef..f2f0dac35 100644 --- a/cookbook/agents/image.py +++ b/cookbook/agents/image.py @@ -8,10 +8,26 @@ debug_mode=True, ) -run1: RunResponse = agent.run( - "What’s in this image?", +# run: RunResponse = agent.run( +# "What’s in this image?", +# images=[ +# "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" +# ], +# ) # type: ignore +# run: RunResponse = agent.run( +# "What’s in this image?", +# images=[ +# { +# "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", +# "detail": "high", +# } +# ], +# ) # type: ignore +run: RunResponse = agent.run( + "What are in these images? Is there any difference between them?", images=[ - "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" + "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", + "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", ], ) # type: ignore -pprint(run1.content) +pprint(run.content)