-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[bugfix] Fix online serving crash when text type response_format is received #26822
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
Changes from all commits
430682b
6d107bd
83ee528
054a035
0df3481
126a295
94578a7
d96e330
2ae7b6b
54c751e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,11 @@ def __post_init__(self): | |
| "You can only use one kind of structured outputs constraint " | ||
| f"but multiple are specified: {self.__dict__}" | ||
| ) | ||
| if count < 1: | ||
| raise ValueError( | ||
| "You must use one kind of structured outputs constraint " | ||
| f"but none are specified: {self.__dict__}" | ||
| ) | ||
|
Comment on lines
+70
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This new validation is a great improvement for ensuring Specifically, the logic for handling deprecated While the problematic code is not in this diff, this change makes it faulty. To prevent this regression, the logic for handling deprecated parameters should be updated to only construct For example, in # ... inside to_sampling_params, after collecting kwargs from deprecated params
kwargs = {k: v for k, v in kwargs.items() if v is not None}
constraint_keys = {'json', 'regex', 'choice', 'grammar', 'structural_tag'}
if any(k in constraint_keys for k in kwargs):
self.structured_outputs = StructuredOutputsParams(**kwargs)This would ensure backward compatibility for the deprecated parameters while upholding the new, stricter validation.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK Though I'd welcome a better way to validate the structured outputs params. |
||
|
|
||
| def all_constraints_none(self) -> bool: | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.