Branch Coverage

blib/lib/AI/Anthropic.pm
Criterion Covered Total %
branch 2 46 4.3


line true false branch
96 1 2 unless my $api_key = $args{'api_key'} // $ENV{'ANTHROPIC_API_KEY'}
127 0 0 unless defined $content
155 0 0 unless my $messages = $args{'messages'}
165 0 0 if defined $args{'system'}
166 0 0 if defined $args{'temperature'}
167 0 0 if defined $args{'tools'}
168 0 0 if defined $args{'tool_choice'}
171 0 0 if (my $stream_cb = $args{'stream'}) { }
212 0 0 if (ref $content eq 'ARRAY') { }
215 0 0 if ($part->{'type'} eq 'image' and $part->{'path'}) { }
0 0 elsif ($part->{'type'} eq 'image' and $part->{'url'}) { }
0 0 elsif ($part->{'type'} eq 'image' and $part->{'base64'}) { }
246 0 0 unless open my $fh, "<:raw", $path
254 0 0 if ($path =~ /\.jpe?g$/i) { }
0 0 elsif ($path =~ /\.gif$/i) { }
0 0 elsif ($path =~ /\.webp$/i) { }
317 0 0 unless $line =~ /^data: (.+)/
319 0 0 if $data eq "[DONE]"
324 0 0 if ($event->{'type'} eq 'content_block_delta') { }
0 0 elsif ($event->{'type'} eq 'message_stop') { }
327 0 0 if $callback
337 0 0 unless ($response->{'success'})
366 0 0 unless ($response->{'success'})