Skip to content

Spring AI fails on second vLLM call with 400 due to malformed tool_calls #3438

@Dudu0831

Description

@Dudu0831

SpringAI verison
<spring-ai.version>1.0.0</spring-ai.version>

I encountered an issue while using Spring AI’s OpenAI chat framework to integrate with vLLM.
When I use Spring AI to call vLLM, vLLM successfully returns the tool call request the first time. However, when I send a second message to vLLM, it throws an error.
Here is the error message:

org.springframework.ai.retry.NonTransientAiException: 400 - {"object":"error","message":"can only concatenate str (not "dict") to str can only concatenate str (not "dict") to str","type":"BadRequestError","param":null,"code":400}

Then I captured the following packet information on the server:

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions