spring-projects / spring-projects/spring-ai

Add `isPreventDefaultMerge` flag for models options

Open
#3,254 3 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 10h
Merged PRs (30d)
5

Description

I think this issue has more to do with #3253.

As far as I understand, in each model, if we set a parameter as null in its Options, it will be pulled from global parameters. Like here:

Prompt buildRequestPrompt(Prompt prompt) {
...
    // Define request options by merging runtime options and default options
    OpenAiChatOptions requestOptions = ModelOptionsUtils.merge(runtimeOptions, this.defaultOptions,
		    OpenAiChatOptions.class);
...

However, if we don't want to pull from global parameters? Like in the issue I specified, the user doesn't want to change the global parameters, but needs to specify null for temperature?

Help me if I understand something wrong, however, as I understand it would be good for us if we add something like a flag to the options, let's say isPreventDefaultMerge and then our options would not merge.

If I understand this correctly and if this makes sense to you, I would be happy to work on it, thanks for your time

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 with the model option merge shown in the issue, especially ModelOptionsUtils.merge and the OpenAiChatOptions request construction. Review related issue #3253 and the existing runtime/default option behavior before deciding the flag semantics. Done should mean the requested null-handling behavior is defined and implemented consistently for model options, with tests covering merge prevention.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.