Skip to content

Commit

Permalink
Updating based on feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Park committed Sep 26, 2023
1 parent e6e58be commit 3f49132
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 144 deletions.
2 changes: 1 addition & 1 deletion sdk/ai/azopenai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 0.3.0 (2023-09-25)
## 0.3.0 (2023-09-26)

### Features Added
- Support for Whisper audio APIs for transcription and translation using `GetAudioTranscription` and `GetAudioTranslation`.
Expand Down
21 changes: 19 additions & 2 deletions sdk/ai/azopenai/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ directive:
fix($.AudioTranslationOptions.properties.response_format);
fix($.AudioTranslation.properties.task);
- from:
- options.go
- models_serde.go
- models.go
where: $
transform: |
return $
.replace(/AvgLogprob \*float32/g, "AvgLogProb *float32")
.replace(/(a|c)\.AvgLogprob/g, "$1.AvgLogProb")
#
# [END] Whisper
#
Expand Down Expand Up @@ -253,10 +264,16 @@ directive:
where: $
transform: |
return $
// InnerError is actually a recursive type, no need for this innererrorinnererror type
// remove some types that were generated to support the recursive error.
.replace(/\/\/ AzureCoreFoundationsInnerErrorInnererror.+?\n}/s, "")
// also, remove its marshalling functions
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?AzureCoreFoundationsInnerErrorInnererror.+?\n}/sg, "")
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsInnerErrorInnererror.+?\n}/sg, "")
.replace(/\/\/ AzureCoreFoundationsErrorInnererror.+?\n}/s, "")
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorInnererror.+?\n}/sg, "")
.replace(/\/\/ AzureCoreFoundationsErrorResponseError.+?\n}/s, "")
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorResponseError.+?\n}/sg, "")
.replace(/\/\/ AzureCoreFoundationsErrorResponse.+?\n}/s, "")
.replace(/\/\/ (Unmarshal|Marshal)JSON implements[^\n]+?for type AzureCoreFoundationsErrorResponse.+?\n}/sg, "")
// Remove any references to the type and replace them with InnerError.
.replace(/Innererror \*(AzureCoreFoundationsInnerErrorInnererror|AzureCoreFoundationsErrorInnererror)/g, "InnerError *InnerError")
Expand Down
38 changes: 2 additions & 36 deletions sdk/ai/azopenai/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 4 additions & 105 deletions sdk/ai/azopenai/models_serde.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3f49132

Please sign in to comment.