ne::Anthropic::VERSION = '0.008';
use Moose;
use Carp qw( croak );
use JSON::MaybeXS;
with 'Langertha::Role::'.$_ for (qw(
JSON
HTTP
Models
Chat
Temperature
ResponseSize
SystemPrompt
))
$request->header('x-api-key', $self->api_key);
$request->header('content-type', 'application/json');
$request->header('anthropic-version', $self->api_version);
}
has '+url' => (
lazy => 1,
mperature => 0.5,
);
print($claude->simple_chat('Generate Perl Moose classes to represent GeoJSON data types'));
=head1 DESCRIPTION
B<THIS API IS WORK IN PROGRESS>
=head1 HOW TO GET ANTHROPIC
ings;
use Data::Dumper;
use JSON::MaybeXS;
use POSIX qw( ceil );
use Time::HiRes qw( time );
use URI;
use Langertha::Engine::Ollama;
use Text::ASCIITable;
my $json = JSON::MaybeXS->new( utf8 => 1 )
',
});
my $response = $ollama->user_agent->request($request);
my $data = $json->decode($response->content);
my $reply = $request->response_call->($response);
my
});
my $response = $ollama->user_agent->request($request);
my $data = $ollama->json->decode($response->content);
my $reply = $request->response_call->($response);
my
filenames = Makefile.PL
filenames = META.json
filenames = README.mkdn
B<on your command line>
dzil regenerate
# Makefile.PL updated
# META.json updated
# ...
=head1 DESCRIPTION
This p
y of Strings describing files to copy.
[Regenerate]
filename = Makefile.PL
filename = META.json
B<aliases:> C<filename>
=head1 SEE ALSO
=over 4
=item * L<< C<[CopyFilesFromBuild]>|Dist::Zi
::Fetcher;
use Scalar::Util qw(blessed);
use List::Util qw(max);
use JSON::MaybeUTF8 qw(encode_json_utf8 decode_json_utf8);
use YAML::XS qw(DumpFile);
use Syntax::Keyword::Try;
our $VE
ce", qw/content verified error/)->@*;
$self->{_data}->{$source}->{content} = decode_json_utf8($content // '[]');
$self->{_data}->{$source}->{verified} = $verified // 0;
updated => $self->{_data}->{$source}->{updated} // 0,
content => encode_json_utf8($self->{_data}->{$source}->{content} // []),
verified => $self->{_data}->{$sourc
DEFAULT :flock); # core
use Dist::Surveyor::DB_File; # internal
use HTTP::Tiny;
use JSON::MaybeXS qw(JSON decode_json);
use Scalar::Util qw(looks_like_number); # core
use Data::Dumper;
use version;
o
GET => "https://fastapi.metacpan.org/v1/release/$author/$release");
my $release_data = decode_json $response;
if (!$release_data or !$release_data->{release}) {
warn "Can't find releas
> 'https://fastapi.metacpan.org/v1/file',
{ 'Content-Type' => 'application/json;charset=UTF-8' },
JSON->new->utf8->canonical->encode($query),
);
return _process_response($funcs
t', 'int2vector', 'int4range', 'int8range', 'integer', 'interval', #I
'json', #J
which must be called changelog and the specific file end
...
changelog.yml
changelog.json
...
The sub changelog files are in the same directory as the main changelog file.
The differ
un the standalone HTTP server.
=item * L<JSON::XS>, L<Cpanel::JSON::XS> or L<JSON::PP>: If you need to handle
requests with a JSON body or wish to output JSON yourself.
=item * L<PerlIO::gzip>: For
UWF::any ['get'], '/literal.json', sub {
# This code will be called on "GET /literal.json"
# But NOT on "GET /literalXjson"
};
TUWF::any ['get'], qr{/regex.json}, sub {
# This code wi
ll be called on "GET /regex.json"
# And also on "GET /regexXjson"
};
TUWF::any ['get','head'], qr{/user/(?<uid>\d+)}, sub {
# This code will be called on a "GET /user/123".
# The user
e File::ShareDir::ProjectDistDir qw( :all );
use Carp qw( croak );
use JSON::MaybeXS;
with 'Langertha::Role::'.$_ for (qw(
JSON
HTTP
OpenAPI
Models
Temperature
ResponseSize
ResponseForm
at ) : (),
$self->has_temperature ? ( temperature => $self->temperature ) : (),
stream => JSON->false,
# $self->has_seed ? ( seed => $self->seed )
# : $self->randomize_seed ? ( seed
} );
our @EXPORT = qw();
use Carp;
use Crypt::Misc qw(decode_b64u encode_b64u);
use JSON qw(decode_json encode_json);
use Crypt::PK::RSA;
use Crypt::PK::ECC;
use Crypt::PK::Ed25519;
use Crypt::PK::X2
|| !defined $alg;
$kid_keys = eval { decode_json($kid_keys) } if $kid_keys && !ref $kid_keys;
croak "JWT: kid_keys must be a HASHREF or a valid JSON/HASH" if ref $kid_keys ne 'HASH';
my $found;
b64url = shift;
return undef unless $b64url;
my $json = decode_b64u($b64url);
return undef unless $json;
my $hash = eval { decode_json($json) };
return undef unless ref $hash eq 'HASH';
re
url => "https://writtenquestions-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/writtenquestions-api.json";
has base_url => 'https://writtenquestions-api.parliament.uk/';
1
s public_url => "https://lordsvotes-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/lordsvotes-api.json";
has base_url => 'https://lordsvotes-api.parliament.uk/';
1;
__END_
://commonsvotes-api.parliament.uk/swagger/docs/v1";
has private_url => "swagger/commonsvotes-api.json";
has base_url => 'https://commonsvotes-api.parliament.uk';
1;
__END__
=head1 NAME
WebServic
mber of a Division whose records are to be returned
integer
format: int32
=item format
xml or json
string
=back
=cut
=head3 getdatadivisions.groupedbyparty
Return Divisions results grouped by
th
/data/divisions.{format}/groupedbyparty
=cut
=head4 Parameters
=over
=item format
xml or json
string
=item queryParameters.searchTerm
Divisions containing search term within title or numbe
s public_url => "https://erskinemay-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/erskinemay-api.json";
has base_url => 'https://erskinemay-api.parliament.uk/';
1;
__END_
package WebService::UK::Parliament::Base;
use Mojo::Base -base;
use Mojo::JSON qw/decode_json/;
use Mojo::UserAgent;
use OpenAPI::Client;
has "client";
has "private";
sub new {
my $class = shi
self->generate_operation_ids(decode_json($content));
}
sub read_url {
my ($self, $url) = @_;
my $ua = Mojo::UserAgent->new;
my $res = $ua->get($url)->res->json;
return $self->generate_operation_
$self->client->call($path, $params ? $params : (), $content ? $content : ());
return $data->res->json;
}
sub AUTOLOAD {
my ($self) = shift;
my $classname = ref $self;
my $validname = '[a-
ion
In this example we have a hypothetical Mojolicious application that uses jQuery
to POST some JSON to the server. To provide CSRF protection we make use of the
C<X-CSRF-Token> header.
It's possi
headers on each request:
<script>
$.ajaxSetup({ headers:
% use Mojo::JSON qw( to_json );
%= to_json({ 'X-CSRF-Token' => $c->crsf_token })
});
</script>
Once you've done thi
';
has public_url => "https://bills-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/members-api.json";
has base_url => 'https://bills-api.parliament.uk/';
1;
__END__
=hea
Base';
has public_url => "https://now-api.parliament.uk/swagger/v1/swagger.json";
has private_url => "swagger/now-api.json";
has base_url => 'https://now-api.parliament.uk/';
1;
__END__
=head1 N
lgorithm name e.g. 'ECDH-ES+A256KW' (see rfc7518)
# $epk .. ephemeral ECC public key (JWK/JSON or Crypt::PK::ECC|X25519)
# optional params:
# $apu .. Agreement PartyUInfo Header Par
# $apv .. Agreement PartyVInfo Header Parameter
Value C<$cek> - binary octets, C<$epk> JWK/JSON string with ephemeral ECC public key.
=head2 ecdh_key_unwrap
ECDH (Ephememeral Static) key agre
ption algorithm name e.g. 'A256GCM' (see rfc7518)
# $epk .. ephemeral ECC public key (JWK/JSON or Crypt::PK::ECC|X25519)
# optional params:
# $apu .. Agreement PartyUInfo Header Par