Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model parameters to restrict max tokens #22

Merged
merged 12 commits into from
Sep 12, 2024
Merged

Conversation

xdotli
Copy link
Contributor

@xdotli xdotli commented Sep 5, 2024

No description provided.

@xdotli xdotli self-assigned this Sep 10, 2024
const invalidKeys = Object.keys(params).filter(
(key) => !validKeys.includes(key)
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check if the value is correct type of number. Right now, it seems I can pass in i.e. topP: [], which causes OpenAI to throw an error. What are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to validate the type of the value as well, then either manually validate (switch case) or Zod. Without Zod basically have to do type gymnastics manually.

@annapo23 annapo23 merged commit 881fa85 into main Sep 12, 2024
namtho7078 pushed a commit to namtho7078/zerox that referenced this pull request Oct 27, 2024
Add model parameters to restrict max tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants