Langertha
view release on metacpan or search on metacpan
lib/Langertha/Engine/Anthropic.pm view on Meta::CPAN
272829303132333435363738394041424344454647
return
$ENV
{LANGERTHA_ANTHROPIC_API_KEY}
|| croak
""
.(
ref
$self
).
" requires LANGERTHA_ANTHROPIC_API_KEY or api_key set"
;
}
has
api_version
=> (
is
=>
'ro'
,
lazy_build
=> 1,
);
sub
_build_api_version {
'2023-06-01'
}
sub
update_request {
my
(
$self
,
$request
) =
@_
;
$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,
);
lib/Langertha/Engine/OpenAI.pm view on Meta::CPAN
9596979899100101102103104105106107108109110111112113114has
api_key
=> (
is
=>
'ro'
,
lazy_build
=> 1,
);
sub
_build_api_key {
my
(
$self
) =
@_
;
return
$ENV
{LANGERTHA_OPENAI_API_KEY}
|| croak
""
.(
ref
$self
).
" requires LANGERTHA_OPENAI_API_KEY or api_key set"
;
}
sub
update_request {
my
(
$self
,
$request
) =
@_
;
$request
->header(
'Authorization'
,
'Bearer '
.
$self
->api_key);
}
sub
default_model {
'gpt-4o-mini'
}
sub
default_embedding_model {
'text-embedding-3-large'
}
sub
default_transcription_model {
'whisper-1'
}
sub
openapi_file {
yaml
=> dist_file(
'Langertha'
,
'openai.yaml'
) };
( run in 0.311 second using v1.01-cache-2.11-cpan-55f5a4728d2 )