Repository: sashabaranov/go-openai
Pull request #316 (2023-05-19 10:36:15)

Azure OpenAI API version 2023-05-15
Azure OpenAI API version 2023-05-15 has been released.

* [What's new in Azure OpenAI Service? \- Azure Cognitive Services \| Microsoft Learn](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/whats-new#azure-openai-chat-completion-general-availability-ga)

<img width="752" alt="image" src="https://github.com/sashabaranov/go-openai/assets/1491856/1f3dbb94-42af-4394-9d3f-be1d481f5415">

* [Azure OpenAI Service REST API reference \- Azure OpenAI \| Microsoft Learn](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#rest-api-versioning)

<img width="750" alt="image" src="https://github.com/sashabaranov/go-openai/assets/1491856/ccb07c85-0b9b-4c03-bf98-48520c975eb0">

In response to the above announcement, I have updated the version specification.

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/sashabaranov/go-openai/pull/316?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#316](https://app.codecov.io/gh/sashabaranov/go-openai/pull/316?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (4bbaa69) into [master](https://app.codecov.io/gh/sashabaranov/go-openai/commit/21eef5bc8dd8a919c487fffb17214c055396bfcd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (21eef5b) will **not change** coverage.
> The diff coverage is `100.00%`.

```diff
@@           Coverage Diff           @@
##           master     #316   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files          21       21           
  Lines         659      659           
=======================================
  Hits          609      609           
  Misses         37       37           
  Partials       13       13           
```


| [Impacted Files](https://app.codecov.io/gh/sashabaranov/go-openai/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [config.go](https://app.codecov.io/gh/sashabaranov/go-openai/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29uZmlnLmdv) | `92.85% <100.00%> (ø)` | |



Patch:
diff --git a/config.go b/config.go
index fbcf377..c58b71e 100644
--- a/config.go
+++ b/config.go
@@ -56,7 +56,7 @@ func DefaultAzureConfig(apiKey, baseURL string) ClientConfig {
 		BaseURL:    baseURL,
 		OrgID:      "",
 		APIType:    APITypeAzure,
-		APIVersion: "2023-03-15-preview",
+		APIVersion: "2023-05-15",
 		AzureModelMapperFunc: func(model string) string {
 			return regexp.MustCompile(`[.:]`).ReplaceAllString(model, "")
 		},


Test patch:
diff --git a/api_internal_test.go b/api_internal_test.go
index 529e7c7..214b627 100644
--- a/api_internal_test.go
+++ b/api_internal_test.go
@@ -122,7 +122,7 @@ func TestAzureFullURL(t *testing.T) {
 			"chatgpt-demo",
 			"https://httpbin.org/" +
 				"openai/deployments/chatgpt-demo" +
-				"/chat/completions?api-version=2023-03-15-preview",
+				"/chat/completions?api-version=2023-05-15",
 		},
 		{
 			"AzureBaseURLWithoutSlashOK",
@@ -131,7 +131,7 @@ func TestAzureFullURL(t *testing.T) {
 			"chatgpt-demo",
 			"https://httpbin.org/" +
 				"openai/deployments/chatgpt-demo" +
-				"/chat/completions?api-version=2023-03-15-preview",
+				"/chat/completions?api-version=2023-05-15",
 		},
 	}