-
Notifications
You must be signed in to change notification settings - Fork 1.5k
OpenAI: support any path configuration #3452
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
@markpollack @tzolov @ilayaperumalg Hi, please review the PR, thank you. |
...ls/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiModerationApi.java
Outdated
Show resolved
Hide resolved
Signed-off-by: lambochen <[email protected]>
...ing-ai-openai/src/main/java/org/springframework/ai/openai/api/common/OpenAiApiConstants.java
Outdated
Show resolved
Hide resolved
...ls/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiModerationApi.java
Outdated
Show resolved
Hide resolved
models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiAudioApi.java
Outdated
Show resolved
Hide resolved
models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiAudioApi.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/ai/model/openai/autoconfigure/OpenAiAudioSpeechAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/ai/model/openai/autoconfigure/OpenAiModerationAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...springframework/ai/model/openai/autoconfigure/OpenAiAudioTranscriptionAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...ls/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiModerationApi.java
Outdated
Show resolved
Hide resolved
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
Signed-off-by: lambochen <[email protected]>
@ConfigurationProperties(OpenAiChatProperties.CONFIG_PREFIX) | ||
public class OpenAiChatProperties extends OpenAiParentProperties { | ||
|
||
public static final String CONFIG_PREFIX = "spring.ai.openai.chat"; | ||
|
||
public static final String DEFAULT_CHAT_MODEL = "gpt-4o-mini"; | ||
|
||
public static final String DEFAULT_COMPLETIONS_PATH = "/v1/chat/completions"; | ||
public static final String DEFAULT_COMPLETIONS_PATH = OpenAiApiConstants.DEFAULT_COMPLETIONS_PATH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAiChatProperties.DEFAULT_COMPLETIONS_PATH
can be replaced with OpenAiApiConstants.DEFAULT_COMPLETIONS_PATH
.
Is there any reason to keep OpenAiChatProperties.DEFAULT_COMPLETIONS_PATH
anymore? Both are public static final
.
OpenAiEmbeddingProperties.DEFAULT_EMBEDDINGS_PATH
and OpenAiImageProperties.DEFAULT_IMAGES_PATH
are the same as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @dev-jonghoonpark .
To ensure compatibility with lower versions (as these attributes are all public and may have been referenced in user business code), OpenAiChatProperties.DEFAULT_COMPLETIONS_PATH, OpenAiEmbeddingProperties.DEFAULT_EMBEDDINGS_PATH, and OpenAiImageProperties.DEFAULT_IMAGES_PATH have been retained.
However, they have all been moved to OpenAiApiConstants for unified management.
...ing-ai-openai/src/main/java/org/springframework/ai/openai/api/common/OpenAiApiConstants.java
Outdated
Show resolved
Hide resolved
Signed-off-by: lambochen <[email protected]>
Thank you for taking time to contribute this pull request!
You might have already read the [contributor guide][1], but as a reminder, please make sure to:
main
branch and squash your commitsref issue: #3451
OpenAI's audio and moderation configuration paths are supported, as detailed below: