Skip to content

Commit aeca1e7

Browse files
[azopenai] prep release (Azure#21612)
1 parent 3299e11 commit aeca1e7

File tree

5 files changed

+37
-148
lines changed

5 files changed

+37
-148
lines changed

sdk/ai/azopenai/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 0.3.0 (Unreleased)
3+
## 0.3.0 (2023-09-26)
44

55
### Features Added
66
- Support for Whisper audio APIs for transcription and translation using `GetAudioTranscription` and `GetAudioTranslation`.
@@ -9,10 +9,6 @@
99
- ChatChoiceContentFilterResults content filtering fields are now all typed as ContentFilterResult, instead of unique types for each field.
1010
- `PromptAnnotations` renamed to `PromptFilterResults` in `ChatCompletions` and `Completions`.
1111

12-
### Bugs Fixed
13-
14-
### Other Changes
15-
1612
## 0.2.0 (2023-08-28)
1713

1814
### Features Added

sdk/ai/azopenai/autorest.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ directive:
201201
202202
fix($.AudioTranslationOptions.properties.response_format);
203203
fix($.AudioTranslation.properties.task);
204+
205+
- from:
206+
- options.go
207+
- models_serde.go
208+
- models.go
209+
where: $
210+
transform: |
211+
return $
212+
.replace(/AvgLogprob \*float32/g, "AvgLogProb *float32")
213+
.replace(/(a|c)\.AvgLogprob/g, "$1.AvgLogProb")
214+
204215
#
205216
# [END] Whisper
206217
#
@@ -253,10 +264,16 @@ directive:
253264
where: $
254265
transform: |
255266
return $
256-
// InnerError is actually a recursive type, no need for this innererrorinnererror type
267+
// remove some types that were generated to support the recursive error.
257268
.replace(/\/\/ AzureCoreFoundationsInnerErrorInnererror.+?\n}/s, "")
258269
// also, remove its marshalling functions
259-
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?AzureCoreFoundationsInnerErrorInnererror.+?\n}/sg, "")
270+
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsInnerErrorInnererror.+?\n}/sg, "")
271+
.replace(/\/\/ AzureCoreFoundationsErrorInnererror.+?\n}/s, "")
272+
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorInnererror.+?\n}/sg, "")
273+
.replace(/\/\/ AzureCoreFoundationsErrorResponseError.+?\n}/s, "")
274+
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorResponseError.+?\n}/sg, "")
275+
.replace(/\/\/ AzureCoreFoundationsErrorResponse.+?\n}/s, "")
276+
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorResponse.+?\n}/sg, "")
260277
261278
// Remove any references to the type and replace them with InnerError.
262279
.replace(/Innererror \*(AzureCoreFoundationsInnerErrorInnererror|AzureCoreFoundationsErrorInnererror)/g, "InnerError *InnerError")

sdk/ai/azopenai/client_chat_completions_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"context"
1111
"errors"
1212
"io"
13+
"net/http"
1314
"os"
1415
"testing"
1516

@@ -89,6 +90,11 @@ func testGetChatCompletions(t *testing.T, client *azopenai.Client, tv testVars)
8990
}
9091

9192
resp, err := client.GetChatCompletions(context.Background(), newTestChatCompletionOptions(tv), nil)
93+
94+
if respErr := (*azcore.ResponseError)(nil); errors.As(err, &respErr) && respErr.StatusCode == http.StatusTooManyRequests {
95+
t.Skipf("OpenAI resource overloaded, skipping this test")
96+
}
97+
9298
require.NoError(t, err)
9399

94100
if tv.Endpoint.Azure {
@@ -111,6 +117,11 @@ func testGetChatCompletions(t *testing.T, client *azopenai.Client, tv testVars)
111117

112118
func testGetChatCompletionsStream(t *testing.T, client *azopenai.Client, tv testVars) {
113119
streamResp, err := client.GetChatCompletionsStream(context.Background(), newTestChatCompletionOptions(tv), nil)
120+
121+
if respErr := (*azcore.ResponseError)(nil); errors.As(err, &respErr) && respErr.StatusCode == http.StatusTooManyRequests {
122+
t.Skipf("OpenAI resource overloaded, skipping this test")
123+
}
124+
114125
require.NoError(t, err)
115126

116127
// the data comes back differently for streaming

sdk/ai/azopenai/models.go

Lines changed: 2 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/ai/azopenai/models_serde.go

Lines changed: 4 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)