Skip to content
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

Feature Request: Support "reasoning_effort" option in OpenAiChatOptions #2153

Closed
saluzafa opened this issue Jan 31, 2025 · 2 comments
Closed
Assignees
Milestone

Comments

@saluzafa
Copy link

Current Behavior

OpenAI has introduced since a while now the reasoning_effort parameter, which allows users to control the depth of reasoning a model applies when generating responses. This is particularly useful for optimizing inference costs by adjusting how much computational effort is spent on reasoning-intensive tasks.

Currently, the OpenAiApi.ChatCompletionRequest class allows for setting various options, but there does not appear to be a way to specify the reasoning_effort parameter when using the ChatClient or ChatModel interfaces in SpringAI.

Expected Behavior

It would be beneficial for the OpenAiChatOptions class to support the reasoning_effort parameter, enabling users to configure it directly when making requests.

Example usage:

var promptOptions = OpenAiChatOptions.builder()
    .reasoningEffort("low") // Set reasoning effort level - available values are: "low", "medium", "high"
    .build();

chatClient.prompt()
    .messages(userMessage)
    .options(promptOptions)
    .call()
    .content();

OpenAI documentation: https://platform.openai.com/docs/api-reference/chat/create#chat-create-reasoning_effort

Context

Adding this functionality would improve flexibility and allow users to optimize their use of OpenAI o1/o3 models based on their needs 😄

@apappascs
Copy link
Contributor

FYI:
The parameter for reasoning effort is available only for use with the ‘full’ o1 model which is currently being rolled-out to Tier 5 users.
You may have to wait a bit longer before you can access it.

source: https://community.openai.com/t/o1s-reasoning-effort-parameter/1062308

@ilayaperumalg ilayaperumalg added this to the 1.0.0-M6 milestone Feb 7, 2025
@ilayaperumalg
Copy link
Member

This is addressed via 35101e7 Thanks to @apappascs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants