Skip to content

Commit

Permalink
Replace the retiring Azure OpenAI API version with the GA version (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello committed May 23, 2024
1 parent 7a8ff2c commit bf4bce3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To successfully make a call against Azure OpenAI, you'll need the following:
| Name | Desc | Default |
| --------------------- | ------------------------------------------------------------ | ----------------------------- |
| 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 |
| 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 |
| 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 |
| 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 |

`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.
Expand Down Expand Up @@ -151,7 +151,7 @@ services:
AZURE_OPENAI_ENDPOINT: <Azure OpenAI API Endpoint>
AZURE_OPENAI_MODEL_MAPPER: <Azure OpenAI API Deployment Mapper>
# AZURE_OPENAI_MODEL_MAPPER: gpt-4=gpt-4,gpt-3.5-turbo=gpt-35-turbo
AZURE_OPENAI_API_VER: 2023-07-01-preview
AZURE_OPENAI_API_VER: "2024-02-01"
networks:
- chatgpt-ns

Expand Down Expand Up @@ -203,7 +203,7 @@ services:
environment:
AZURE_OPENAI_ENDPOINT: <Azure OpenAI API Endpoint>
AZURE_OPENAI_MODEL_MAPPER: <Azure OpenAI API Deployment Mapper>
AZURE_OPENAI_API_VER: 2023-07-01-preview
AZURE_OPENAI_API_VER: "2024-02-01"
networks:
- chatgpt-ns

Expand Down Expand Up @@ -231,17 +231,17 @@ deployment_config:
model_name: "text-davinci-003"
endpoint: "https://xxx-east-us.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"
- deployment_name: "yyy"
model_name: "gpt-3.5-turbo"
endpoint: "https://yyy.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"
- deployment_name: "zzzz"
model_name: "text-embedding-ada-002"
endpoint: "https://zzzz.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"
````

By default, it reads `<workdir>/config.yaml`, and you can pass the path through the parameter `-c config.yaml`.
Expand Down
2 changes: 1 addition & 1 deletion azure/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Init() error {
openaiModelMapper = viper.GetString(constant.ENV_AZURE_OPENAI_MODEL_MAPPER)
if endpoint != "" {
if apiVersion == "" {
apiVersion = "2023-07-01-preview"
apiVersion = "2024-02-01"
}
InitFromEnvironmentVariables(apiVersion, endpoint, openaiModelMapper)
} else {
Expand Down
6 changes: 3 additions & 3 deletions config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ deployment_config:
model_name: "text-davinci-003"
endpoint: "https://xxx-east-us.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"
- deployment_name: "yyy"
model_name: "gpt-3.5-turbo"
endpoint: "https://yyy.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"
- deployment_name: "zzzz"
model_name: "text-embedding-ada-002"
endpoint: "https://zzzz.openai.azure.com/"
api_key: "11111111111"
api_version: "2023-03-15-preview"
api_version: "2024-02-01"

0 comments on commit bf4bce3

Please sign in to comment.