Skip to content

Conversation

@madskildegaard
Copy link

@madskildegaard madskildegaard commented Nov 21, 2025

Purpose

Add support for multi-turn requests that has content with type output_text on the Responses API for non-harmony messages.

Test Plan

Currently this request:

{
  "model": "google/gemma-3-27b-it",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Hello there!"
        }
      ]
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Hi, how can I help you?"
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What did I just type?"
        }
      ]
    }
  ]
}

returns:

{
  "error": {
    "message": "Unknown part type: output_text",
    "type": "BadRequestError",
    "param": null,
    "code": 400
  }
}

Test Result

When adding "output_text" to the supported content part types the request succeeds:

{
  ...
  "output": [
    {
      "id": "ad1be50b-0449-4bd2-90bb-ac2b7d597b22",
      "content": [
        {
          "annotations": [],
          "text": "You typed \"Hello there!\".",
          "type": "output_text",
          "logprobs": []
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  ...
}

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to add support for output_text in multi-turn requests. The change correctly identifies one location where output_text should be handled as a text-like content part. However, a critical part of the implementation is missing in MM_PARSER_MAP. Without this, the content of output_text parts will be lost during processing, leading to corrupted model inputs. I've added a critical review comment with details on how to fix this.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Signed-off-by: Mads Kildegård <[email protected]>
Copy link
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Could you help test what the result would be when the OpenAI online service handles this kind of request?

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@madskildegaard
Copy link
Author

madskildegaard commented Nov 21, 2025

@chaunceyjiang

Sure, here's an example when using OpenAI through python:

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
  model="gpt-4.1",
  input=[
    {"role": "user", "content": [{"type": "input_text", "text": "Hello there!"}]},
    {"role": "assistant", "content": [{"type": "output_text", "text": "Hi, how can I help you?"}]},
    {"role": "user", "content": [{"type": "input_text", "text": "What did I just type?"}]}
  ]
)

print(response)

prints:
Response(id='resp_09284d580adde26e006920406f57b88191af2144a3e40c442a', created_at=1763721327.0, error=None, incomplete_details=None, instructions=None, metadata={}, model='gpt-4.1-2025-04-14', object='response', output=[ResponseOutputMessage(id='msg_09284d580adde26e0069204070c37c819180448565875da818', content=[ResponseOutputText(annotations=[], text='You just typed: "Hello there!"', type='output_text', logprobs=[])], role='assistant', status='completed', type='message')], parallel_tool_calls=True, temperature=1.0, tool_choice='auto', tools=[], top_p=1.0, background=False, conversation=None, max_output_tokens=None, max_tool_calls=None, previous_response_id=None, prompt=None, prompt_cache_key=None, reasoning=Reasoning(effort=None, generate_summary=None, summary=None), safety_identifier=None, service_tier='default', status='completed', text=ResponseTextConfig(format=ResponseFormatText(type='text'), verbosity='medium'), top_logprobs=0, truncation='disabled', usage=ResponseUsage(input_tokens=32, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=9, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=41), user=None, billing={'payer': 'developer'}, prompt_cache_retention=None, store=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend gpt-oss Related to GPT-OSS models

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

2 participants