From e9838ce91efad24e94cb377888dbbdbd1b97ea90 Mon Sep 17 00:00:00 2001 From: antononcube Date: Sun, 17 Mar 2024 15:16:48 -0400 Subject: [PATCH] tests:Added Gemini's AI-vision tests. --- xt/08-llm-vision-functions.rakutest | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xt/08-llm-vision-functions.rakutest b/xt/08-llm-vision-functions.rakutest index 5287115..aab1231 100644 --- a/xt/08-llm-vision-functions.rakutest +++ b/xt/08-llm-vision-functions.rakutest @@ -6,6 +6,7 @@ use lib './lib'; use LLM::Functions; use LLM::Functions::Configuration; use LLM::Functions::Evaluator; +use Image::Markup::Utilities; use Test; @@ -14,10 +15,9 @@ plan *; #=========================================================== ## 1 #=========================================================== - my $url1 = 'https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/MarkdownDocuments/Diagrams/AI-vision-via-WL/0iyello2xfyfo.png'; -isa-ok llm-vision-synthesize('Describe the image.', $url1), Str; +isa-ok llm-vision-synthesize('Describe the image.', $url1), Str; #=========================================================== ## 2 @@ -26,4 +26,22 @@ isa-ok llm-vision-synthesize('Describe the image.', $url1), Str; #say llm-vision-function({"For the given image answer the question: $_ . Be as concise as possible in your answers."}, $url1)('How many years are present?'); isa-ok llm-vision-function({"For the given image answer the question: $_ . Be as concise as possible in your answers."}, $url1), Callable; +#=========================================================== +## 3 +#=========================================================== + +# Gemini does not work with URLs, only images. + +nok llm-vision-synthesize('Describe the image.', $url1, e => 'Gemini'); + +#=========================================================== +## 4 +#=========================================================== + +# Gemini does not work with URLs, only images. +my $img4 = image-import($url1); + +isa-ok llm-vision-synthesize('Describe the image.', $img4, e => 'Gemini'), Str; + + done-testing;