spring-projects / spring-projects/spring-ai
Add `isPreventDefaultMerge` flag for models options
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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