Skip to content

Commit

Permalink
[azopenai] Updating client to ensure filename is set for file upload. (
Browse files Browse the repository at this point in the history
…Azure#24171)

* [azopenai] Updating client to ensure filename is set for file upload.

* changelog
  • Loading branch information
glecaros authored Feb 26, 2025
1 parent bf35e0c commit d52f94e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions sdk/ai/azopenai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
- Fixed a problem that filename would be empty if not explicitly specified in the `UploadFile` operation. (PR#24171)

### Other Changes

Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azopenai/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/ai/azopenai",
"Tag": "go/ai/azopenai_0efed71611"
"Tag": "go/ai/azopenai_4a8ededa66"
}
2 changes: 1 addition & 1 deletion sdk/ai/azopenai/client_custom_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (client *Client) uploadFileCreateRequest(ctx context.Context, file io.ReadS
return nil, err
}
req.Raw().Header["Accept"] = []string{"application/json"}
fileName := ""
fileName := "file.txt"

if options != nil && options.Filename != nil {
fileName = *options.Filename
Expand Down

0 comments on commit d52f94e

Please sign in to comment.