line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenAI::API::Request::File::Retrieve; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
119
|
use strict; |
|
16
|
|
|
|
|
46
|
|
|
16
|
|
|
|
|
504
|
|
4
|
16
|
|
|
16
|
|
89
|
use warnings; |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
519
|
|
5
|
|
|
|
|
|
|
|
6
|
16
|
|
|
16
|
|
141
|
use Types::Standard qw(Str); |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
146
|
|
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
24276
|
use Moo; |
|
16
|
|
|
|
|
52
|
|
|
16
|
|
|
|
|
126
|
|
9
|
16
|
|
|
16
|
|
6092
|
use strictures 2; |
|
16
|
|
|
|
|
194
|
|
|
16
|
|
|
|
|
680
|
|
10
|
16
|
|
|
16
|
|
3201
|
use namespace::clean; |
|
16
|
|
|
|
|
47
|
|
|
16
|
|
|
|
|
135
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'OpenAI::API::Request'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has file_id => ( is => 'ro', isa => Str, required => 1 ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub endpoint { |
17
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
18
|
0
|
|
|
|
|
|
return 'files/' . $self->{file_id}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
0
|
1
|
|
sub method { 'GET' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
OpenAI::API::Request::File::Retrieve - retrieve file details |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use OpenAI::API::Request::File::Retrieve; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# retrieve an existing file id |
36
|
|
|
|
|
|
|
my $file_id = OpenAI::API::Request::File::List->new->send->{data}[0]->{id}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
if ($file_id) { |
39
|
|
|
|
|
|
|
my $request = OpenAI::API::Request::File::Retrieve->new( |
40
|
|
|
|
|
|
|
file_id => $file_id, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $res = $request->send(); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $filename = $res->{filename}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Returns information about a specific file. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 new() |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=over |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item file_id |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=back |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 send() |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Sends the request and returns a data structured similar to the one |
65
|
|
|
|
|
|
|
documented in the API reference. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SEE ALSO |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
OpenAI API Reference: L<Files|https://platform.openai.com/docs/api-reference/files> |