« lib/Langertha/Skeid/Protocol/Anthropic/Stream.pm
↑ Summary
blib/lib/Langertha/Skeid/CapacityProbe/Registry.pm »
| 1 | package Langertha::Skeid::Protocol::Ollama; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 114 | our $VERSION = '0.004'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Translate between the Ollama chat format and the upstream OpenAI call | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 114 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 114 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 114 | ▶ | use Langertha::Skeid::Protocol; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 114 | ▶ | use Langertha::ToolCall; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 256 | ▶ | sub request_to_openai { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request_to_openai: called CC=7 SCAR=19.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 256 | my ($class, $body) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 256 | ▶ | my $options = ref($body->{options}) eq 'HASH' ? $body->{options} : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | model => ($body->{model} // ''), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | messages => _messages_to_openai($body->{messages}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | (defined($options->{temperature}) ? (temperature => 0 + $options->{temperature}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | (defined($options->{num_predict}) ? (max_tokens => 0 + $options->{num_predict}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | (defined($body->{tools}) ? (tools => $body->{tools}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | (defined($body->{tool_choice}) ? (tool_choice => $body->{tool_choice}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 256 | ▶ | _response_format($body->{format}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition50%1/2
$body->{"model"} // ""
MC/DC0%0/1
$body->{"model"} // ""
$body->{"model"}
Truth table50%1/2
A
A= $body->{"model"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # Ollama's format -> OpenAI's response_format: "json" is any JSON object, a schema object is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # json_schema. Nothing else is a format (Ollama itself treats "" and null as none). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 256 | ▶ | sub _response_format { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_response_format: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 256 | my ($format) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 256 | ▶ | return (response_format => { type => 'json_object' }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $format and not ref $format and $format eq "json"
defined $format and not ref $format
MC/DC100%3/3
defined $format and not ref $format and $format eq "json"
defined $format
not ref $format
$format eq "json"
Truth table100%4/4
A and not(B) and C
A= defined $formatB= not ref $formatC= $format eq "json"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | if defined($format) && !ref($format) && $format eq 'json'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 252 | ▶ | return (response_format => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | type => 'json_schema', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | json_schema => { name => 'ollama_format', schema => $format }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | }) if ref($format) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 247 | return (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | # Assistant tool_calls: arguments object -> character JSON string, ids synthesized; tool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | # messages: tool_name -> tool_call_id of the matching call of the preceding assistant turn. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 256 | ▶ | sub _messages_to_openai { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_messages_to_openai: called CC=29 SCAR=36.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 256 | my ($messages) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 256 | ▶ | return [] unless ref($messages) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 256 | my $next_id = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 256 | my @unanswered; # [ id, name ] of the latest assistant turn's calls, not yet answered | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | my @out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 256 | for my $msg (@$messages) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 271 | ▶ | if (ref($msg) ne 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | push @out, $msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 271 | ▶ | my $role = $msg->{role} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$msg->{"role"} // ""
MC/DC0%0/1
$msg->{"role"} // ""
$msg->{"role"}
Truth table50%1/2
A
A= $msg->{"role"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 271 | ▶ | if ($role eq 'assistant' && ref($msg->{tool_calls}) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$role eq "assistant" and ref $msg->{"tool_calls"} eq "ARRAY"
MC/DC50%1/2
$role eq "assistant" and ref $msg->{"tool_calls"} eq "ARRAY"
$role eq "assistant"
ref $msg->{"tool_calls"} eq "ARRAY"
Truth table66%2/3
A and B
A= $role eq "assistant"B= ref $msg->{"tool_calls"} eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 5 | @unanswered = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 5 | my @calls; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 5 | for my $call (@{$msg->{tool_calls}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 9 | ▶ | if (ref($call) ne 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | push @calls, $call; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 9 | ▶ | my $function = ref($call->{function}) eq 'HASH' ? $call->{function} : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 9 | my $args = $function->{arguments}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 9 | ▶ | my $id = (defined($call->{id}) && length($call->{id})) ? $call->{id} : 'call_skeid_' . $next_id++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $call->{"id"} and length $call->{"id"}
MC/DC50%1/2
defined $call->{"id"} and length $call->{"id"}
defined $call->{"id"}
length $call->{"id"}
Truth table66%2/3
A and B
A= defined $call->{"id"}B= length $call->{"id"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 9 | ▶ | push @calls, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$args // "{}"
MC/DC0%0/1
$args // "{}"
$args
Truth table50%1/2
A
A= $args
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | %$call, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | id => $id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | type => 'function', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | function => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | %$function, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | arguments => (ref($args) ? Langertha::Skeid::Protocol::encode_json_text_safe($args) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | : ($args // '{}')), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 9 | ▶ | push @unanswered, [ $id, $function->{name} // '' ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$function->{"name"} // ""
MC/DC0%0/1
$function->{"name"} // ""
$function->{"name"}
Truth table50%1/2
A
A= $function->{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 5 | push @out, { %$msg, tool_calls => \@calls }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 5 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 266 | ▶ | if ($role eq 'tool') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 10 | my %tool = %$msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 10 | my $tool_name = delete $tool{tool_name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 10 | ▶ | if (defined($tool{tool_call_id}) && length($tool{tool_call_id})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
defined $tool{"tool_call_id"} and length $tool{"tool_call_id"}
MC/DC50%1/2
defined $tool{"tool_call_id"} and length $tool{"tool_call_id"}
defined $tool{"tool_call_id"}
length $tool{"tool_call_id"}
Truth table66%2/3
A and B
A= defined $tool{"tool_call_id"}B= length $tool{"tool_call_id"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | @unanswered = grep { $_->[0] ne $tool{tool_call_id} } @unanswered; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } elsif (@unanswered) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 9 | ▶ | my ($pick) = grep { defined($tool_name) && $unanswered[$_][1] eq $tool_name } 0 .. $#unanswered; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
defined $tool_name && $unanswered[$_][1] eq $tool_name
MC/DC100%2/2
defined $tool_name && $unanswered[$_][1] eq $tool_name
defined $tool_name
$unanswered[$_][1] eq $tool_name
Truth table100%3/3
A && B
A= defined $tool_nameB= $unanswered[$_][1] eq $tool_name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 9 | ▶ | $pick //= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$pick //= 0
MC/DC100%1/1
$pick //= 0
$pick
Truth table100%2/2
A
A= $pick
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 9 | $tool{tool_call_id} = $unanswered[$pick][0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 9 | splice @unanswered, $pick, 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 10 | push @out, \%tool; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 10 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 256 | ▶ | if ($role ne 'assistant' && ref($msg->{images}) eq 'ARRAY' && @{$msg->{images}}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
$role ne "assistant" and ref $msg->{"images"} eq "ARRAY" and @{$msg->{"images"};}
$role ne "assistant" and ref $msg->{"images"} eq "ARRAY"
MC/DC33%1/3
$role ne "assistant" and ref $msg->{"images"} eq "ARRAY" and @{$msg->{"images"};}
$role ne "assistant"
ref $msg->{"images"} eq "ARRAY"
@{$msg->{"images"};}
Truth table50%2/4
A and B and C
A= $role ne "assistant"B= ref $msg->{"images"} eq "ARRAY"C= @{$msg->{"images"};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 4 | my %with_images = %$msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 4 | my $images = delete $with_images{images}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 4 | my $text = $with_images{content}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | $with_images{content} = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | ((defined($text) && !ref($text) && length($text)) ? { type => 'text', text => "$text" } : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 4 | ▶ | map { _image_part($_) } grep { defined($_) && !ref($_) && length($_) } @$images, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition41%5/12
defined $text and not ref $text and length $text
defined $text and not ref $text
defined $_ && !ref($_) && length $_
defined $_ and not ref $_
MC/DC33%1/3
defined $text and not ref $text and length $text
defined $text
not ref $text
length $text
MC/DC0%0/3
defined $_ && !ref($_) && length $_
defined $_
not ref $_
length $_
Truth table50%2/4
A and not(B) and C
A= defined $textB= not ref $textC= length $text
Truth table25%1/4
A and not(B) && C
A= defined $_B= not ref $_C= length $_
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 4 | push @out, \%with_images; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 4 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 252 | push @out, $msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 256 | return \@out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | # Ollama sends images as raw base64 without a type; the OpenAI upstream wants a URL. A client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | # that already sends a data: URL keeps it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 8 | ▶ | sub _image_part { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_image_part: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 8 | my ($image) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 8 | ▶ | return Langertha::Skeid::Protocol::image_url_part($image) if $image =~ /\Adata:/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 8 | return Langertha::Skeid::Protocol::image_url_part(undef, $image); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 79 | ▶ | sub response_from_openai { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
response_from_openai: called CC=17 SCAR=28.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 79 | my ($class, $res) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 79 | ▶ | my $choice = (ref($res->{choices}) eq 'ARRAY' ? $res->{choices}[0] : {}) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
MC/DC0%0/1
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {})
Truth table50%1/2
A
A= (ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 79 | ▶ | my $msg = $choice->{message} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$choice->{'message'} || {}
MC/DC100%1/1
$choice->{'message'} || {}
$choice->{'message'}
Truth table100%2/2
A
A= $choice->{'message'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 79 | ▶ | my $text = ($msg->{content} // ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$msg->{"content"} // ""
MC/DC100%1/1
$msg->{"content"} // ""
$msg->{"content"}
Truth table100%2/2
A
A= $msg->{"content"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 79 | my $tool_calls = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 79 | ▶ | if (ref($msg->{tool_calls}) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 1 | ▶ | my @calls = Langertha::ToolCall->extract('openai', $res || {}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$res || {}
MC/DC0%0/1
$res || {}
$res
Truth table50%1/2
A
A= $res
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | $tool_calls = [ map { $_->to_ollama } @calls ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | } elsif (length($text)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 77 | my ($clean, $calls) = Langertha::ToolCall->extract_hermes_from_text($text); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 77 | ▶ | if (@$calls) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $text = $clean; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | $tool_calls = [ map { $_->to_ollama } @$calls ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | model => ($res->{model} // ''), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | created_at => Langertha::Skeid::Protocol::iso8601_now(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | message => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | role => ($msg->{role} // 'assistant'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | content => $text, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | (@$tool_calls ? (tool_calls => $tool_calls) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | done => \1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | done_reason => ($choice->{finish_reason} // 'stop'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | prompt_eval_count => 0 + (($res->{usage} || {})->{prompt_tokens} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 79 | ▶ | eval_count => 0 + (($res->{usage} || {})->{completion_tokens} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%14/14
$res->{"model"} // ""
$msg->{"role"} // "assistant"
$choice->{"finish_reason"} // "stop"
+($res->{"usage"} || {})->{"prompt_tokens"} // 0
$res->{'usage'} || {}
+($res->{"usage"} || {})->{"completion_tokens"} // 0
$res->{'usage'} || {}
MC/DC100%1/1
$res->{"model"} // ""
$res->{"model"}
MC/DC100%1/1
$msg->{"role"} // "assistant"
$msg->{"role"}
MC/DC100%1/1
$choice->{"finish_reason"} // "stop"
$choice->{"finish_reason"}
MC/DC100%1/1
+($res->{"usage"} || {})->{"prompt_tokens"} // 0
$res->{'usage'}
MC/DC100%1/1
+($res->{"usage"} || {})->{"completion_tokens"} // 0
$res->{'usage'}
Truth table100%2/2
A
A= $res->{"model"}
Truth table100%2/2
A
A= $msg->{"role"}
Truth table100%2/2
A
A= $choice->{"finish_reason"}
Truth table100%2/2
A
A= $res->{'usage'}
Truth table100%2/2
A
A= $res->{'usage'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 95 | ▶ | sub generate_request_to_openai { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_request_to_openai: called CC=10 SCAR=24.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 95 | my ($class, $body) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 95 | my $prompt = $body->{prompt}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 95 | my @messages; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | push @messages, { role => 'system', content => "$body->{system}" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 95 | ▶ | if defined($body->{system}) && !ref($body->{system}) && length($body->{system}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
defined $body->{"system"} and not ref $body->{"system"} and length $body->{"system"}
defined $body->{"system"} and not ref $body->{"system"}
MC/DC33%1/3
defined $body->{"system"} and not ref $body->{"system"} and length $body->{"system"}
defined $body->{"system"}
not ref $body->{"system"}
length $body->{"system"}
Truth table50%2/4
A and not(B) and C
A= defined $body->{"system"}B= not ref $body->{"system"}C= length $body->{"system"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | push @messages, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | role => 'user', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | content => ((defined($prompt) && !ref($prompt)) ? "$prompt" : ''), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 95 | ▶ | (ref($body->{images}) eq 'ARRAY' ? (images => $body->{images}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $prompt and not ref $prompt
MC/DC0%0/2
defined $prompt and not ref $prompt
defined $prompt
not ref $prompt
Truth table33%1/3
A and not(B)
A= defined $promptB= not ref $prompt
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | return $class->request_to_openai({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | (exists $body->{model} ? (model => $body->{model}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | (exists $body->{options} ? (options => $body->{options}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 95 | ▶ | (exists $body->{format} ? (format => $body->{format}) : ()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | messages => \@messages, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 34 | ▶ | sub generate_response_from_openai { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_response_from_openai: called CC=10 SCAR=25.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 34 | my ($class, $res) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 34 | ▶ | my $choice = (ref($res->{choices}) eq 'ARRAY' ? $res->{choices}[0] : {}) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
MC/DC0%0/1
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {})
Truth table50%1/2
A
A= (ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 34 | ▶ | my $msg = $choice->{message} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$choice->{'message'} || {}
MC/DC0%0/1
$choice->{'message'} || {}
$choice->{'message'}
Truth table50%1/2
A
A= $choice->{'message'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 34 | ▶ | my $usage = $res->{usage} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$res->{'usage'} || {}
MC/DC0%0/1
$res->{'usage'} || {}
$res->{'usage'}
Truth table50%1/2
A
A= $res->{'usage'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | model => ($res->{model} // ''), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | created_at => Langertha::Skeid::Protocol::iso8601_now(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | response => ($msg->{content} // ''), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | done => \1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | done_reason => ($choice->{finish_reason} // 'stop'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | prompt_eval_count => 0 + ($usage->{prompt_tokens} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 34 | ▶ | eval_count => 0 + ($usage->{completion_tokens} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition70%7/10
$res->{"model"} // ""
$msg->{"content"} // ""
$choice->{"finish_reason"} // "stop"
$usage->{"prompt_tokens"} // 0
$usage->{"completion_tokens"} // 0
MC/DC0%0/1
$res->{"model"} // ""
$res->{"model"}
MC/DC0%0/1
$msg->{"content"} // ""
$msg->{"content"}
MC/DC0%0/1
$choice->{"finish_reason"} // "stop"
$choice->{"finish_reason"}
MC/DC100%1/1
$usage->{"prompt_tokens"} // 0
$usage->{"prompt_tokens"}
MC/DC100%1/1
$usage->{"completion_tokens"} // 0
$usage->{"completion_tokens"}
Truth table50%1/2
A
A= $res->{"model"}
Truth table50%1/2
A
A= $msg->{"content"}
Truth table50%1/2
A
A= $choice->{"finish_reason"}
Truth table100%2/2
A
A= $usage->{"prompt_tokens"}
Truth table100%2/2
A
A= $usage->{"completion_tokens"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 13 | ▶ | sub tags_from_models { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tags_from_models: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 13 | my ($class, $models) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | my @models = map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | +{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | name => $_->{model}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | model => $_->{model}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | modified_at => Langertha::Skeid::Protocol::iso8601_now(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | size => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | digest => '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | details => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 23 | ▶ | family => ($_->{engine} || 'openaibase'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$_->{'engine'} || 'openaibase'
MC/DC100%1/1
$_->{'engine'} || 'openaibase'
$_->{'engine'}
Truth table100%2/2
A
A= $_->{'engine'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | parameter_size => 'unknown', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | quantization_level => 'unknown', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 13 | ▶ | } @{$models || []}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$models || []
MC/DC0%0/1
$models || []
$models
Truth table50%1/2
A
A= $models
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 13 | return { models => \@models }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 19 | ▶ | sub manifest_endpoint { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
manifest_endpoint: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 19 | dialect => 'ollama', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | path => '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | capabilities => [qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | chat streaming system_prompt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | tools_native tools_hermes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | temperature response_size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | image_input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | response_format_json_object response_format_json_schema | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 107 | ▶ | sub error_body { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error_body: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 107 | my ($class, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 107 | ▶ | return { error => '' . ($message // '') }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$message // ""
MC/DC0%0/1
$message // ""
$message
Truth table50%1/2
A
A= $message
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 114 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||