File Coverage

blib/lib/AI/Ollama/Message.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::Message 0.05;
2             # DO NOT EDIT! This is an autogenerated file.
3              
4 1     1   14 use 5.020;
  1         3  
5 1     1   3 use Moo 2;
  1         10  
  1         4  
6 1     1   255 use experimental 'signatures';
  1         1  
  1         20  
7 1     1   97 use stable 'postderef';
  1         1  
  1         5  
8 1     1   71 use Types::Standard qw(Enum Str Bool Num Int HashRef ArrayRef);
  1         1  
  1         7  
9 1     1   1629 use MooX::TypeTiny;
  1         3  
  1         4  
10              
11 1     1   661 use namespace::clean;
  1         1  
  1         6  
12              
13             =encoding utf8
14              
15             =head1 NAME
16              
17             AI::Ollama::Message -
18              
19             =head1 SYNOPSIS
20              
21             my $obj = AI::Ollama::Message->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<< content >>
33              
34             The content of the message
35              
36             =cut
37              
38             has 'content' => (
39             is => 'ro',
40             isa => Str,
41             required => 1,
42             );
43              
44             =head2 C<< images >>
45              
46             (optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava)
47              
48             =cut
49              
50             has 'images' => (
51             is => 'ro',
52             isa => ArrayRef[Str],
53             );
54              
55             =head2 C<< role >>
56              
57             The role of the message
58              
59             =cut
60              
61             has 'role' => (
62             is => 'ro',
63             isa => Enum[
64             "system",
65             "user",
66             "assistant",
67             ],
68             required => 1,
69             );
70              
71              
72             1;