Skip to content

Azure responseFormat no converter found #3354

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

Open
JakobStadlhuber opened this issue May 27, 2025 · 1 comment
Open

Azure responseFormat no converter found #3354

JakobStadlhuber opened this issue May 27, 2025 · 1 comment
Assignees
Labels
azure bug Something isn't working

Comments

@JakobStadlhuber
Copy link

JakobStadlhuber commented May 27, 2025

Bug description
When migrating Spring AI from version 1.0.0-M8 to 1.0.0, configuring the spring.ai.azure.openai.chat.options.response-format property with values such as text, json_object, or json_schema (which were changed from the previous json value) results in an application startup failure. The application fails to bind the string property value to the org.springframework.ai.azure.openai.AzureOpenAiResponseFormat type, throwing a ConverterNotFoundException.

Environment

  • Spring AI version: 1.0.0 (migrating from 1.0.0-M8)
  • Java version: 21
  • Model Provider: Azure OpenAI

Steps to reproduce

  1. Have a Spring Boot application using spring-ai-azure-openai-starter.
  2. Previously, in version 1.0.0-M8 or earlier, have the property spring.ai.azure.openai.chat.options.responseFormat=json (or its equivalent) configured.
  3. Upgrade the Spring AI version to 1.0.0.
  4. Modify the configuration property to spring.ai.azure.openai.chat.options.response-format and set its value to one of the new supported formats, for example: spring.ai.azure.openai.chat.options.response-format=json_object.
  5. Attempt to start the Spring Boot application.
  6. Observe the APPLICATION FAILED TO START error with the ConverterNotFoundException.

Expected behavior
The application should start successfully with the spring.ai.azure.openai.chat.options.response-format property correctly bound to the AzureOpenAiResponseFormat type, allowing the Azure OpenAI chat client to use the specified response format (e.g., text, json_object, or json_schema).

Minimal Complete Reproducible example
A minimal complete reproducible example or failing test was not provided in the initial report. However, a simple Spring Boot application with the spring-ai-azure-openai-starter dependency and the following configuration in application.properties should trigger the issue:

application.properties:

spring.ai.azure.openai.api-key=<YOUR_AZURE_OPENAI_KEY>
spring.ai.azure.openai.endpoint=<YOUR_AZURE_OPENAI_ENDPOINT>
spring.ai.azure.openai.chat.options.deployment-name=<YOUR_DEPLOYMENT_NAME> # or model
spring.ai.azure.openai.chat.options.response-format=json_object # or text, or json_schema

A simple component attempting to use the ChatClient would be sufficient to trigger the context loading and property binding.

Error Log Snippet Provided:

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'spring.ai.azure.openai.chat.options.response-format' to org.springframework.ai.azure.openai.AzureOpenAiResponseFormat:

    Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [@com.fasterxml.jackson.annotation.JsonProperty org.springframework.ai.azure.openai.AzureOpenAiResponseFormat]

Action:
Review the value of the property. If the problem persists, check the DDL definition of the an @ConfigurationProperties bean if you have one.
@markpollack markpollack added azure bug Something isn't working labels May 30, 2025
@HyunSangHan
Copy link
Contributor

May I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants