Skip to content

Commit bf4bce3

Browse files
Replace the retiring Azure OpenAI API version with the GA version (#94)
Reference: - https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation#retiring-soon
1 parent 7a8ff2c commit bf4bce3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To successfully make a call against Azure OpenAI, you'll need the following:
3333
| Name | Desc | Default |
3434
| --------------------- | ------------------------------------------------------------ | ----------------------------- |
3535
| AZURE_OPENAI_ENDPOINT | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`. | N |
36-
| AZURE_OPENAI_API_VER | [See here](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quickstart?tabs=command-line&pivots=rest-api) or Azure OpenAI Studio | 2023-07-01-preview |
36+
| AZURE_OPENAI_API_VER | [See here](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quickstart?tabs=command-line&pivots=rest-api) or Azure OpenAI Studio | 2024-02-01 |
3737
| AZURE_OPENAI_MODEL_MAPPER | This value will correspond to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure OpenAI Studio. | N |
3838

3939
`AZURE_OPENAI_MODEL_MAPPER` is a mapping from Azure OpenAI deployed model names to official OpenAI model names. You can use commas to separate multiple mappings.
@@ -151,7 +151,7 @@ services:
151151
AZURE_OPENAI_ENDPOINT: <Azure OpenAI API Endpoint>
152152
AZURE_OPENAI_MODEL_MAPPER: <Azure OpenAI API Deployment Mapper>
153153
# AZURE_OPENAI_MODEL_MAPPER: gpt-4=gpt-4,gpt-3.5-turbo=gpt-35-turbo
154-
AZURE_OPENAI_API_VER: 2023-07-01-preview
154+
AZURE_OPENAI_API_VER: "2024-02-01"
155155
networks:
156156
- chatgpt-ns
157157

@@ -203,7 +203,7 @@ services:
203203
environment:
204204
AZURE_OPENAI_ENDPOINT: <Azure OpenAI API Endpoint>
205205
AZURE_OPENAI_MODEL_MAPPER: <Azure OpenAI API Deployment Mapper>
206-
AZURE_OPENAI_API_VER: 2023-07-01-preview
206+
AZURE_OPENAI_API_VER: "2024-02-01"
207207
networks:
208208
- chatgpt-ns
209209

@@ -231,17 +231,17 @@ deployment_config:
231231
model_name: "text-davinci-003"
232232
endpoint: "https://xxx-east-us.openai.azure.com/"
233233
api_key: "11111111111"
234-
api_version: "2023-03-15-preview"
234+
api_version: "2024-02-01"
235235
- deployment_name: "yyy"
236236
model_name: "gpt-3.5-turbo"
237237
endpoint: "https://yyy.openai.azure.com/"
238238
api_key: "11111111111"
239-
api_version: "2023-03-15-preview"
239+
api_version: "2024-02-01"
240240
- deployment_name: "zzzz"
241241
model_name: "text-embedding-ada-002"
242242
endpoint: "https://zzzz.openai.azure.com/"
243243
api_key: "11111111111"
244-
api_version: "2023-03-15-preview"
244+
api_version: "2024-02-01"
245245
````
246246

247247
By default, it reads `<workdir>/config.yaml`, and you can pass the path through the parameter `-c config.yaml`.

azure/init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Init() error {
3333
openaiModelMapper = viper.GetString(constant.ENV_AZURE_OPENAI_MODEL_MAPPER)
3434
if endpoint != "" {
3535
if apiVersion == "" {
36-
apiVersion = "2023-07-01-preview"
36+
apiVersion = "2024-02-01"
3737
}
3838
InitFromEnvironmentVariables(apiVersion, endpoint, openaiModelMapper)
3939
} else {

config/config.example.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ deployment_config:
44
model_name: "text-davinci-003"
55
endpoint: "https://xxx-east-us.openai.azure.com/"
66
api_key: "11111111111"
7-
api_version: "2023-03-15-preview"
7+
api_version: "2024-02-01"
88
- deployment_name: "yyy"
99
model_name: "gpt-3.5-turbo"
1010
endpoint: "https://yyy.openai.azure.com/"
1111
api_key: "11111111111"
12-
api_version: "2023-03-15-preview"
12+
api_version: "2024-02-01"
1313
- deployment_name: "zzzz"
1414
model_name: "text-embedding-ada-002"
1515
endpoint: "https://zzzz.openai.azure.com/"
1616
api_key: "11111111111"
17-
api_version: "2023-03-15-preview"
17+
api_version: "2024-02-01"

0 commit comments

Comments
 (0)