Developer-Dashboard
view release on metacpan or search on metacpan
lib/Developer/Dashboard/CLI/Ask.pm view on Meta::CPAN
# _call_claude_api(%args)
# Posts one non-streaming Messages request to the Anthropic API.
# Input: ua, key, base_url, model, max_tokens, messages.
# Output: answer text string; dies on transport or API error.
sub _call_claude_api {
my (%a) = @_;
require HTTP::Request;
my $url = $a{base_url} . '/v1/messages';
my $req = HTTP::Request->new( POST => $url );
$req->header( 'content-type' => 'application/json' );
$req->header( 'x-api-key' => $a{key} );
$req->header( 'anthropic-version' => '2023-06-01' );
$req->content(
json_encode(
{
model => $a{model},
max_tokens => $a{max_tokens},
messages => $a{messages},
}
)
share/public/js/jquery-4.0.0.min.js view on Meta::CPAN
/*! jQuery v4.0.0 | (c) OpenJS Foundation and other contributors | jquery.com/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,!0):t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";if(!e.document)throw Error("jQuery requires a window with a document")...
t/20-skill-web-routes.t view on Meta::CPAN
:--------------------------------------------------------------------------------:
HTML:
Skill Route Index Edited
BOOKMARK
my $index_play = $app->handle(
path => '/app/route-skill/edit',
method => 'POST',
body => 'mode=render&instruction=' . _uri_escape($skill_play_instruction),
headers => {
host => '127.0.0.1',
'content-type' => 'application/x-www-form-urlencoded',
},
remote_addr => '127.0.0.1',
);
is( $index_play->[0], 200, 'installed skill index play POST returns success' );
like( $index_play->[2], qr/Skill Route Index Edited/, 'installed skill index play POST renders the edited transient skill page' );
like( $index_play->[2], qr{href="/app/route-skill/edit" id="view-source-url"}, 'installed skill index play POST keeps the smart-routed view source link' );
my $render = $app->handle(
path => '/app/route-skill/foo',
method => 'GET',
t/lib/Local/PSGITest.pm view on Meta::CPAN
'psgi.nonblocking' => 0,
);
my $content_type = $headers->header('Content-Type');
my $content_length = length $content;
$env{CONTENT_TYPE} = $content_type if defined $content_type;
$env{CONTENT_LENGTH} = $content_length if $content_length;
for my $field ( $headers->header_field_names ) {
next if !defined $field;
next if lc($field) eq 'content-type';
next if lc($field) eq 'content-length';
my $value = $headers->header($field);
next if !defined $value;
my $name = uc $field;
$name =~ s/-/_/g;
$env{"HTTP_$name"} = $value;
}
return \%env;
}
( run in 2.192 seconds using v1.01-cache-2.11-cpan-800906f7e73 )