File Coverage

blib/lib/AI/Ollama/GenerateCompletionResponse.pm
Criterion Covered Total %
statement 20 24 83.3
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 1 0.0
total 27 33 81.8


line stmt bran cond sub pod time code
1             package AI::Ollama::GenerateCompletionResponse 0.05;
2             # DO NOT EDIT! This is an autogenerated file.
3              
4 1     1   52 use 5.020;
  1         4  
5 1     1   3 use Moo 2;
  1         10  
  1         5  
6 1     1   341 use experimental 'signatures';
  1         2  
  1         5  
7 1     1   117 use stable 'postderef';
  1         3  
  1         5  
8 1     1   62 use Types::Standard qw(Enum Str Bool Num Int HashRef ArrayRef);
  1         1  
  1         6  
9 1     1   1626 use MooX::TypeTiny;
  1         2  
  1         5  
10              
11 1     1   661 use namespace::clean;
  1         2  
  1         6  
12              
13             =encoding utf8
14              
15             =head1 NAME
16              
17             AI::Ollama::GenerateCompletionResponse -
18              
19             =head1 SYNOPSIS
20              
21             my $obj = AI::Ollama::GenerateCompletionResponse->new();
22             ...
23              
24             =cut
25              
26 0     0 0   sub as_hash( $self ) {
  0            
  0            
27 0           return { $self->%* }
28             }
29              
30             =head1 PROPERTIES
31              
32             =head2 C<< context >>
33              
34             An encoding of the conversation used in this response, this can be sent in the next request to keep a conversational memory.
35              
36             =cut
37              
38             has 'context' => (
39             is => 'ro',
40             isa => ArrayRef[Int],
41             );
42              
43             =head2 C<< created_at >>
44              
45             Date on which a model was created.
46              
47             =cut
48              
49             has 'created_at' => (
50             is => 'ro',
51             isa => Str,
52             );
53              
54             =head2 C<< done >>
55              
56             Whether the response has completed.
57              
58             =cut
59              
60             has 'done' => (
61             is => 'ro',
62             );
63              
64             =head2 C<< eval_count >>
65              
66             Number of tokens the response.
67              
68             =cut
69              
70             has 'eval_count' => (
71             is => 'ro',
72             isa => Int,
73             );
74              
75             =head2 C<< eval_duration >>
76              
77             Time in nanoseconds spent generating the response.
78              
79             =cut
80              
81             has 'eval_duration' => (
82             is => 'ro',
83             isa => Int,
84             );
85              
86             =head2 C<< load_duration >>
87              
88             Time spent in nanoseconds loading the model.
89              
90             =cut
91              
92             has 'load_duration' => (
93             is => 'ro',
94             isa => Int,
95             );
96              
97             =head2 C<< model >>
98              
99             The model name.
100              
101             Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version.
102              
103             =cut
104              
105             has 'model' => (
106             is => 'ro',
107             isa => Str,
108             );
109              
110             =head2 C<< prompt_eval_count >>
111              
112             Number of tokens in the prompt.
113              
114             =cut
115              
116             has 'prompt_eval_count' => (
117             is => 'ro',
118             isa => Int,
119             );
120              
121             =head2 C<< prompt_eval_duration >>
122              
123             Time spent in nanoseconds evaluating the prompt.
124              
125             =cut
126              
127             has 'prompt_eval_duration' => (
128             is => 'ro',
129             isa => Int,
130             );
131              
132             =head2 C<< response >>
133              
134             The response for a given prompt with a provided model.
135              
136             =cut
137              
138             has 'response' => (
139             is => 'ro',
140             isa => Str,
141             );
142              
143             =head2 C<< total_duration >>
144              
145             Time spent generating the response.
146              
147             =cut
148              
149             has 'total_duration' => (
150             is => 'ro',
151             isa => Int,
152             );
153              
154              
155             1;