I need some tests for log probs to see how to do it properly
Some checks failed
ci/woodpecker/push/author-tests Pipeline failed

This commit is contained in:
Ryan Voots 2023-11-23 15:03:20 -05:00
parent 950e83017a
commit c1a08eeb27
3 changed files with 37 additions and 2 deletions

View file

@ -81,7 +81,7 @@ class OpenAIAsync::Types::Results::LogProbs :does(OpenAIAsync::Types::Base) :Str
class OpenAIAsync::Types::Results::CompletionChoices :does(OpenAIAsync::Types::Base) :Struct { class OpenAIAsync::Types::Results::CompletionChoices :does(OpenAIAsync::Types::Base) :Struct {
field $text :JSONStr; field $text :JSONStr;
field $index :JSONNum; field $index :JSONNum;
field $logprobs :MarshalTo(OpenAIAsync::Types::Results::LogProbs) = undef; # TODO make nicer type? field $logprobs :MarshalTo([OpenAIAsync::Types::Results::LogProbs]) = undef; # TODO make nicer type?
field $finish_reason :JSONStr = undef; # TODO enum? helper funcs for this class? ->is_finished? field $finish_reason :JSONStr = undef; # TODO enum? helper funcs for this class? ->is_finished?
} }

View file

@ -36,7 +36,7 @@ Index of the choice? I believe this will just always be the same as it's positio
=head2 logprobs =head2 logprobs
Logit probabilities, see L<OpenAIAsync::Types::Results::LogProbs> for details Log probabilities, see L<OpenAIAsync::Types::Results::LogProbs> for details
=head2 finish_reason =head2 finish_reason

View file

@ -0,0 +1,35 @@
=pod
=head1 NAME
OpenAIAsync::Types::Results::LogProbs
=head1 DESCRIPTION
An object representing Log Probabilities from the LLM.
=head1 SYNOPSIS
... TODO? difficult to make an example
=head1 Fields
=head2 text_offset
Which position in the resulting text this log probability represents
=head2 token_logprobs
=head2 tokens
=head2 top_logprobss
=head1 SEE ALSO
L<OpenAIAsync::Types::Request::Completion>, L<OpenAIAsync::Types::Result::Completion>, L<OpenAIAsync::Client>
=head1 AUTHOR
Ryan Voots ...
=cu