-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[gpt-oss] Add IncompleteDetails to ResponsesRepsonse #24561
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
c2c88af
a96c40b
bb5933d
f2617c8
1718d05
15df099
eab9c10
40839d7
b7fa6e5
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 |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
from openai.types.responses import (ResponseFormatTextConfig as | ||
ResponseTextConfig) | ||
|
||
from openai.types.responses.response import ToolChoice | ||
from openai.types.responses.response import IncompleteDetails, ToolChoice | ||
from openai.types.responses.tool import Tool | ||
from openai.types.shared import Metadata, Reasoning | ||
from pydantic import (BaseModel, ConfigDict, Field, TypeAdapter, | ||
|
@@ -1868,7 +1868,7 @@ class ResponsesResponse(OpenAIBaseModel): | |
id: str = Field(default_factory=lambda: f"resp_{random_uuid()}") | ||
created_at: int = Field(default_factory=lambda: int(time.time())) | ||
# error: Optional[ResponseError] = None | ||
# incomplete_details: Optional[IncompleteDetails] = None | ||
incomplete_details: Optional[IncompleteDetails] = None | ||
instructions: Optional[str] = None | ||
metadata: Optional[Metadata] = None | ||
model: str | ||
|
@@ -1904,9 +1904,18 @@ def from_request( | |
status: ResponseStatus, | ||
usage: Optional[ResponseUsage] = None, | ||
) -> "ResponsesResponse": | ||
|
||
incomplete_details: Optional[IncompleteDetails] = None | ||
if status == 'incomplete': | ||
incomplete_details = IncompleteDetails(reason='max_output_tokens') | ||
# TODO: implement the other reason for incomplete_details, | ||
# which is content_filter | ||
# incomplete_details = IncompleteDetails(reason='content_filter') | ||
Comment on lines
+1911
to
+1913
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. what's missing from current logic btw. 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. I don't think VLLM baseline implementation supports content filter as an abort reason currently: https://github.com/vllm-project/vllm/blob/main/vllm/v1/request.py#L206 |
||
|
||
return cls( | ||
id=request.request_id, | ||
created_at=created_time, | ||
incomplete_details=incomplete_details, | ||
instructions=request.instructions, | ||
metadata=request.metadata, | ||
model=model_name, | ||
|
@@ -2109,7 +2118,7 @@ class DetokenizeResponse(OpenAIBaseModel): | |
|
||
class TokenizerInfoResponse(OpenAIBaseModel): | ||
""" | ||
Response containing tokenizer configuration | ||
Response containing tokenizer configuration | ||
equivalent to tokenizer_config.json | ||
""" | ||
|
||
|
@@ -2199,7 +2208,7 @@ class TranscriptionRequest(OpenAIBaseModel): | |
to_language: Optional[str] = None | ||
"""The language of the output audio we transcribe to. | ||
|
||
Please note that this is not currently used by supported models at this | ||
Please note that this is not currently used by supported models at this | ||
time, but it is a placeholder for future use, matching translation api. | ||
""" | ||
|
||
|
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.
if the parser still has messages (ie if the generator got cut abruptly, this should be incomplete and not completed.
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.
make sense please move your comment to the code :)