blib/lib/Langertha/Content.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 85.7% 24 / 28 CC 2 SCAR 3.1
CC
2
Cov
88%
_no_serializer
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Langertha/Engine/XAI.pm ↑ Summary blib/lib/Langertha/Engine/LMStudioAnthropic.pm »
1 package Langertha::Content;
2 # ABSTRACT: Base role for canonical multimodal content blocks with cross-provider serialization
3 17 our $VERSION = '0.505';
4 17 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 17 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 17 requires qw( to_openai to_anthropic to_gemini );
9  
10 # Serializers added after the role was public (karr k267) get croaking
11 # defaults instead of joining `requires`, so an outside content class still
12 # composes; it only fails when it is actually sent on such a wire.
13 3 ▶sub _no_serializer {
Subroutine _no_serializer: called CC=2 SCAR=8.1
14 3 my ( $self, $fmt ) = @_;
15 3 ▶ croak( ( ref $self || $self )." cannot be sent on the $fmt wire; implement to_$fmt" );
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
300
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
16 }
17  
18 1 ▶sub to_responses { $_[0]->_no_serializer('responses') }
Subroutine to_responses: called CC=1 SCAR=0.0
Pod documented
19 1 ▶sub to_ollama { $_[0]->_no_serializer('ollama') }
Subroutine to_ollama: called CC=1 SCAR=0.0
Pod documented
20 1 ▶sub to_lmstudio { $_[0]->_no_serializer('lmstudio') }
Subroutine to_lmstudio: called CC=1 SCAR=0.0
Pod documented
21  
22  
23  
24 17 1;
25  
26 __END__
« blib/lib/Langertha/Engine/XAI.pm ↑ Summary blib/lib/Langertha/Engine/LMStudioAnthropic.pm »