lib/Langertha/Skeid/Protocol/Ollama.pm

filter: Statementstmt 92.5% 99 / 107 Branchbran 82.8% 53 / 64 Conditioncond 69.7% 69 / 99 MC/DCmcdc 44.0% 22 / 50 Subroutinesub 100% 14 / 14 Podpod 100% 7 / 7 totaltotal 77.4% 264 / 341 CC 77 SCAR 29.7
CC
77
Cov
82%
_messages_to_openai
38.6
response_from_openai
17.6
generate_response_from_openai
12.8
CRAP 19.5
« 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
BranchTrueFalseTotal
ref $body->{'options'} eq 'HASH' ? : 1 255 256
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
BranchTrueFalseTotal
defined $options->{'temperature'} ? : 1 255 256
defined $options->{'num_predict'} ? : 1 255 256
defined $body->{'tools'} ? : 2 254 256
defined $body->{'tool_choice'} ? : 0 256 256
Condition50%1/2
$body->{"model"} // ""
l!l
2560
MC/DC0%0/1
$body->{"model"} // ""
$body->{"model"}
Truth table50%1/2
A
A= $body->{"model"}
Aresult
11
00
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
BranchTrueFalseTotal
if defined $format and not ref $format and $format eq "json" 4 252 256
Condition100%6/6
defined $format and not ref $format and $format eq "json"
!ll&&!rl&&r
24844
defined $format and not ref $format
!ll&&!rl&&r
24358
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"
ABCresult
0XX0
10X0
1100
1111
30 if defined($format) && !ref($format) && $format eq 'json';
31 252 ▶ return (response_format => {
Branch: 1 branch
BranchTrueFalseTotal
if ref $format eq "HASH" 5 247 252
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
BranchTrueFalseTotal
unless ref $messages eq "ARRAY" 0 256 256
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
BranchTrueFalseTotal
if (ref $msg ne "HASH") 0 271 271
50 0 push @out, $msg;
51 0 next;
52 }
53 271 ▶ my $role = $msg->{role} // '';
Condition50%1/2
$msg->{"role"} // ""
l!l
2710
MC/DC0%0/1
$msg->{"role"} // ""
$msg->{"role"}
Truth table50%1/2
A
A= $msg->{"role"}
Aresult
11
00
54  
55 271 ▶ if ($role eq 'assistant' && ref($msg->{tool_calls}) eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if ($role eq "assistant" and ref $msg->{"tool_calls"} eq "ARRAY") 5 266 271
Condition66%2/3
$role eq "assistant" and ref $msg->{"tool_calls"} eq "ARRAY"
!ll&&!rl&&r
26605
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"
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if (ref $call ne "HASH") 0 9 9
60 0 push @calls, $call;
61 0 next;
62 }
63 9 ▶ my $function = ref($call->{function}) eq 'HASH' ? $call->{function} : {};
Branch: 1 branch
BranchTrueFalseTotal
ref $call->{'function'} eq 'HASH' ? : 9 0 9
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
BranchTrueFalseTotal
defined $call->{'id'} && length $call->{'id'} ? : 1 8 9
Condition66%2/3
defined $call->{"id"} and length $call->{"id"}
!ll&&!rl&&r
801
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"}
ABresult
0X0
100
111
66 9 ▶ push @calls, {
Branch: 1 branch
BranchTrueFalseTotal
ref $args ? : 8 1 9
Condition50%1/2
$args // "{}"
l!l
10
MC/DC0%0/1
$args // "{}"
$args
Truth table50%1/2
A
A= $args
Aresult
11
00
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"} // ""
l!l
90
MC/DC0%0/1
$function->{"name"} // ""
$function->{"name"}
Truth table50%1/2
A
A= $function->{"name"}
Aresult
11
00
77 }
78 5 push @out, { %$msg, tool_calls => \@calls };
79 5 next;
80 }
81  
82 266 ▶ if ($role eq 'tool') {
Branch: 1 branch
BranchTrueFalseTotal
if ($role eq "tool") 10 256 266
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
BranchTrueFalseTotal
if (defined $tool{'tool_call_id'} and length $tool{'tool_call_id'}) { } 1 9 10
elsif (@unanswered) { } 9 0 9
Condition66%2/3
defined $tool{"tool_call_id"} and length $tool{"tool_call_id"}
!ll&&!rl&&r
901
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"}
ABresult
0X0
100
111
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
!ll&&!rl&&r
337
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
ABresult
0X0
100
111
89 9 ▶ $pick //= 0;
Condition100%2/2
$pick //= 0
l!l
72
MC/DC100%1/1
$pick //= 0
$pick
Truth table100%2/2
A
A= $pick
Aresult
11
00
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
BranchTrueFalseTotal
if ($role ne "assistant" and ref $msg->{"images"} eq "ARRAY" and @{$msg->{"images"};}) 4 252 256
Condition66%4/6
$role ne "assistant" and ref $msg->{"images"} eq "ARRAY" and @{$msg->{"images"};}
!ll&&!rl&&r
25204
$role ne "assistant" and ref $msg->{"images"} eq "ARRAY"
!ll&&!rl&&r
02524
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"};}
ABCresult
0XX0
10X0
1100
1111
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
BranchTrueFalseTotal
defined $text && !ref($text) && length $text ? : 2 2 4
Condition41%5/12
defined $text and not ref $text and length $text
!ll&&!rl&&r
022
defined $text and not ref $text
!ll&&!rl&&r
004
defined $_ && !ref($_) && length $_
!ll&&!rl&&r
008
defined $_ and not ref $_
!ll&&!rl&&r
008
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
ABCresult
0XX0
10X0
1100
1111
Truth table25%1/4
A and not(B) && C
A= defined $_B= not ref $_C= length $_
ABCresult
0XX0
10X0
1100
1111
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
BranchTrueFalseTotal
if $image =~ /\Adata:/ 0 8 8
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
BranchTrueFalseTotal
ref $res->{'choices'} eq 'ARRAY' ? : 78 1 79
Condition50%1/2
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
l!l
790
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] : {})
Aresult
11
00
127 79 ▶ my $msg = $choice->{message} || {};
Condition100%2/2
$choice->{'message'} || {}
l!l
781
MC/DC100%1/1
$choice->{'message'} || {}
$choice->{'message'}
Truth table100%2/2
A
A= $choice->{'message'}
Aresult
11
00
128 79 ▶ my $text = ($msg->{content} // '');
Condition100%2/2
$msg->{"content"} // ""
l!l
781
MC/DC100%1/1
$msg->{"content"} // ""
$msg->{"content"}
Truth table100%2/2
A
A= $msg->{"content"}
Aresult
11
00
129 79 my $tool_calls = [];
130  
131 79 ▶ if (ref($msg->{tool_calls}) eq 'ARRAY') {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $msg->{'tool_calls'} eq 'ARRAY') { } 1 78 79
elsif (length $text) { } 77 1 78
132 1 ▶ my @calls = Langertha::ToolCall->extract('openai', $res || {});
Condition50%1/2
$res || {}
l!l
10
MC/DC0%0/1
$res || {}
$res
Truth table50%1/2
A
A= $res
Aresult
11
00
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
BranchTrueFalseTotal
if (@$calls) 0 77 77
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
BranchTrueFalseTotal
@$tool_calls ? : 1 78 79
Condition100%14/14
$res->{"model"} // ""
l!l
781
$msg->{"role"} // "assistant"
l!l
781
$choice->{"finish_reason"} // "stop"
l!l
781
+($res->{"usage"} || {})->{"prompt_tokens"} // 0
l!l
754
$res->{'usage'} || {}
l!l
772
+($res->{"usage"} || {})->{"completion_tokens"} // 0
l!l
754
$res->{'usage'} || {}
l!l
772
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"}
Aresult
11
00
Truth table100%2/2
A
A= $msg->{"role"}
Aresult
11
00
Truth table100%2/2
A
A= $choice->{"finish_reason"}
Aresult
11
00
Truth table100%2/2
A
A= $res->{'usage'}
Aresult
11
00
Truth table100%2/2
A
A= $res->{'usage'}
Aresult
11
00
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
BranchTrueFalseTotal
if defined $body->{"system"} and not ref $body->{"system"} and length $body->{"system"} 1 94 95
Condition66%4/6
defined $body->{"system"} and not ref $body->{"system"} and length $body->{"system"}
!ll&&!rl&&r
9401
defined $body->{"system"} and not ref $body->{"system"}
!ll&&!rl&&r
9401
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"}
ABCresult
0XX0
10X0
1100
1111
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
BranchTrueFalseTotal
defined $prompt && !ref($prompt) ? : 95 0 95
ref $body->{'images'} eq 'ARRAY' ? : 2 93 95
Condition33%1/3
defined $prompt and not ref $prompt
!ll&&!rl&&r
0095
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
ABresult
0X0
100
111
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
BranchTrueFalseTotal
exists $body->{'model'} ? : 95 0 95
exists $body->{'options'} ? : 1 94 95
exists $body->{'format'} ? : 8 87 95
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
BranchTrueFalseTotal
ref $res->{'choices'} eq 'ARRAY' ? : 34 0 34
Condition50%1/2
(ref $res->{'choices'} eq 'ARRAY' ? $res->{'choices'}[0] : {}) || {}
l!l
340
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] : {})
Aresult
11
00
182 34 ▶ my $msg = $choice->{message} || {};
Condition50%1/2
$choice->{'message'} || {}
l!l
340
MC/DC0%0/1
$choice->{'message'} || {}
$choice->{'message'}
Truth table50%1/2
A
A= $choice->{'message'}
Aresult
11
00
183 34 ▶ my $usage = $res->{usage} || {};
Condition50%1/2
$res->{'usage'} || {}
l!l
340
MC/DC0%0/1
$res->{'usage'} || {}
$res->{'usage'}
Truth table50%1/2
A
A= $res->{'usage'}
Aresult
11
00
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"} // ""
l!l
340
$msg->{"content"} // ""
l!l
340
$choice->{"finish_reason"} // "stop"
l!l
340
$usage->{"prompt_tokens"} // 0
l!l
322
$usage->{"completion_tokens"} // 0
l!l
322
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"}
Aresult
11
00
Truth table50%1/2
A
A= $msg->{"content"}
Aresult
11
00
Truth table50%1/2
A
A= $choice->{"finish_reason"}
Aresult
11
00
Truth table100%2/2
A
A= $usage->{"prompt_tokens"}
Aresult
11
00
Truth table100%2/2
A
A= $usage->{"completion_tokens"}
Aresult
11
00
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'
l!l
194
MC/DC100%1/1
$_->{'engine'} || 'openaibase'
$_->{'engine'}
Truth table100%2/2
A
A= $_->{'engine'}
Aresult
11
00
208 parameter_size => 'unknown',
209 quantization_level => 'unknown',
210 },
211 }
212 13 ▶ } @{$models || []};
Condition50%1/2
$models || []
l!l
130
MC/DC0%0/1
$models || []
$models
Truth table50%1/2
A
A= $models
Aresult
11
00
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 // ""
l!l
1070
MC/DC0%0/1
$message // ""
$message
Truth table50%1/2
A
A= $message
Aresult
11
00
236 }
237  
238  
239 114 1;
240  
241 __END__
« lib/Langertha/Skeid/Protocol/Anthropic/Stream.pm ↑ Summary blib/lib/Langertha/Skeid/CapacityProbe/Registry.pm »