AI-Ollama-Client
view release on metacpan or search on metacpan
lib/AI/Ollama/GenerateCompletionRequest.pm view on Meta::CPAN
package AI::Ollama::GenerateCompletionRequest 0.05;
# DO NOT EDIT! This is an autogenerated file.
use 5.020;
use Moo 2;
use experimental 'signatures';
use stable 'postderef';
use Types::Standard qw(Enum Str Bool Num Int HashRef ArrayRef);
use MooX::TypeTiny;
use namespace::clean;
=encoding utf8
=head1 NAME
AI::Ollama::GenerateCompletionRequest -
=head1 SYNOPSIS
my $obj = AI::Ollama::GenerateCompletionRequest->new();
...
=cut
sub as_hash( $self ) {
return { $self->%* }
}
=head1 PROPERTIES
=head2 C<< context >>
The context parameter returned from a previous request to [generateCompletion], this can be used to keep a short conversational memory.
=cut
has 'context' => (
is => 'ro',
isa => ArrayRef[Int],
);
=head2 C<< format >>
The format to return a response in. Currently the only accepted value is json.
Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON.
Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace.
=cut
has 'format' => (
is => 'ro',
isa => Enum[
"json",
],
);
=head2 C<< images >>
(optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava)
=cut
has 'images' => (
is => 'ro',
isa => ArrayRef[Str],
);
=head2 C<< keep_alive >>
How long (in minutes) to keep the model loaded in memory.
- If set to a positive duration (e.g. 20), the model will stay loaded for the provided duration.
- If set to a negative duration (e.g. -1), the model will stay loaded indefinitely.
- If set to 0, the model will be unloaded immediately once finished.
- If not set, the model will stay loaded for 5 minutes by default
=cut
has 'keep_alive' => (
is => 'ro',
isa => Int,
);
( run in 1.180 second using v1.01-cache-2.11-cpan-39bf76dae61 )