OpenAI#complete does not appear to allow max_tokens to be set
It looks like OpenAI#complete forces max_tokens to be the max available tokens based on the prompt / context.
I have to read more of the code to see how parameter defaults are being set, but it seems like this one might be as simple as changing the assignment to the "or-equals" operator, allowing it to be set only if it wasn't passed in as a param (that would be expected behavior, to my mind).
e.g.
parameters[:max_tokens] ||= validate_max_tokens(parameters[:messages], parameters[:model])
@bricolage Would you be open to submitting a PR?
@andreibondarev yeah for sure, should be able to do in the next few days
@bricolage We probably need to fix this for all other LLMs as well?
@andreibondarev yeah, I'm not super familiar with the other LLM APIs but am happy to tackle in another PR if we don't have any other devs who are pseudo-maintainers of the LLM wrappers.
@andreibondarev just an update, I'll get support in the other LLM validators for their version of :max_tokens over the next few days.
@andreibondarev just an update, I'll get support in the other LLM validators for their version of
:max_tokensover the next few days.
That sounds great, thank you!