From 853b7483c07dc6f3b820f28bf3c5f097c3d440ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:59:08 +0000 Subject: [PATCH 1/2] fix(client): don't truncate manually specified filenames (#230) --- field.go | 2 +- internal/apiform/encoder.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/field.go b/field.go index 730a024d..27fd57f6 100644 --- a/field.go +++ b/field.go @@ -46,5 +46,5 @@ type file struct { contentType string } -func (f *file) Name() string { return f.name } func (f *file) ContentType() string { return f.contentType } +func (f *file) Filename() string { return f.name } diff --git a/internal/apiform/encoder.go b/internal/apiform/encoder.go index 555330ae..148fcb5b 100644 --- a/internal/apiform/encoder.go +++ b/internal/apiform/encoder.go @@ -315,7 +315,9 @@ func (e *encoder) newReaderTypeEncoder() encoderFunc { reader := value.Convert(reflect.TypeOf((*io.Reader)(nil)).Elem()).Interface().(io.Reader) filename := "anonymous_file" contentType := "application/octet-stream" - if named, ok := reader.(interface{ Name() string }); ok { + if named, ok := reader.(interface{ Filename() string }); ok { + filename = named.Filename() + } else if named, ok := reader.(interface{ Name() string }); ok { filename = path.Base(named.Name()) } if typed, ok := reader.(interface{ ContentType() string }); ok { From 2c02b83b0941ea3aef680533ebe7bd128961ac7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 05:02:30 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.59 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5589e3a4..a7ec9894 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.58" + ".": "0.1.0-alpha.59" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5455c4d9..71f55931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.59 (2025-02-15) + +Full Changelog: [v0.1.0-alpha.58...v0.1.0-alpha.59](https://github.com/openai/openai-go/compare/v0.1.0-alpha.58...v0.1.0-alpha.59) + +### Bug Fixes + +* **client:** don't truncate manually specified filenames ([#230](https://github.com/openai/openai-go/issues/230)) ([853b748](https://github.com/openai/openai-go/commit/853b7483c07dc6f3b820f28bf3c5f097c3d440ad)) + ## 0.1.0-alpha.58 (2025-02-13) Full Changelog: [v0.1.0-alpha.57...v0.1.0-alpha.58](https://github.com/openai/openai-go/compare/v0.1.0-alpha.57...v0.1.0-alpha.58) diff --git a/README.md b/README.md index dc616dfd..99b17637 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Or to pin the version: ```sh -go get -u 'github.com/openai/openai-go@v0.1.0-alpha.58' +go get -u 'github.com/openai/openai-go@v0.1.0-alpha.59' ``` diff --git a/internal/version.go b/internal/version.go index 36a25ea4..03509d09 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.1.0-alpha.58" // x-release-please-version +const PackageVersion = "0.1.0-alpha.59" // x-release-please-version