Skip to content

Binding failure for spring.ai.ollama.chat.options.think-option in application.properties #4853

@nicolaskrier

Description

@nicolaskrier

Description

When trying to configure the think-option for Ollama in application.properties, Spring Boot fails to bind the property value to the ThinkOption interface. Here is the relevant configuration:

spring.ai.ollama.chat.options.model=gpt-oss:latest
spring.ai.ollama.chat.options.think-option=low

Error Log

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

Description:
Failed to bind properties under 'spring.ai.ollama.chat.options.think-option' to org.springframework.ai.ollama.api.ThinkOption:
    Property: spring.ai.ollama.chat.options.think-option
    Value: "low"
    Origin: class path resource [application-ollama.properties] - 2:44
    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.ollama.api.ThinkOption]
Action:
Update your application's configuration

Expected Behavior

The property spring.ai.ollama.chat.options.think-option should be successfully bound to the ThinkOption.ThinkBoolean and the ThinkOption.ThinkLevel for valid values:

  • enabled,
  • disabled,
  • low,
  • medium,
  • high.

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