-
Notifications
You must be signed in to change notification settings - Fork 24
Add topP
support
#37
Add topP
support
#37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a general question - no hard feelings.
private readonly float $temperature = 1.0, | ||
private readonly float $topP = 1.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think in general of having those parameters here? Struggle a bit with my initial decision - should maybe only the part of the $options
of call(..)
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for default settings for fine tuning this position is fitting. But maybe all settings available should be put to a config object?
When i have a look to the OpenAI Playground ... there are more settings beside temperature and topP for every request. So this would stack up to this amount.
Maybe this could also be utilized as argument by the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintaining a config object would be hard - the api contract is growing and depends on versions and platform. we could tackle that of course with having designated extension points, but having an array is way more flexible for now 🙊 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can go with $options
array then, but we couldn't validate them, just pass them to the model -> fire and forget... 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model/Platform will validate anyways and we're just reproducing their rules here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need way better error handling tho for http calls. Was quite lazy with that ... 👼
) { | ||
$this->version ??= Version::gpt4o(); | ||
|
||
Assert::greaterThanEq($temperature, 0.01); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the api also allows 0
Assert::greaterThanEq($temperature, 0.01); | |
Assert::greaterThanEq($temperature, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my research it needs to be at least 0.01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Research meaning usage? Pretty sure i used 0 before but can check tomorrow or later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superseded by |
see https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p