Skip to content

Commit 03d1d50

Browse files
committed
Update the Azure OpenAI Chat Model to defult to the gpt-4o
1 parent 0e97f9c commit 03d1d50

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

models/spring-ai-azure-openai/src/test/java/org/springframework/ai/azure/openai/metadata/AzureOpenAiChatModelMetadataTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ MockMvc mockMvc() {
188188
@SuppressWarnings("all")
189189
static class SpringAzureOpenAiChatCompletionsController {
190190

191-
@PostMapping("/openai/deployments/gpt-35-turbo/chat/completions")
191+
@PostMapping("/openai/deployments/gpt-4o/chat/completions")
192192
ResponseEntity<?> chatCompletions(WebRequest request) {
193193

194194
String json = getJson();
@@ -207,7 +207,7 @@ private String getJson() {
207207
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
208208
"object": "chat.completion",
209209
"created": 1679072642,
210-
"model": "gpt-35-turbo",
210+
"model": "gpt-4o",
211211
"choices":[{
212212
"index": 0,
213213
"content_filter_results" : {

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/azure-openai-chat.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ For example, a deployment named 'MyAiDeployment' could be configured to use eith
5252

5353
To get started, follow these steps to create a deployment with the default settings:
5454

55-
Deployment Name: `gpt-35-turbo`
56-
Model Name: `gpt-35-turbo`
55+
Deployment Name: `gpt-4o`
56+
Model Name: `gpt-4o`
5757

5858
This Azure configuration aligns with the default configurations of the Spring Boot Azure AI Starter and its Autoconfiguration feature.
5959
If you use a different Deployment Name, make sure to update the configuration property accordingly:
@@ -132,7 +132,7 @@ The prefix `spring.ai.azure.openai.chat` is the property prefix that configures
132132
It's important to note that within an Azure OpenAI deployment, the "Deployment Name" is distinct from the model itself.
133133
The confusion around these terms stems from the intention to make the Azure OpenAI client library compatible with the original OpenAI endpoint.
134134
The deployment structures offered by Azure OpenAI and Sam Altman's OpenAI differ significantly.
135-
Deployments model name to provide as part of this completions request. | gpt-35-turbo
135+
Deployments model name to provide as part of this completions request. | gpt-4o
136136
| spring.ai.azure.openai.chat.options.maxTokens | The maximum number of tokens to generate. | -
137137
| spring.ai.azure.openai.chat.options.temperature | The sampling temperature to use that controls the apparent creativity of generated completions. Higher values will make output more random while lower values will make results more focused and deterministic. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict. | 0.7
138138
| spring.ai.azure.openai.chat.options.topP | An alternative to sampling with temperature called nucleus sampling. This value causes the model to consider the results of tokens with the provided probability mass. | -
@@ -225,7 +225,7 @@ Add a `application.properties` file, under the `src/main/resources` directory, t
225225
----
226226
spring.ai.azure.openai.api-key=YOUR_API_KEY
227227
spring.ai.azure.openai.endpoint=YOUR_ENDPOINT
228-
spring.ai.azure.openai.chat.options.deployment-name=gpt-35-turbo
228+
spring.ai.azure.openai.chat.options.deployment-name=gpt-4o
229229
spring.ai.azure.openai.chat.options.temperature=0.7
230230
----
231231

@@ -296,7 +296,7 @@ var openAIClient = new OpenAIClientBuilder()
296296
.buildClient();
297297
298298
var openAIChatOptions = AzureOpenAiChatOptions.builder()
299-
.withDeploymentName("gpt-35-turbo")
299+
.withDeploymentName("gpt-4o")
300300
.withTemperature(0.4f)
301301
.withMaxTokens(200)
302302
.build();
@@ -312,5 +312,5 @@ Flux<ChatResponse> response = chatModel.stream(
312312
313313
----
314314

315-
NOTE: the `gpt-35-turbo` is actually the `Deployment Name` as presented in the Azure AI Portal.
315+
NOTE: the `gpt-4o` is actually the `Deployment Name` as presented in the Azure AI Portal.
316316

spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/azure/openai/AzureOpenAiChatProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class AzureOpenAiChatProperties {
2424

2525
public static final String CONFIG_PREFIX = "spring.ai.azure.openai.chat";
2626

27-
public static final String DEFAULT_DEPLOYMENT_NAME = "gpt-35-turbo";
27+
public static final String DEFAULT_DEPLOYMENT_NAME = "gpt-4o";
2828

2929
private static final Double DEFAULT_TEMPERATURE = 0.7;
3030

0 commit comments

Comments
 (0)