You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java
+25-3Lines changed: 25 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2023-2024 the original author or authors.
2
+
* Copyright 2023-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -167,6 +167,13 @@ public class AzureOpenAiChatOptions implements ToolCallingChatOptions {
167
167
@JsonProperty("top_log_probs")
168
168
privateIntegertopLogProbs;
169
169
170
+
/*
171
+
* An upper bound for the number of tokens that can be generated for a completion,
172
+
* including visible output tokens and reasoning tokens.
173
+
*/
174
+
@JsonProperty("max_completion_tokens")
175
+
privateIntegermaxCompletionTokens;
176
+
170
177
/*
171
178
* If provided, the configuration options for available Azure OpenAI chat
172
179
* enhancements.
@@ -266,6 +273,7 @@ public static AzureOpenAiChatOptions fromOptions(AzureOpenAiChatOptions fromOpti
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/azure-openai-chat.adoc
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,12 +113,12 @@ This is because in OpenAI there is no `Deployment Name`, only a `Model Name`.
113
113
114
114
NOTE: The property `spring.ai.azure.openai.chat.options.model` has been renamed to `spring.ai.azure.openai.chat.options.deployment-name`.
115
115
116
-
NOTE: If you decide to connect to `OpenAI` instead of `Azure OpenAI`, by setting the `spring.ai.azure.openai.openai-api-key=<Your OpenAI Key>` property,
116
+
NOTE: If you decide to connect to `OpenAI` instead of `Azure OpenAI`, by setting the `spring.ai.azure.openai.openai-api-key=<Your OpenAI Key>` property,
117
117
then the `spring.ai.azure.openai.chat.options.deployment-name` is treated as an link:https://platform.openai.com/docs/models[OpenAI model] name.
118
118
119
119
==== Access the OpenAI Model
120
120
121
-
You can configure the client to use directly `OpenAI` instead of the `Azure OpenAI` deployed models.
121
+
You can configure the client to use directly `OpenAI` instead of the `Azure OpenAI` deployed models.
122
122
For this you need to set the `spring.ai.azure.openai.openai-api-key=<Your OpenAI Key>` instead of `spring.ai.azure.openai.api-key=<Your Azure OpenAi Key>`.
123
123
124
124
=== Add Repositories and BOM
@@ -197,8 +197,8 @@ The prefix `spring.ai.azure.openai` is the property prefix to configure the conn
197
197
198
198
| spring.ai.azure.openai.api-key | The Key from Azure AI OpenAI `Keys and Endpoint` section under `Resource Management` | -
199
199
| spring.ai.azure.openai.endpoint | The endpoint from the Azure AI OpenAI `Keys and Endpoint` section under `Resource Management` | -
200
-
| spring.ai.azure.openai.openai-api-key | (non Azure) OpenAI API key. Used to authenticate with the OpenAI service, instead of Azure OpenAI.
201
-
This automatically sets the endpoint to https://api.openai.com/v1. Use either `api-key` or `openai-api-key` property.
200
+
| spring.ai.azure.openai.openai-api-key | (non Azure) OpenAI API key. Used to authenticate with the OpenAI service, instead of Azure OpenAI.
201
+
This automatically sets the endpoint to https://api.openai.com/v1. Use either `api-key` or `openai-api-key` property.
202
202
With this configuration the `spring.ai.azure.openai.chat.options.deployment-name` is treated as an https://platform.openai.com/docs/models[OpenAi Model] name.| -
203
203
| spring.ai.azure.openai.custom-headers | A map of custom headers to be included in the API requests. Each entry in the map represents a header, where the key is the header name and the value is the header value. | Empty map
204
204
|====
@@ -223,11 +223,12 @@ The prefix `spring.ai.azure.openai.chat` is the property prefix that configures
223
223
| spring.ai.azure.openai.chat.enabled (Removed and no longer valid) | Enable Azure OpenAI chat model. | true
| spring.ai.azure.openai.chat.options.deployment-name | In use with Azure, this refers to the "Deployment Name" of your model, which you can find at https://oai.azure.com/portal.
226
-
It's important to note that within an Azure OpenAI deployment, the "Deployment Name" is distinct from the model itself.
227
-
The confusion around these terms stems from the intention to make the Azure OpenAI client library compatible with the original OpenAI endpoint.
226
+
It's important to note that within an Azure OpenAI deployment, the "Deployment Name" is distinct from the model itself.
227
+
The confusion around these terms stems from the intention to make the Azure OpenAI client library compatible with the original OpenAI endpoint.
228
228
The deployment structures offered by Azure OpenAI and Sam Altman's OpenAI differ significantly.
229
229
Deployments model name to provide as part of this completions request. | gpt-4o
230
-
| spring.ai.azure.openai.chat.options.maxTokens | The maximum number of tokens to generate. | -
230
+
| spring.ai.azure.openai.chat.options.maxTokens | The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. | -
231
+
| spring.ai.azure.openai.chat.options.maxCompletionTokens | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | -
231
232
| 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
232
233
| 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. | -
233
234
| spring.ai.azure.openai.chat.options.logitBias | A map between GPT token IDs and bias scores that influences the probability of specific tokens appearing in a completions response. Token IDs are computed via external tokenizer tools, while bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias score varies by model. | -
@@ -409,9 +410,9 @@ var openAIClientBuilder = new OpenAIClientBuilder()
0 commit comments