Skip to content

[Bug]: OpenAIChatModel structuted output fails on DeepSeek/vLLM — supportsNativeStructuredOutput() returns true for unsupported backends #1742

Closed

Description

@Sparkle6979

Summary

OpenAIChatModel.supportsNativeStructuredOutput() hardcodes true, but many OpenAI-compatible backends (DeepSeek, vLLM, Ollama, SiliconFlow) do not support response_format. This causes agent.call(msg, OutputClass.class) to fail with HTTP 400 on those backends.

Root Cause

OpenAIChatModel.java:195:

@Override
public boolean supportsNativeStructuredOutput() {
    return true;  // ← assumes ALL OpenAI-compatible APIs support response_format
}

ReActAgent.doStructuredCall() trusts this unconditionally:

if (model.supportsNativeStructuredOutput()) {
    return doNativeStructuredCall(msgs, jsonSchema);  // sends response_format → 400
}

Reproduction

ReActAgent agent = ReActAgent.builder()
    .model(OpenAIChatModel.builder()
        .baseUrl("https://api.deepseek.com")
        .modelName("deepseek-chat")
        .formatter(new DeepSeekFormatter())
        .build())
    .build();

agent.call(userMsg, OutputClass.class).block();
// DeepSeek: "This response_format type is unavailable now" (400)

Affected Backends

All OpenAI-compatible APIs using OpenAIChatModel that don't support response_format: DeepSeek, vLLM, Ollama, SiliconFlow, TogetherAI (partial).

Fix

Add automatic fallback in doStructuredCall(): when native path fails, retry with the fallback (generate_response tool) path.

Activity

  1. added a commit that references this issue on Jun 13, 2026
    f9e8805
  2. added
    bug
    area/core/model
    on Jun 14, 2026
  3. moved this from Backlog to In progress in AgentScope Javaon Jun 14, 2026
  4. added a commit that references this issue on Jun 14, 2026
    47b69c3
  5. moved this from In progress to Done in AgentScope Javaon Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core/modelbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions