blib/lib/Langertha/Engine/Replicate.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 94.1% 32 / 34 CC 2 SCAR 2.4
CC
2
Cov
96%
_build_api_key
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Langertha/Engine/LMStudioAnthropic.pm ↑ Summary blib/lib/Langertha/Role/Seed.pm »
1 package Langertha::Engine::Replicate;
2 # ABSTRACT: Replicate API
3 9 our $VERSION = '0.505';
4 9 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 extends 'Langertha::Engine::OpenAIBase';
8  
9 9 with 'Langertha::Role::Tools';
10  
11  
12 has '+url' => (
13 lazy => 1,
14 2 ▶ default => sub { 'https://api.replicate.com/v1' },
Subroutine __ANON__: called CC=1 SCAR=0.0
15 9 );
16  
17 1 ▶sub _build_api_key {
Subroutine _build_api_key: called CC=2 SCAR=7.2
18 1 my ( $self ) = @_;
19 return $ENV{LANGERTHA_REPLICATE_API_KEY}
20 1 ▶ || croak "".(ref $self)." requires LANGERTHA_REPLICATE_API_KEY or api_key set";
Condition50%1/2
$ENV{'LANGERTHA_REPLICATE_API_KEY'} || croak('' . ref($self) . ' requires LANGERTHA_REPLICATE_API_KEY or api_key set')
l!l
10
MC/DC0%0/1
$ENV{'LANGERTHA_REPLICATE_API_KEY'} || croak('' . ref($self) . ' requires LANGERTHA_REPLICATE_API_KEY or api_key set')
$ENV{'LANGERTHA_REPLICATE_API_KEY'}
Truth table50%1/2
A
A= $ENV{'LANGERTHA_REPLICATE_API_KEY'}
Aresult
11
00
21 }
22  
23 1 ▶sub default_model { croak "".(ref $_[0])." requires model to be set" }
Subroutine default_model: called CC=1 SCAR=0.0
Pod documented
24  
25 13 ▶sub _build_supported_operations {[qw(
Subroutine _build_supported_operations: called CC=1 SCAR=0.0
26 createChatCompletion
27 )]}
28  
29 # Replicate's OpenAPI (api.replicate.com/openapi.json) has no chat/completions
30 # path, so nothing documents parallel_tool_calls: clear parallel_tool_use
31 # (karr k242, docs only; the endpoint question itself is karr k243).
32 79 ▶around engine_capabilities => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
33 79 my ( $orig, $self, @rest ) = @_;
34 79 my $caps = $self->$orig(@rest);
35 79 delete $caps->{parallel_tool_use};
36 # image_input (k266, ADR 0019): a gateway: the model behind it is unknown to the client, so no claim.
37 79 delete $caps->{image_input};
38 79 return $caps;
39 9 };
40  
41 9 __PACKAGE__->meta->make_immutable;
42  
43  
44 9 1;
45  
46 __END__
« blib/lib/Langertha/Engine/LMStudioAnthropic.pm ↑ Summary blib/lib/Langertha/Role/Seed.pm »