File Coverage

blib/lib/OpenAI/API/Request/Model/List.pm
Criterion Covered Total %
statement 18 20 90.0
branch n/a
condition n/a
subroutine 6 8 75.0
pod 2 2 100.0
total 26 30 86.6


line stmt bran cond sub pod time code
1             package OpenAI::API::Request::Model::List;
2              
3 16     16   117 use strict;
  16         44  
  16         510  
4 16     16   101 use warnings;
  16         55  
  16         386  
5              
6 16     16   87 use Moo;
  16         39  
  16         101  
7 16     16   6049 use strictures 2;
  16         120  
  16         638  
8 16     16   2966 use namespace::clean;
  16         54  
  16         109  
9              
10             extends 'OpenAI::API::Request';
11              
12 16     16   4668 use Types::Standard qw();
  16         62  
  16         1092  
13              
14 0     0 1   sub endpoint { 'models' }
15 0     0 1   sub method { 'GET' }
16              
17             1;
18              
19             __END__
20              
21             =head1 NAME
22              
23             OpenAI::API::Request::Model::List - models endpoint
24              
25             =head1 SYNOPSIS
26              
27             use OpenAI::API::Request::Model::List;
28              
29             my $request = OpenAI::API::Request::Model::List->new();
30              
31             my $res = $request->send();
32              
33             my @models = @{ $res->{data} };
34              
35             =head1 DESCRIPTION
36              
37             Lists the currently available models, and provides basic information
38             about each one such as the owner and availability.
39              
40             =head1 METHODS
41              
42             =head2 new()
43              
44             =head2 send()
45              
46             Sends the request and returns a data structured similar to the one
47             documented in the API reference.
48              
49             =head1 SEE ALSO
50              
51             OpenAI API Reference: L<Models|https://platform.openai.com/docs/api-reference/models>