App-PythonToPerl
view release on metacpan or search on metacpan
CONTRIBUTING view on Meta::CPAN
<<<=== COPYRIGHT CONTRIBUTIONS ===>>>
[ BEGIN, APTECH FAMILY COPYRIGHT ASSIGNMENT AGREEMENT ]
By contributing to this repository, you agree that any and all such Contributions and derivative works thereof shall immediately become part of the APTech Family of software and documentation, and you accept and agree to the following legally-binding...
1. Definitions.
"You" or "Your" shall mean the copyright owner, or legal entity authorized by the copyright owner, that is making this Agreement. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are und...
"APTech" is defined as the Delaware corporation named Auto-Parallel Technologies, Inc. with a primary place of business in Cedar Park, Texas, USA.
The "APTech Family of software and documentation" (hereinafter the "APTech Family") is defined as all copyrightable works identified as "part of the APTech Family" immediately following their copyright notice, and includes but is not limited to this ...
"Team APTech" is defined as all duly-authorized contributors to the APTech Family, including You after making Your first Contribution to the APTech Family under the terms of this Agreement.
"Team APTech Leadership" is defined as all duly-authorized administrators and official representatives of the APTech Family, as listed publicly on the most up-to-date copy of the AutoParallel.com website.
"Contribution" shall mean any original work of authorship, including any changes or additions or enhancements to an existing work, that is intentionally submitted by You to this repository for inclusion in, or documentation of, any of the products or...
lib/Python/Unknown.pm view on Meta::CPAN
# backoff algorithm; increase sleep time and retry
# https://help.openai.com/en/articles/5955604-how-can-i-solve-429-too-many-requests-errors
# https://platform.openai.com/docs/guides/rate-limits/error-mitigation
while ((defined $EVAL_ERROR) and ($EVAL_ERROR =~ '429 Too Many Requests')) {
print 'in Python::Unknown::python_preparsed_to_perl_source(), about to retry #', $retries, ' call python_preparsed_to_perl_source_api_call()...', "\n";
$retries++;
if ($retries >= $self->{retries_max}) {
croak 'ERROR EPYUN013b: received HTTP response status code 429 (too many requests) instead of OpenAI::API response, maximum retry limit ', $self->{retries_max}, ' reached, croaking';
}
# increase time to sleep by some percentage of current amount
$self->{sleep_seconds} *= $self->{sleep_retry_multiplier};
print 'in Python::Unknown::python_preparsed_to_perl_source(), about to retry #', $retries, ' call sleep(', $self->{sleep_seconds}, ')...', "\n";
# retry sleep before calling API
sleep($self->{sleep_seconds});
print 'in Python::Unknown::python_preparsed_to_perl_source(), ret from retry #', $retries, ' call to sleep(', $self->{sleep_seconds}, ')', "\n";
# retry call to OpenAI API
$response = $self->python_preparsed_to_perl_source_api_call($openai, $messages);
( run in 0.383 second using v1.01-cache-2.11-cpan-709fd43a63f )