spring-projects / spring-projects/spring-ai

o3-mini returns Unsupported parameter: 'temperature' is not supported with this model.

Open
#2,595 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

I have generated a small example project using spring-ai-starter-model-openai

The test class tries to make a call to OpenAI's o3-mini model:

@SpringBootTest
class SpringAITest
{
    @Autowired
    private OpenAiChatModel chatModel;

    @Test
    void testOpenAiChat()
    {
        Prompt prompt = new Prompt( List.of( new UserMessage( "Tell me about OpenAI" ) ),
                OpenAiChatOptions.builder().model( OpenAiApi.ChatModel.O3_MINI ).build() );

        chatModel.call( prompt ).getResult().getOutput().getText();
    }
} 

The result is:

org.springframework.ai.retry.NonTransientAiException: 400 - {
  "error": {
    "message": "Unsupported parameter: 'temperature' is not supported with this model.",
    "type": "invalid_request_error",
    "param": "temperature",
    "code": "unsupported_parameter"
  }
}

Looking at OpenAiChatModel, OpenAiChatModel.Builder.defaultOptions sets temperature to be 0.7

During the chatModel.call these are copied across.

From the documentation Autowiring OpenAiChatModel into the Spring Component looks to be the recommended approach.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at OpenAiChatModel.Builder.defaultOptions and trace how options are copied during chatModel.call for OpenAiApi.ChatModel.O3_MINI. Reproduce the shown SpringAITest case and inspect existing OpenAI model tests; done means an o3-mini call no longer receives the unsupported parameter and regression coverage captures the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
ai, api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.