| 1 | package Langertha::Knarr::Request; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Normalized chat request shared across all Knarr protocols | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 21 | our $VERSION = '1.103'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 21 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | has model => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | isa => 'Maybe[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 21 | writer => '_set_model', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | has grant => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | isa => 'Maybe[HashRef]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 162 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 21 | writer => '_set_grant', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | has messages => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | isa => 'ArrayRef[HashRef]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 28 | ▶ | default => sub { [] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 21 | has stream => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | isa => 'Bool', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | default => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | has temperature => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | isa => 'Maybe[Num]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 82 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | has max_tokens => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | isa => 'Maybe[Int]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 110 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | has reasoning_effort => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | isa => 'Maybe[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 85 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | has seed => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | isa => 'Maybe[Int]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 119 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | has parallel_tool_use => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | isa => 'Maybe[Bool]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 146 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | has prompt_cache_key => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | isa => 'Maybe[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 147 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | has tools => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | isa => 'Maybe[ArrayRef]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 81 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | has tool_choice => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 109 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | has response_format => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 114 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | has system => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | isa => 'Maybe[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 128 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | has session_id => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | isa => 'Maybe[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 149 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 21 | has protocol => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | required => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | has raw => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | isa => 'HashRef', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 87 | ▶ | default => sub { {} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | has extra => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | isa => 'HashRef', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 87 | ▶ | default => sub { {} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 21 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 9 | ▶ | sub forward_header_pairs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
forward_header_pairs: called CC=3 SCAR=12.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 9 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 9 | my $fwd = $self->extra->{forward_headers}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return map { [ @$_ ] } @$fwd if ref $fwd eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | return map { [ $_, $fwd->{$_} ] } sort keys %$fwd if ref $fwd eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 9 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | sub apply_grant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
apply_grant: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | my ($self, $grant) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $self->_set_grant($grant); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | my $model = $self->model; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | $self->_set_model( $grant->{model} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if !( defined $model && length $model ) && $grant && defined $grant->{model}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
not defined $model && length $model and $grant and defined $grant->{"model"}
not defined $model && length $model and $grant
defined $model && length $model
MC/DC0%0/4
not defined $model && length $model and $grant and defined $grant->{"model"}
defined $model
length $model
$grant
defined $grant->{"model"}
Truth table0%0/7
not(A && B) and C and D
A= defined $modelB= length $modelC= $grantD= defined $grant->{"model"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | sub forward_header { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
forward_header: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | return map { $_->[1] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | grep { lc $_->[0] eq lc $name && defined $_->[1] } $self->forward_header_pairs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
lc $_->[0] eq lc $name && defined $_->[1]
MC/DC0%0/2
lc $_->[0] eq lc $name && defined $_->[1]
lc $_->[0] eq lc $name
defined $_->[1]
Truth table0%0/3
A && B
A= lc $_->[0] eq lc $nameB= defined $_->[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # Which capability flag a given response_format value requires. Only an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | # explicit json_schema type needs the schema flag; json_object, Ollama's | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | # bare 'json' string and any raw-schema HashRef fall back to the object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # flag, which is the weaker of the two. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 7 | ▶ | sub _response_format_cap { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_response_format_cap: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 7 | my ($rf) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | return 'response_format_json_schema' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 7 | ▶ | if ref($rf) eq 'HASH' && ( $rf->{type} // '' ) eq 'json_schema'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
ref $rf eq "HASH" and ($rf->{"type"} // "") eq "json_schema"
$rf->{"type"} // ""
MC/DC50%1/2
ref $rf eq "HASH" and ($rf->{"type"} // "") eq "json_schema"
ref $rf eq "HASH"
$rf->{"type"}
Truth table66%2/3
A and B
A= ref $rf eq "HASH"B= $rf->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 5 | return 'response_format_json_object'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 32 | ▶ | sub chat_f_args { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
chat_f_args: called CC=22 SCAR=30.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 32 | my ($self, $engine) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | my $supports = $engine && $engine->can('supports') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 75 | ▶ | ? sub { $engine->supports($_[0]) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 32 | ▶ | : sub { 1 }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
Condition66%2/3
$engine and $engine->can("supports")
MC/DC50%1/2
$engine and $engine->can("supports")
$engine
$engine->can("supports")
Truth table66%2/3
A and B
A= $engineB= $engine->can("supports")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 32 | my $rf = $self->response_format; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 32 | ▶ | my $tools_ok = $supports->('tools_native') || $supports->('tools_hermes'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
&$supports('tools_native') || &$supports('tools_hermes')
MC/DC100%2/2
&$supports('tools_native') || &$supports('tools_hermes')
&$supports('tools_native')
&$supports('tools_hermes')
Truth table100%3/3
A || B
A= &$supports('tools_native')B= &$supports('tools_hermes')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 32 | my @args = ( messages => $self->messages ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 32 | ▶ | push @args, tools => $self->tools if $self->tools && $tools_ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->tools and $tools_ok
MC/DC100%2/2
$self->tools and $tools_ok
$self->tools
$tools_ok
Truth table100%3/3
A and B
A= $self->toolsB= $tools_ok
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 32 | ▶ | push @args, tool_choice => $self->tool_choice if defined $self->tool_choice && $tools_ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->tool_choice and $tools_ok
MC/DC100%2/2
defined $self->tool_choice and $tools_ok
defined $self->tool_choice
$tools_ok
Truth table100%3/3
A and B
A= defined $self->tool_choiceB= $tools_ok
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 32 | ▶ | push @args, response_format => $rf if defined $rf && $supports->( _response_format_cap($rf) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $rf and &$supports(_response_format_cap($rf))
MC/DC100%2/2
defined $rf and &$supports(_response_format_cap($rf))
defined $rf
&$supports(_response_format_cap($rf))
Truth table100%3/3
A and B
A= defined $rfB= &$supports(_response_format_cap($rf))
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 32 | ▶ | push @args, temperature => $self->temperature if defined $self->temperature && $supports->('temperature'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->temperature and &$supports("temperature")
MC/DC100%2/2
defined $self->temperature and &$supports("temperature")
defined $self->temperature
&$supports("temperature")
Truth table100%3/3
A and B
A= defined $self->temperatureB= &$supports("temperature")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 32 | ▶ | push @args, max_tokens => $self->max_tokens if defined $self->max_tokens && $supports->('response_size'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->max_tokens and &$supports("response_size")
MC/DC100%2/2
defined $self->max_tokens and &$supports("response_size")
defined $self->max_tokens
&$supports("response_size")
Truth table100%3/3
A and B
A= defined $self->max_tokensB= &$supports("response_size")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 32 | ▶ | push @args, reasoning_effort => $self->reasoning_effort if defined $self->reasoning_effort && $supports->('reasoning_effort'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->reasoning_effort and &$supports("reasoning_effort")
MC/DC100%2/2
defined $self->reasoning_effort and &$supports("reasoning_effort")
defined $self->reasoning_effort
&$supports("reasoning_effort")
Truth table100%3/3
A and B
A= defined $self->reasoning_effortB= &$supports("reasoning_effort")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 32 | ▶ | push @args, seed => $self->seed if defined $self->seed && $supports->('seed'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->seed and &$supports("seed")
MC/DC100%2/2
defined $self->seed and &$supports("seed")
defined $self->seed
&$supports("seed")
Truth table100%3/3
A and B
A= defined $self->seedB= &$supports("seed")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 32 | ▶ | push @args, parallel_tool_use => $self->parallel_tool_use if defined $self->parallel_tool_use && $supports->('parallel_tool_use'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->parallel_tool_use and &$supports("parallel_tool_use")
MC/DC100%2/2
defined $self->parallel_tool_use and &$supports("parallel_tool_use")
defined $self->parallel_tool_use
&$supports("parallel_tool_use")
Truth table100%3/3
A and B
A= defined $self->parallel_tool_useB= &$supports("parallel_tool_use")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 32 | ▶ | push @args, prompt_cache_key => $self->prompt_cache_key if defined $self->prompt_cache_key && $supports->('prompt_cache_key'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->prompt_cache_key and &$supports("prompt_cache_key")
MC/DC100%2/2
defined $self->prompt_cache_key and &$supports("prompt_cache_key")
defined $self->prompt_cache_key
&$supports("prompt_cache_key")
Truth table100%3/3
A and B
A= defined $self->prompt_cache_keyB= &$supports("prompt_cache_key")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 32 | return @args; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 21 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 21 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||