mirror of
https://github.com/openai/openai-go.git
synced 2026-04-01 17:17:14 +09:00
fix(client): correctly specify Accept header with */* instead of empty
This commit is contained in:
@@ -86,7 +86,7 @@ func (r *ContainerService) ListAutoPaging(ctx context.Context, query ContainerLi
|
||||
// Delete Container
|
||||
func (r *ContainerService) Delete(ctx context.Context, containerID string, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if containerID == "" {
|
||||
err = errors.New("missing required container_id parameter")
|
||||
return
|
||||
|
||||
@@ -106,7 +106,7 @@ func (r *ContainerFileService) ListAutoPaging(ctx context.Context, containerID s
|
||||
// Delete Container File
|
||||
func (r *ContainerFileService) Delete(ctx context.Context, containerID string, fileID string, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if containerID == "" {
|
||||
err = errors.New("missing required container_id parameter")
|
||||
return
|
||||
|
||||
@@ -40,7 +40,7 @@ func NewCallService(opts ...option.RequestOption) (r CallService) {
|
||||
// it.
|
||||
func (r *CallService) Accept(ctx context.Context, callID string, body CallAcceptParams, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if callID == "" {
|
||||
err = errors.New("missing required call_id parameter")
|
||||
return
|
||||
@@ -53,7 +53,7 @@ func (r *CallService) Accept(ctx context.Context, callID string, body CallAccept
|
||||
// End an active Realtime API call, whether it was initiated over SIP or WebRTC.
|
||||
func (r *CallService) Hangup(ctx context.Context, callID string, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if callID == "" {
|
||||
err = errors.New("missing required call_id parameter")
|
||||
return
|
||||
@@ -66,7 +66,7 @@ func (r *CallService) Hangup(ctx context.Context, callID string, opts ...option.
|
||||
// Transfer an active SIP call to a new destination using the SIP REFER verb.
|
||||
func (r *CallService) Refer(ctx context.Context, callID string, body CallReferParams, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if callID == "" {
|
||||
err = errors.New("missing required call_id parameter")
|
||||
return
|
||||
@@ -79,7 +79,7 @@ func (r *CallService) Refer(ctx context.Context, callID string, body CallReferPa
|
||||
// Decline an incoming SIP call by returning a SIP status code to the caller.
|
||||
func (r *CallService) Reject(ctx context.Context, callID string, body CallRejectParams, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if callID == "" {
|
||||
err = errors.New("missing required call_id parameter")
|
||||
return
|
||||
|
||||
@@ -120,7 +120,7 @@ func (r *ResponseService) GetStreaming(ctx context.Context, responseID string, q
|
||||
// Deletes a model response with the given ID.
|
||||
func (r *ResponseService) Delete(ctx context.Context, responseID string, opts ...option.RequestOption) (err error) {
|
||||
opts = slices.Concat(r.Options, opts)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
|
||||
if responseID == "" {
|
||||
err = errors.New("missing required response_id parameter")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user