Skip to content

Commit d83922b

Browse files
authored
Merge pull request #546 from openai/release-please--branches--main--changes--next
release: 3.5.0
2 parents 043652c + 6eab401 commit d83922b

File tree

9 files changed

+15
-235
lines changed

9 files changed

+15
-235
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.4.0"
2+
".": "3.5.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 123
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-104cced8f4c7436a76eea02e26307828166405ccfb296faffb008b72772c11a7.yml
3-
openapi_spec_hash: fdc03ed84a65a31b80da909255e53924
4-
config_hash: 03b48e9b8c7231a902403210dbd7dfa0
1+
configured_endpoints: 122
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f59befea071ed7729cbb7bce219e7f837eccfdb57e01698514e6a0bd6052ff60.yml
3+
openapi_spec_hash: 49da48619d37932b2e257c532078b2bb
4+
config_hash: 1af83449a09a3b4f276444dbcdd3eb67

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 3.5.0 (2025-10-17)
4+
5+
Full Changelog: [v3.4.0...v3.5.0](https://github.com/openai/openai-go/compare/v3.4.0...v3.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([1aa78dd](https://github.com/openai/openai-go/commit/1aa78dda7aae7b72ce021250b5357ead8db36f46))
10+
311
## 3.4.0 (2025-10-16)
412

513
Full Changelog: [v3.3.0...v3.4.0](https://github.com/openai/openai-go/compare/v3.3.0...v3.4.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Or to pin the version:
3030
<!-- x-release-please-start-version -->
3131

3232
```sh
33-
go get -u 'github.com/openai/openai-go/v2@v3.4.0'
33+
go get -u 'github.com/openai/openai-go/v2@v3.5.0'
3434
```
3535

3636
<!-- x-release-please-end -->

api.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,6 @@ Methods:
441441
Response Types:
442442

443443
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#ChatKitWorkflow">ChatKitWorkflow</a>
444-
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#FilePart">FilePart</a>
445-
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#ImagePart">ImagePart</a>
446-
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#BetaChatKitUploadFileResponseUnion">BetaChatKitUploadFileResponseUnion</a>
447-
448-
Methods:
449-
450-
- <code title="post /chatkit/files">client.Beta.ChatKit.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#BetaChatKitService.UploadFile">UploadFile</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#BetaChatKitUploadFileParams">BetaChatKitUploadFileParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#BetaChatKitUploadFileResponseUnion">BetaChatKitUploadFileResponseUnion</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
451444

452445
### Sessions
453446

betachatkit.go

Lines changed: 0 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@
33
package openai
44

55
import (
6-
"bytes"
7-
"context"
86
"encoding/json"
9-
"io"
10-
"mime/multipart"
11-
"net/http"
12-
"slices"
137

14-
"github.com/openai/openai-go/v3/internal/apiform"
158
"github.com/openai/openai-go/v3/internal/apijson"
16-
"github.com/openai/openai-go/v3/internal/requestconfig"
179
"github.com/openai/openai-go/v3/option"
1810
"github.com/openai/openai-go/v3/packages/respjson"
19-
"github.com/openai/openai-go/v3/shared/constant"
2011
)
2112

2213
// BetaChatKitService contains methods and other services that help with
@@ -42,15 +33,6 @@ func NewBetaChatKitService(opts ...option.RequestOption) (r BetaChatKitService)
4233
return
4334
}
4435

45-
// Upload a ChatKit file
46-
func (r *BetaChatKitService) UploadFile(ctx context.Context, body BetaChatKitUploadFileParams, opts ...option.RequestOption) (res *BetaChatKitUploadFileResponseUnion, err error) {
47-
opts = slices.Concat(r.Options, opts)
48-
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "chatkit_beta=v1")}, opts...)
49-
path := "chatkit/files"
50-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
51-
return
52-
}
53-
5436
// Workflow metadata and state returned for the session.
5537
type ChatKitWorkflow struct {
5638
// Identifier of the workflow backing the session.
@@ -141,165 +123,3 @@ func (r ChatKitWorkflowTracing) RawJSON() string { return r.JSON.raw }
141123
func (r *ChatKitWorkflowTracing) UnmarshalJSON(data []byte) error {
142124
return apijson.UnmarshalRoot(data, r)
143125
}
144-
145-
// Metadata for a non-image file uploaded through ChatKit.
146-
type FilePart struct {
147-
// Unique identifier for the uploaded file.
148-
ID string `json:"id,required"`
149-
// MIME type reported for the uploaded file. Defaults to null when unknown.
150-
MimeType string `json:"mime_type,required"`
151-
// Original filename supplied by the uploader. Defaults to null when unnamed.
152-
Name string `json:"name,required"`
153-
// Type discriminator that is always `file`.
154-
Type constant.File `json:"type,required"`
155-
// Signed URL for downloading the uploaded file. Defaults to null when no download
156-
// link is available.
157-
UploadURL string `json:"upload_url,required"`
158-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
159-
JSON struct {
160-
ID respjson.Field
161-
MimeType respjson.Field
162-
Name respjson.Field
163-
Type respjson.Field
164-
UploadURL respjson.Field
165-
ExtraFields map[string]respjson.Field
166-
raw string
167-
} `json:"-"`
168-
}
169-
170-
// Returns the unmodified JSON received from the API
171-
func (r FilePart) RawJSON() string { return r.JSON.raw }
172-
func (r *FilePart) UnmarshalJSON(data []byte) error {
173-
return apijson.UnmarshalRoot(data, r)
174-
}
175-
176-
// Metadata for an image uploaded through ChatKit.
177-
type ImagePart struct {
178-
// Unique identifier for the uploaded image.
179-
ID string `json:"id,required"`
180-
// MIME type of the uploaded image.
181-
MimeType string `json:"mime_type,required"`
182-
// Original filename for the uploaded image. Defaults to null when unnamed.
183-
Name string `json:"name,required"`
184-
// Preview URL that can be rendered inline for the image.
185-
PreviewURL string `json:"preview_url,required"`
186-
// Type discriminator that is always `image`.
187-
Type constant.Image `json:"type,required"`
188-
// Signed URL for downloading the uploaded image. Defaults to null when no download
189-
// link is available.
190-
UploadURL string `json:"upload_url,required"`
191-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
192-
JSON struct {
193-
ID respjson.Field
194-
MimeType respjson.Field
195-
Name respjson.Field
196-
PreviewURL respjson.Field
197-
Type respjson.Field
198-
UploadURL respjson.Field
199-
ExtraFields map[string]respjson.Field
200-
raw string
201-
} `json:"-"`
202-
}
203-
204-
// Returns the unmodified JSON received from the API
205-
func (r ImagePart) RawJSON() string { return r.JSON.raw }
206-
func (r *ImagePart) UnmarshalJSON(data []byte) error {
207-
return apijson.UnmarshalRoot(data, r)
208-
}
209-
210-
// BetaChatKitUploadFileResponseUnion contains all possible properties and values
211-
// from [FilePart], [ImagePart].
212-
//
213-
// Use the [BetaChatKitUploadFileResponseUnion.AsAny] method to switch on the
214-
// variant.
215-
//
216-
// Use the methods beginning with 'As' to cast the union to one of its variants.
217-
type BetaChatKitUploadFileResponseUnion struct {
218-
ID string `json:"id"`
219-
MimeType string `json:"mime_type"`
220-
Name string `json:"name"`
221-
// Any of "file", "image".
222-
Type string `json:"type"`
223-
UploadURL string `json:"upload_url"`
224-
// This field is from variant [ImagePart].
225-
PreviewURL string `json:"preview_url"`
226-
JSON struct {
227-
ID respjson.Field
228-
MimeType respjson.Field
229-
Name respjson.Field
230-
Type respjson.Field
231-
UploadURL respjson.Field
232-
PreviewURL respjson.Field
233-
raw string
234-
} `json:"-"`
235-
}
236-
237-
// anyBetaChatKitUploadFileResponse is implemented by each variant of
238-
// [BetaChatKitUploadFileResponseUnion] to add type safety for the return type of
239-
// [BetaChatKitUploadFileResponseUnion.AsAny]
240-
type anyBetaChatKitUploadFileResponse interface {
241-
implBetaChatKitUploadFileResponseUnion()
242-
}
243-
244-
func (FilePart) implBetaChatKitUploadFileResponseUnion() {}
245-
func (ImagePart) implBetaChatKitUploadFileResponseUnion() {}
246-
247-
// Use the following switch statement to find the correct variant
248-
//
249-
// switch variant := BetaChatKitUploadFileResponseUnion.AsAny().(type) {
250-
// case openai.FilePart:
251-
// case openai.ImagePart:
252-
// default:
253-
// fmt.Errorf("no variant present")
254-
// }
255-
func (u BetaChatKitUploadFileResponseUnion) AsAny() anyBetaChatKitUploadFileResponse {
256-
switch u.Type {
257-
case "file":
258-
return u.AsFile()
259-
case "image":
260-
return u.AsImage()
261-
}
262-
return nil
263-
}
264-
265-
func (u BetaChatKitUploadFileResponseUnion) AsFile() (v FilePart) {
266-
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
267-
return
268-
}
269-
270-
func (u BetaChatKitUploadFileResponseUnion) AsImage() (v ImagePart) {
271-
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
272-
return
273-
}
274-
275-
// Returns the unmodified JSON received from the API
276-
func (u BetaChatKitUploadFileResponseUnion) RawJSON() string { return u.JSON.raw }
277-
278-
func (r *BetaChatKitUploadFileResponseUnion) UnmarshalJSON(data []byte) error {
279-
return apijson.UnmarshalRoot(data, r)
280-
}
281-
282-
type BetaChatKitUploadFileParams struct {
283-
// Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
284-
// JPG, JPEG, GIF, or WEBP images.
285-
File io.Reader `json:"file,omitzero,required" format:"binary"`
286-
paramObj
287-
}
288-
289-
func (r BetaChatKitUploadFileParams) MarshalMultipart() (data []byte, contentType string, err error) {
290-
buf := bytes.NewBuffer(nil)
291-
writer := multipart.NewWriter(buf)
292-
err = apiform.MarshalRoot(r, writer)
293-
if err == nil {
294-
err = apiform.WriteExtras(writer, r.ExtraFields())
295-
}
296-
if err != nil {
297-
writer.Close()
298-
return nil, "", err
299-
}
300-
err = writer.Close()
301-
if err != nil {
302-
return nil, "", err
303-
}
304-
return buf.Bytes(), writer.FormDataContentType(), nil
305-
}

betachatkit_test.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

internal/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
package internal
44

5-
const PackageVersion = "3.4.0" // x-release-please-version
5+
const PackageVersion = "3.5.0" // x-release-please-version

scripts/detect-breaking-changes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ TEST_PATHS=(
2727
vectorstorefile_test.go
2828
vectorstorefilebatch_test.go
2929
webhooks/webhook_test.go
30-
betachatkit_test.go
3130
betachatkitsession_test.go
3231
betachatkitthread_test.go
3332
betaassistant_test.go

0 commit comments

Comments
 (0)