[responsesAPI] prioritize content over summary in reasoning item input (#36516)
Signed-off-by: Andrew Xia <axia@meta.com> Signed-off-by: Andrew Xia <mitandrewxia@gmail.com> Signed-off-by: Andrew Xia <axia@fb.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Andrew Xia <axia@fb.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Andrew Xia
parent
b41aa264f9
commit
f680dc1b39
@@ -24,6 +24,9 @@ from vllm import envs
|
||||
from vllm.entrypoints.constants import MCP_PREFIX
|
||||
from vllm.entrypoints.openai.chat_completion.protocol import ChatCompletionMessageParam
|
||||
from vllm.entrypoints.openai.responses.protocol import ResponseInputOutputItem
|
||||
from vllm.logger import init_logger
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
def should_continue_final_message(
|
||||
@@ -191,10 +194,16 @@ def _construct_single_message_from_response_item(
|
||||
reasoning_content = ""
|
||||
if item.encrypted_content:
|
||||
raise ValueError("Encrypted content is not supported.")
|
||||
if len(item.summary) == 1:
|
||||
reasoning_content = item.summary[0].text
|
||||
elif item.content and len(item.content) == 1:
|
||||
elif item.content and len(item.content) >= 1:
|
||||
reasoning_content = item.content[0].text
|
||||
elif len(item.summary) >= 1:
|
||||
reasoning_content = item.summary[0].text
|
||||
logger.warning(
|
||||
"Using summary text as reasoning content for item %s. "
|
||||
"Please use content instead of summary for "
|
||||
"reasoning items.",
|
||||
item.id,
|
||||
)
|
||||
return {
|
||||
"role": "assistant",
|
||||
"reasoning": reasoning_content,
|
||||
|
||||
Reference in New Issue
Block a user