Skip to content

Commit 4cecc09

Browse files
committed
feat(openai): Add OpenAI GPT-4.1 models to the OpenAiApi.ChatModel
Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
1 parent 53a7af5 commit 4cecc09

File tree

1 file changed

+27
-1
lines changed
  • models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api

1 file changed

+27
-1
lines changed

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,33 @@ public enum ChatModel implements ChatModelDescription {
475475
* Context window: 4,096 tokens. Max output tokens: 4,096 tokens. Knowledge
476476
* cutoff: September, 2021.
477477
*/
478-
GPT_3_5_TURBO_INSTRUCT("gpt-3.5-turbo-instruct");
478+
GPT_3_5_TURBO_INSTRUCT("gpt-3.5-turbo-instruct"),
479+
480+
/**
481+
* <b>GPT-4.1</b> is the flagship model for complex tasks. It is well suited for
482+
* problem solving across domains.
483+
* <p>
484+
* Context window: 1,047,576 tokens. Max output tokens: 32,768 tokens. Knowledge
485+
* cutoff: June 1, 2024.
486+
*/
487+
GPT_4_1("gpt-4.1"),
488+
489+
/**
490+
* <b>GPT-4.1-mini</b> provides a balance between intelligence, speed, and cost
491+
* that makes it an attractive model for many use cases.
492+
* <p>
493+
* Context window: 1,047,576 tokens. Max output tokens: 32,768 tokens. Knowledge
494+
* cutoff: June 1, 2024.
495+
*/
496+
GPT_4_1_MINI("gpt-4.1-mini"),
497+
498+
/**
499+
* <b>GPT-4.1-nano</b> is the fastest, most cost-effective GPT-4.1 model.
500+
* <p>
501+
* Context window: 1,047,576 tokens. Max output tokens: 32,768 tokens. Knowledge
502+
* cutoff: June 1, 2024.
503+
*/
504+
GPT_4_1_NANO("gpt-4.1-nano");
479505

480506
public final String value;
481507

0 commit comments

Comments
 (0)