package main;
use 5.020;
use Mojo::JSON 'decode_json';
use experimental 'signatures';
use AI::Ollama::Client;
use Future::Utils 'repeat';
#use Getopt::Long;
#GetOptions(
# 'prefix|p=s' => \my $pre
package main;
use 5.020;
use Mojo::JSON 'decode_json';
use experimental 'signatures';
use AI::Ollama::Client;
use Future::Utils 'repeat';
my $ol = AI::Ollama::Client->new(
server => 'http://192.1
stream => JSON::PP::false(),
)->get;
warn "Pulled '$model'";
my @prompts = @ARGV ? @ARGV : (
qq!Please tell me three musical genres of the song "Go West" by "The Pet Shop Boys" as JSON like ```[{
mer.',
'Only list the musical genres.',
#'Answer in JSON only with an array containing objects { "genre": "the genre", "sub-genre": "the sub genre" }.',
cepted 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.
amounts whitespace.
=cut
has 'format' => (
is => 'ro',
isa => Enum[
"json",
],
);
=head2 C<< keep_alive >>
How long (in minutes) to keep the model loaded in memory.
cepted 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.
amounts whitespace.
=cut
has 'format' => (
is => 'ro',
isa => Enum[
"json",
],
);
=head2 C<< images >>
(optional) a list of Base64-encoded images to include in the m
Role
use YAML::PP;
use Mojo::UserAgent;
use Mojo::URL;
use URI::Template;
use Mojo::JSON 'encode_json', 'decode_json';
use OpenAPI::Modern;
use File::ShareDir 'module_file';
use Future::Mojo;
use Fu
fault => sub {
if( my $fn = $_[0]->schema_file ) {
YAML::PP->new( boolean => 'JSON::PP' )->load_file($fn);
}
},
);
has 'validate_requests' => (
is => 'rw',
def
cepted 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.
package main;
use 5.020;
use Mojo::JSON 'decode_json';
use experimental 'signatures';
use AI::Ollama::Client;
use Future::Utils 'repeat';
my $ol = AI::Ollama::Client->new(
server => 'http://192.1