webhooks

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ChatModelChatgpt4oLatest = shared.ChatModelChatgpt4oLatest

Equals "chatgpt-4o-latest"

View Source
const ChatModelCodexMiniLatest = shared.ChatModelCodexMiniLatest

Equals "codex-mini-latest"

View Source
const ChatModelGPT3_5Turbo = shared.ChatModelGPT3_5Turbo

Equals "gpt-3.5-turbo"

View Source
const ChatModelGPT3_5Turbo0125 = shared.ChatModelGPT3_5Turbo0125

Equals "gpt-3.5-turbo-0125"

View Source
const ChatModelGPT3_5Turbo0301 = shared.ChatModelGPT3_5Turbo0301

Equals "gpt-3.5-turbo-0301"

View Source
const ChatModelGPT3_5Turbo0613 = shared.ChatModelGPT3_5Turbo0613

Equals "gpt-3.5-turbo-0613"

View Source
const ChatModelGPT3_5Turbo1106 = shared.ChatModelGPT3_5Turbo1106

Equals "gpt-3.5-turbo-1106"

View Source
const ChatModelGPT3_5Turbo16k = shared.ChatModelGPT3_5Turbo16k

Equals "gpt-3.5-turbo-16k"

View Source
const ChatModelGPT3_5Turbo16k0613 = shared.ChatModelGPT3_5Turbo16k0613

Equals "gpt-3.5-turbo-16k-0613"

View Source
const ChatModelGPT4 = shared.ChatModelGPT4

Equals "gpt-4"

View Source
const ChatModelGPT4Turbo = shared.ChatModelGPT4Turbo

Equals "gpt-4-turbo"

View Source
const ChatModelGPT4Turbo2024_04_09 = shared.ChatModelGPT4Turbo2024_04_09

Equals "gpt-4-turbo-2024-04-09"

View Source
const ChatModelGPT4TurboPreview = shared.ChatModelGPT4TurboPreview

Equals "gpt-4-turbo-preview"

View Source
const ChatModelGPT4VisionPreview = shared.ChatModelGPT4VisionPreview

Equals "gpt-4-vision-preview"

View Source
const ChatModelGPT4_0125Preview = shared.ChatModelGPT4_0125Preview

Equals "gpt-4-0125-preview"

View Source
const ChatModelGPT4_0314 = shared.ChatModelGPT4_0314

Equals "gpt-4-0314"

View Source
const ChatModelGPT4_0613 = shared.ChatModelGPT4_0613

Equals "gpt-4-0613"

View Source
const ChatModelGPT4_1 = shared.ChatModelGPT4_1

Equals "gpt-4.1"

View Source
const ChatModelGPT4_1106Preview = shared.ChatModelGPT4_1106Preview

Equals "gpt-4-1106-preview"

View Source
const ChatModelGPT4_1Mini = shared.ChatModelGPT4_1Mini

Equals "gpt-4.1-mini"

View Source
const ChatModelGPT4_1Mini2025_04_14 = shared.ChatModelGPT4_1Mini2025_04_14

Equals "gpt-4.1-mini-2025-04-14"

View Source
const ChatModelGPT4_1Nano = shared.ChatModelGPT4_1Nano

Equals "gpt-4.1-nano"

View Source
const ChatModelGPT4_1Nano2025_04_14 = shared.ChatModelGPT4_1Nano2025_04_14

Equals "gpt-4.1-nano-2025-04-14"

View Source
const ChatModelGPT4_1_2025_04_14 = shared.ChatModelGPT4_1_2025_04_14

Equals "gpt-4.1-2025-04-14"

View Source
const ChatModelGPT4_32k = shared.ChatModelGPT4_32k

Equals "gpt-4-32k"

View Source
const ChatModelGPT4_32k0314 = shared.ChatModelGPT4_32k0314

Equals "gpt-4-32k-0314"

View Source
const ChatModelGPT4_32k0613 = shared.ChatModelGPT4_32k0613

Equals "gpt-4-32k-0613"

View Source
const ChatModelGPT4o = shared.ChatModelGPT4o

Equals "gpt-4o"

View Source
const ChatModelGPT4o2024_05_13 = shared.ChatModelGPT4o2024_05_13

Equals "gpt-4o-2024-05-13"

View Source
const ChatModelGPT4o2024_08_06 = shared.ChatModelGPT4o2024_08_06

Equals "gpt-4o-2024-08-06"

View Source
const ChatModelGPT4o2024_11_20 = shared.ChatModelGPT4o2024_11_20

Equals "gpt-4o-2024-11-20"

View Source
const ChatModelGPT4oAudioPreview = shared.ChatModelGPT4oAudioPreview

Equals "gpt-4o-audio-preview"

View Source
const ChatModelGPT4oAudioPreview2024_10_01 = shared.ChatModelGPT4oAudioPreview2024_10_01

Equals "gpt-4o-audio-preview-2024-10-01"

View Source
const ChatModelGPT4oAudioPreview2024_12_17 = shared.ChatModelGPT4oAudioPreview2024_12_17

Equals "gpt-4o-audio-preview-2024-12-17"

View Source
const ChatModelGPT4oAudioPreview2025_06_03 = shared.ChatModelGPT4oAudioPreview2025_06_03

Equals "gpt-4o-audio-preview-2025-06-03"

View Source
const ChatModelGPT4oMini = shared.ChatModelGPT4oMini

Equals "gpt-4o-mini"

View Source
const ChatModelGPT4oMini2024_07_18 = shared.ChatModelGPT4oMini2024_07_18

Equals "gpt-4o-mini-2024-07-18"

View Source
const ChatModelGPT4oMiniAudioPreview = shared.ChatModelGPT4oMiniAudioPreview

Equals "gpt-4o-mini-audio-preview"

View Source
const ChatModelGPT4oMiniAudioPreview2024_12_17 = shared.ChatModelGPT4oMiniAudioPreview2024_12_17

Equals "gpt-4o-mini-audio-preview-2024-12-17"

View Source
const ChatModelGPT4oMiniSearchPreview = shared.ChatModelGPT4oMiniSearchPreview

Equals "gpt-4o-mini-search-preview"

View Source
const ChatModelGPT4oMiniSearchPreview2025_03_11 = shared.ChatModelGPT4oMiniSearchPreview2025_03_11

Equals "gpt-4o-mini-search-preview-2025-03-11"

View Source
const ChatModelGPT4oSearchPreview = shared.ChatModelGPT4oSearchPreview

Equals "gpt-4o-search-preview"

View Source
const ChatModelGPT4oSearchPreview2025_03_11 = shared.ChatModelGPT4oSearchPreview2025_03_11

Equals "gpt-4o-search-preview-2025-03-11"

View Source
const ChatModelO1 = shared.ChatModelO1

Equals "o1"

View Source
const ChatModelO1Mini = shared.ChatModelO1Mini

Equals "o1-mini"

View Source
const ChatModelO1Mini2024_09_12 = shared.ChatModelO1Mini2024_09_12

Equals "o1-mini-2024-09-12"

View Source
const ChatModelO1Preview = shared.ChatModelO1Preview

Equals "o1-preview"

View Source
const ChatModelO1Preview2024_09_12 = shared.ChatModelO1Preview2024_09_12

Equals "o1-preview-2024-09-12"

View Source
const ChatModelO1_2024_12_17 = shared.ChatModelO1_2024_12_17

Equals "o1-2024-12-17"

View Source
const ChatModelO3 = shared.ChatModelO3

Equals "o3"

View Source
const ChatModelO3Mini = shared.ChatModelO3Mini

Equals "o3-mini"

View Source
const ChatModelO3Mini2025_01_31 = shared.ChatModelO3Mini2025_01_31

Equals "o3-mini-2025-01-31"

View Source
const ChatModelO3_2025_04_16 = shared.ChatModelO3_2025_04_16

Equals "o3-2025-04-16"

View Source
const ChatModelO4Mini = shared.ChatModelO4Mini

Equals "o4-mini"

View Source
const ChatModelO4Mini2025_04_16 = shared.ChatModelO4Mini2025_04_16

Equals "o4-mini-2025-04-16"

View Source
const ComparisonFilterTypeEq = shared.ComparisonFilterTypeEq

Equals "eq"

View Source
const ComparisonFilterTypeGt = shared.ComparisonFilterTypeGt

Equals "gt"

View Source
const ComparisonFilterTypeGte = shared.ComparisonFilterTypeGte

Equals "gte"

View Source
const ComparisonFilterTypeLt = shared.ComparisonFilterTypeLt

Equals "lt"

View Source
const ComparisonFilterTypeLte = shared.ComparisonFilterTypeLte

Equals "lte"

View Source
const ComparisonFilterTypeNe = shared.ComparisonFilterTypeNe

Equals "ne"

View Source
const CompoundFilterTypeAnd = shared.CompoundFilterTypeAnd

Equals "and"

View Source
const CompoundFilterTypeOr = shared.CompoundFilterTypeOr

Equals "or"

View Source
const ReasoningEffortHigh = shared.ReasoningEffortHigh

Equals "high"

View Source
const ReasoningEffortLow = shared.ReasoningEffortLow

Equals "low"

View Source
const ReasoningEffortMedium = shared.ReasoningEffortMedium

Equals "medium"

View Source
const ReasoningGenerateSummaryAuto = shared.ReasoningGenerateSummaryAuto

Equals "auto"

View Source
const ReasoningGenerateSummaryConcise = shared.ReasoningGenerateSummaryConcise

Equals "concise"

View Source
const ReasoningGenerateSummaryDetailed = shared.ReasoningGenerateSummaryDetailed

Equals "detailed"

View Source
const ReasoningSummaryAuto = shared.ReasoningSummaryAuto

Equals "auto"

View Source
const ReasoningSummaryConcise = shared.ReasoningSummaryConcise

Equals "concise"

View Source
const ReasoningSummaryDetailed = shared.ReasoningSummaryDetailed

Equals "detailed"

View Source
const ResponsesModelComputerUsePreview = shared.ResponsesModelComputerUsePreview

Equals "computer-use-preview"

View Source
const ResponsesModelComputerUsePreview2025_03_11 = shared.ResponsesModelComputerUsePreview2025_03_11

Equals "computer-use-preview-2025-03-11"

View Source
const ResponsesModelO1Pro = shared.ResponsesModelO1Pro

Equals "o1-pro"

View Source
const ResponsesModelO1Pro2025_03_19 = shared.ResponsesModelO1Pro2025_03_19

Equals "o1-pro-2025-03-19"

View Source
const ResponsesModelO3DeepResearch = shared.ResponsesModelO3DeepResearch

Equals "o3-deep-research"

View Source
const ResponsesModelO3DeepResearch2025_06_26 = shared.ResponsesModelO3DeepResearch2025_06_26

Equals "o3-deep-research-2025-06-26"

View Source
const ResponsesModelO3Pro = shared.ResponsesModelO3Pro

Equals "o3-pro"

View Source
const ResponsesModelO3Pro2025_06_10 = shared.ResponsesModelO3Pro2025_06_10

Equals "o3-pro-2025-06-10"

View Source
const ResponsesModelO4MiniDeepResearch = shared.ResponsesModelO4MiniDeepResearch

Equals "o4-mini-deep-research"

View Source
const ResponsesModelO4MiniDeepResearch2025_06_26 = shared.ResponsesModelO4MiniDeepResearch2025_06_26

Equals "o4-mini-deep-research-2025-06-26"

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchCancelledWebhookEvent

type BatchCancelledWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the batch API request was cancelled.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data BatchCancelledWebhookEventData `json:"data,required"`
	// The type of the event. Always `batch.cancelled`.
	Type constant.BatchCancelled `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object BatchCancelledWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a batch API request has been cancelled.

func (BatchCancelledWebhookEvent) RawJSON

func (r BatchCancelledWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelledWebhookEvent) UnmarshalJSON

func (r *BatchCancelledWebhookEvent) UnmarshalJSON(data []byte) error

type BatchCancelledWebhookEventData

type BatchCancelledWebhookEventData struct {
	// The unique ID of the batch API request.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (BatchCancelledWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BatchCancelledWebhookEventData) UnmarshalJSON

func (r *BatchCancelledWebhookEventData) UnmarshalJSON(data []byte) error

type BatchCancelledWebhookEventObject

type BatchCancelledWebhookEventObject string

The object of the event. Always `event`.

const (
	BatchCancelledWebhookEventObjectEvent BatchCancelledWebhookEventObject = "event"
)

type BatchCompletedWebhookEvent

type BatchCompletedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the batch API request was completed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data BatchCompletedWebhookEventData `json:"data,required"`
	// The type of the event. Always `batch.completed`.
	Type constant.BatchCompleted `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object BatchCompletedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a batch API request has been completed.

func (BatchCompletedWebhookEvent) RawJSON

func (r BatchCompletedWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCompletedWebhookEvent) UnmarshalJSON

func (r *BatchCompletedWebhookEvent) UnmarshalJSON(data []byte) error

type BatchCompletedWebhookEventData

type BatchCompletedWebhookEventData struct {
	// The unique ID of the batch API request.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (BatchCompletedWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BatchCompletedWebhookEventData) UnmarshalJSON

func (r *BatchCompletedWebhookEventData) UnmarshalJSON(data []byte) error

type BatchCompletedWebhookEventObject

type BatchCompletedWebhookEventObject string

The object of the event. Always `event`.

const (
	BatchCompletedWebhookEventObjectEvent BatchCompletedWebhookEventObject = "event"
)

type BatchExpiredWebhookEvent

type BatchExpiredWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the batch API request expired.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data BatchExpiredWebhookEventData `json:"data,required"`
	// The type of the event. Always `batch.expired`.
	Type constant.BatchExpired `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object BatchExpiredWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a batch API request has expired.

func (BatchExpiredWebhookEvent) RawJSON

func (r BatchExpiredWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchExpiredWebhookEvent) UnmarshalJSON

func (r *BatchExpiredWebhookEvent) UnmarshalJSON(data []byte) error

type BatchExpiredWebhookEventData

type BatchExpiredWebhookEventData struct {
	// The unique ID of the batch API request.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (BatchExpiredWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BatchExpiredWebhookEventData) UnmarshalJSON

func (r *BatchExpiredWebhookEventData) UnmarshalJSON(data []byte) error

type BatchExpiredWebhookEventObject

type BatchExpiredWebhookEventObject string

The object of the event. Always `event`.

const (
	BatchExpiredWebhookEventObjectEvent BatchExpiredWebhookEventObject = "event"
)

type BatchFailedWebhookEvent

type BatchFailedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the batch API request failed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data BatchFailedWebhookEventData `json:"data,required"`
	// The type of the event. Always `batch.failed`.
	Type constant.BatchFailed `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object BatchFailedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a batch API request has failed.

func (BatchFailedWebhookEvent) RawJSON

func (r BatchFailedWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchFailedWebhookEvent) UnmarshalJSON

func (r *BatchFailedWebhookEvent) UnmarshalJSON(data []byte) error

type BatchFailedWebhookEventData

type BatchFailedWebhookEventData struct {
	// The unique ID of the batch API request.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (BatchFailedWebhookEventData) RawJSON

func (r BatchFailedWebhookEventData) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchFailedWebhookEventData) UnmarshalJSON

func (r *BatchFailedWebhookEventData) UnmarshalJSON(data []byte) error

type BatchFailedWebhookEventObject

type BatchFailedWebhookEventObject string

The object of the event. Always `event`.

const (
	BatchFailedWebhookEventObjectEvent BatchFailedWebhookEventObject = "event"
)

type ChatModel

type ChatModel = shared.ChatModel

This is an alias to an internal type.

type ComparisonFilter

type ComparisonFilter = shared.ComparisonFilter

A filter used to compare a specified attribute key to a given value using a defined comparison operation.

This is an alias to an internal type.

type ComparisonFilterParam

type ComparisonFilterParam = shared.ComparisonFilterParam

A filter used to compare a specified attribute key to a given value using a defined comparison operation.

This is an alias to an internal type.

type ComparisonFilterType

type ComparisonFilterType = shared.ComparisonFilterType

Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.

- `eq`: equals - `ne`: not equal - `gt`: greater than - `gte`: greater than or equal - `lt`: less than - `lte`: less than or equal

This is an alias to an internal type.

type ComparisonFilterValueUnion

type ComparisonFilterValueUnion = shared.ComparisonFilterValueUnion

The value to compare against the attribute key; supports string, number, or boolean types.

This is an alias to an internal type.

type ComparisonFilterValueUnionParam

type ComparisonFilterValueUnionParam = shared.ComparisonFilterValueUnionParam

The value to compare against the attribute key; supports string, number, or boolean types.

This is an alias to an internal type.

type CompoundFilter

type CompoundFilter = shared.CompoundFilter

Combine multiple filters using `and` or `or`.

This is an alias to an internal type.

type CompoundFilterParam

type CompoundFilterParam = shared.CompoundFilterParam

Combine multiple filters using `and` or `or`.

This is an alias to an internal type.

type CompoundFilterType

type CompoundFilterType = shared.CompoundFilterType

Type of operation: `and` or `or`.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type ErrorObject

type ErrorObject = shared.ErrorObject

This is an alias to an internal type.

type EvalRunCanceledWebhookEvent

type EvalRunCanceledWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the eval run was canceled.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data EvalRunCanceledWebhookEventData `json:"data,required"`
	// The type of the event. Always `eval.run.canceled`.
	Type constant.EvalRunCanceled `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object EvalRunCanceledWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when an eval run has been canceled.

func (EvalRunCanceledWebhookEvent) RawJSON

func (r EvalRunCanceledWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalRunCanceledWebhookEvent) UnmarshalJSON

func (r *EvalRunCanceledWebhookEvent) UnmarshalJSON(data []byte) error

type EvalRunCanceledWebhookEventData

type EvalRunCanceledWebhookEventData struct {
	// The unique ID of the eval run.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (EvalRunCanceledWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*EvalRunCanceledWebhookEventData) UnmarshalJSON

func (r *EvalRunCanceledWebhookEventData) UnmarshalJSON(data []byte) error

type EvalRunCanceledWebhookEventObject

type EvalRunCanceledWebhookEventObject string

The object of the event. Always `event`.

const (
	EvalRunCanceledWebhookEventObjectEvent EvalRunCanceledWebhookEventObject = "event"
)

type EvalRunFailedWebhookEvent

type EvalRunFailedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the eval run failed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data EvalRunFailedWebhookEventData `json:"data,required"`
	// The type of the event. Always `eval.run.failed`.
	Type constant.EvalRunFailed `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object EvalRunFailedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when an eval run has failed.

func (EvalRunFailedWebhookEvent) RawJSON

func (r EvalRunFailedWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalRunFailedWebhookEvent) UnmarshalJSON

func (r *EvalRunFailedWebhookEvent) UnmarshalJSON(data []byte) error

type EvalRunFailedWebhookEventData

type EvalRunFailedWebhookEventData struct {
	// The unique ID of the eval run.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (EvalRunFailedWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*EvalRunFailedWebhookEventData) UnmarshalJSON

func (r *EvalRunFailedWebhookEventData) UnmarshalJSON(data []byte) error

type EvalRunFailedWebhookEventObject

type EvalRunFailedWebhookEventObject string

The object of the event. Always `event`.

const (
	EvalRunFailedWebhookEventObjectEvent EvalRunFailedWebhookEventObject = "event"
)

type EvalRunSucceededWebhookEvent

type EvalRunSucceededWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the eval run succeeded.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data EvalRunSucceededWebhookEventData `json:"data,required"`
	// The type of the event. Always `eval.run.succeeded`.
	Type constant.EvalRunSucceeded `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object EvalRunSucceededWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when an eval run has succeeded.

func (EvalRunSucceededWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*EvalRunSucceededWebhookEvent) UnmarshalJSON

func (r *EvalRunSucceededWebhookEvent) UnmarshalJSON(data []byte) error

type EvalRunSucceededWebhookEventData

type EvalRunSucceededWebhookEventData struct {
	// The unique ID of the eval run.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (EvalRunSucceededWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*EvalRunSucceededWebhookEventData) UnmarshalJSON

func (r *EvalRunSucceededWebhookEventData) UnmarshalJSON(data []byte) error

type EvalRunSucceededWebhookEventObject

type EvalRunSucceededWebhookEventObject string

The object of the event. Always `event`.

const (
	EvalRunSucceededWebhookEventObjectEvent EvalRunSucceededWebhookEventObject = "event"
)

type FineTuningJobCancelledWebhookEvent

type FineTuningJobCancelledWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the fine-tuning job was cancelled.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data FineTuningJobCancelledWebhookEventData `json:"data,required"`
	// The type of the event. Always `fine_tuning.job.cancelled`.
	Type constant.FineTuningJobCancelled `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object FineTuningJobCancelledWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a fine-tuning job has been cancelled.

func (FineTuningJobCancelledWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobCancelledWebhookEvent) UnmarshalJSON

func (r *FineTuningJobCancelledWebhookEvent) UnmarshalJSON(data []byte) error

type FineTuningJobCancelledWebhookEventData

type FineTuningJobCancelledWebhookEventData struct {
	// The unique ID of the fine-tuning job.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (FineTuningJobCancelledWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobCancelledWebhookEventData) UnmarshalJSON

func (r *FineTuningJobCancelledWebhookEventData) UnmarshalJSON(data []byte) error

type FineTuningJobCancelledWebhookEventObject

type FineTuningJobCancelledWebhookEventObject string

The object of the event. Always `event`.

const (
	FineTuningJobCancelledWebhookEventObjectEvent FineTuningJobCancelledWebhookEventObject = "event"
)

type FineTuningJobFailedWebhookEvent

type FineTuningJobFailedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the fine-tuning job failed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data FineTuningJobFailedWebhookEventData `json:"data,required"`
	// The type of the event. Always `fine_tuning.job.failed`.
	Type constant.FineTuningJobFailed `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object FineTuningJobFailedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a fine-tuning job has failed.

func (FineTuningJobFailedWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobFailedWebhookEvent) UnmarshalJSON

func (r *FineTuningJobFailedWebhookEvent) UnmarshalJSON(data []byte) error

type FineTuningJobFailedWebhookEventData

type FineTuningJobFailedWebhookEventData struct {
	// The unique ID of the fine-tuning job.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (FineTuningJobFailedWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobFailedWebhookEventData) UnmarshalJSON

func (r *FineTuningJobFailedWebhookEventData) UnmarshalJSON(data []byte) error

type FineTuningJobFailedWebhookEventObject

type FineTuningJobFailedWebhookEventObject string

The object of the event. Always `event`.

const (
	FineTuningJobFailedWebhookEventObjectEvent FineTuningJobFailedWebhookEventObject = "event"
)

type FineTuningJobSucceededWebhookEvent

type FineTuningJobSucceededWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the fine-tuning job succeeded.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data FineTuningJobSucceededWebhookEventData `json:"data,required"`
	// The type of the event. Always `fine_tuning.job.succeeded`.
	Type constant.FineTuningJobSucceeded `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object FineTuningJobSucceededWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a fine-tuning job has succeeded.

func (FineTuningJobSucceededWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobSucceededWebhookEvent) UnmarshalJSON

func (r *FineTuningJobSucceededWebhookEvent) UnmarshalJSON(data []byte) error

type FineTuningJobSucceededWebhookEventData

type FineTuningJobSucceededWebhookEventData struct {
	// The unique ID of the fine-tuning job.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (FineTuningJobSucceededWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningJobSucceededWebhookEventData) UnmarshalJSON

func (r *FineTuningJobSucceededWebhookEventData) UnmarshalJSON(data []byte) error

type FineTuningJobSucceededWebhookEventObject

type FineTuningJobSucceededWebhookEventObject string

The object of the event. Always `event`.

const (
	FineTuningJobSucceededWebhookEventObjectEvent FineTuningJobSucceededWebhookEventObject = "event"
)

type FunctionDefinition

type FunctionDefinition = shared.FunctionDefinition

This is an alias to an internal type.

type FunctionDefinitionParam

type FunctionDefinitionParam = shared.FunctionDefinitionParam

This is an alias to an internal type.

type FunctionParameters

type FunctionParameters = shared.FunctionParameters

The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

Omitting `parameters` defines a function with an empty parameter list.

This is an alias to an internal type.

type Metadata

type Metadata = shared.Metadata

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

This is an alias to an internal type.

type Reasoning

type Reasoning = shared.Reasoning

**o-series models only**

Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

This is an alias to an internal type.

type ReasoningEffort

type ReasoningEffort = shared.ReasoningEffort

**o-series models only**

Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

This is an alias to an internal type.

type ReasoningGenerateSummary

type ReasoningGenerateSummary = shared.ReasoningGenerateSummary

**Deprecated:** use `summary` instead.

A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.

This is an alias to an internal type.

type ReasoningParam

type ReasoningParam = shared.ReasoningParam

**o-series models only**

Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

This is an alias to an internal type.

type ReasoningSummary

type ReasoningSummary = shared.ReasoningSummary

A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.

This is an alias to an internal type.

type ResponseCancelledWebhookEvent

type ResponseCancelledWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the model response was cancelled.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data ResponseCancelledWebhookEventData `json:"data,required"`
	// The type of the event. Always `response.cancelled`.
	Type constant.ResponseCancelled `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object ResponseCancelledWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a background response has been cancelled.

func (ResponseCancelledWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseCancelledWebhookEvent) UnmarshalJSON

func (r *ResponseCancelledWebhookEvent) UnmarshalJSON(data []byte) error

type ResponseCancelledWebhookEventData

type ResponseCancelledWebhookEventData struct {
	// The unique ID of the model response.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (ResponseCancelledWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseCancelledWebhookEventData) UnmarshalJSON

func (r *ResponseCancelledWebhookEventData) UnmarshalJSON(data []byte) error

type ResponseCancelledWebhookEventObject

type ResponseCancelledWebhookEventObject string

The object of the event. Always `event`.

const (
	ResponseCancelledWebhookEventObjectEvent ResponseCancelledWebhookEventObject = "event"
)

type ResponseCompletedWebhookEvent

type ResponseCompletedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the model response was completed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data ResponseCompletedWebhookEventData `json:"data,required"`
	// The type of the event. Always `response.completed`.
	Type constant.ResponseCompleted `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object ResponseCompletedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a background response has been completed.

func (ResponseCompletedWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseCompletedWebhookEvent) UnmarshalJSON

func (r *ResponseCompletedWebhookEvent) UnmarshalJSON(data []byte) error

type ResponseCompletedWebhookEventData

type ResponseCompletedWebhookEventData struct {
	// The unique ID of the model response.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (ResponseCompletedWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseCompletedWebhookEventData) UnmarshalJSON

func (r *ResponseCompletedWebhookEventData) UnmarshalJSON(data []byte) error

type ResponseCompletedWebhookEventObject

type ResponseCompletedWebhookEventObject string

The object of the event. Always `event`.

const (
	ResponseCompletedWebhookEventObjectEvent ResponseCompletedWebhookEventObject = "event"
)

type ResponseFailedWebhookEvent

type ResponseFailedWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the model response failed.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data ResponseFailedWebhookEventData `json:"data,required"`
	// The type of the event. Always `response.failed`.
	Type constant.ResponseFailed `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object ResponseFailedWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a background response has failed.

func (ResponseFailedWebhookEvent) RawJSON

func (r ResponseFailedWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResponseFailedWebhookEvent) UnmarshalJSON

func (r *ResponseFailedWebhookEvent) UnmarshalJSON(data []byte) error

type ResponseFailedWebhookEventData

type ResponseFailedWebhookEventData struct {
	// The unique ID of the model response.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (ResponseFailedWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseFailedWebhookEventData) UnmarshalJSON

func (r *ResponseFailedWebhookEventData) UnmarshalJSON(data []byte) error

type ResponseFailedWebhookEventObject

type ResponseFailedWebhookEventObject string

The object of the event. Always `event`.

const (
	ResponseFailedWebhookEventObjectEvent ResponseFailedWebhookEventObject = "event"
)

type ResponseFormatJSONObject

type ResponseFormatJSONObject = shared.ResponseFormatJSONObject

JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

This is an alias to an internal type.

type ResponseFormatJSONObjectParam

type ResponseFormatJSONObjectParam = shared.ResponseFormatJSONObjectParam

JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

This is an alias to an internal type.

type ResponseFormatJSONSchema

type ResponseFormatJSONSchema = shared.ResponseFormatJSONSchema

JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

This is an alias to an internal type.

type ResponseFormatJSONSchemaJSONSchema

type ResponseFormatJSONSchemaJSONSchema = shared.ResponseFormatJSONSchemaJSONSchema

Structured Outputs configuration options, including a JSON Schema.

This is an alias to an internal type.

type ResponseFormatJSONSchemaJSONSchemaParam

type ResponseFormatJSONSchemaJSONSchemaParam = shared.ResponseFormatJSONSchemaJSONSchemaParam

Structured Outputs configuration options, including a JSON Schema.

This is an alias to an internal type.

type ResponseFormatJSONSchemaParam

type ResponseFormatJSONSchemaParam = shared.ResponseFormatJSONSchemaParam

JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

This is an alias to an internal type.

type ResponseFormatText

type ResponseFormatText = shared.ResponseFormatText

Default response format. Used to generate text responses.

This is an alias to an internal type.

type ResponseFormatTextParam

type ResponseFormatTextParam = shared.ResponseFormatTextParam

Default response format. Used to generate text responses.

This is an alias to an internal type.

type ResponseIncompleteWebhookEvent

type ResponseIncompleteWebhookEvent struct {
	// The unique ID of the event.
	ID string `json:"id,required"`
	// The Unix timestamp (in seconds) of when the model response was interrupted.
	CreatedAt int64 `json:"created_at,required"`
	// Event data payload.
	Data ResponseIncompleteWebhookEventData `json:"data,required"`
	// The type of the event. Always `response.incomplete`.
	Type constant.ResponseIncomplete `json:"type,required"`
	// The object of the event. Always `event`.
	//
	// Any of "event".
	Object ResponseIncompleteWebhookEventObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sent when a background response has been interrupted.

func (ResponseIncompleteWebhookEvent) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseIncompleteWebhookEvent) UnmarshalJSON

func (r *ResponseIncompleteWebhookEvent) UnmarshalJSON(data []byte) error

type ResponseIncompleteWebhookEventData

type ResponseIncompleteWebhookEventData struct {
	// The unique ID of the model response.
	ID string `json:"id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event data payload.

func (ResponseIncompleteWebhookEventData) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseIncompleteWebhookEventData) UnmarshalJSON

func (r *ResponseIncompleteWebhookEventData) UnmarshalJSON(data []byte) error

type ResponseIncompleteWebhookEventObject

type ResponseIncompleteWebhookEventObject string

The object of the event. Always `event`.

const (
	ResponseIncompleteWebhookEventObjectEvent ResponseIncompleteWebhookEventObject = "event"
)

type ResponsesModel

type ResponsesModel = shared.ResponsesModel

This is an alias to an internal type.

type UnwrapWebhookEventUnion

type UnwrapWebhookEventUnion struct {
	ID        string `json:"id"`
	CreatedAt int64  `json:"created_at"`
	// This field is a union of [BatchCancelledWebhookEventData],
	// [BatchCompletedWebhookEventData], [BatchExpiredWebhookEventData],
	// [BatchFailedWebhookEventData], [EvalRunCanceledWebhookEventData],
	// [EvalRunFailedWebhookEventData], [EvalRunSucceededWebhookEventData],
	// [FineTuningJobCancelledWebhookEventData], [FineTuningJobFailedWebhookEventData],
	// [FineTuningJobSucceededWebhookEventData], [ResponseCancelledWebhookEventData],
	// [ResponseCompletedWebhookEventData], [ResponseFailedWebhookEventData],
	// [ResponseIncompleteWebhookEventData]
	Data UnwrapWebhookEventUnionData `json:"data"`
	// Any of "batch.cancelled", "batch.completed", "batch.expired", "batch.failed",
	// "eval.run.canceled", "eval.run.failed", "eval.run.succeeded",
	// "fine_tuning.job.cancelled", "fine_tuning.job.failed",
	// "fine_tuning.job.succeeded", "response.cancelled", "response.completed",
	// "response.failed", "response.incomplete".
	Type   string `json:"type"`
	Object string `json:"object"`
	JSON   struct {
		ID        respjson.Field
		CreatedAt respjson.Field
		Data      respjson.Field
		Type      respjson.Field
		Object    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UnwrapWebhookEventUnion contains all possible properties and values from BatchCancelledWebhookEvent, BatchCompletedWebhookEvent, BatchExpiredWebhookEvent, BatchFailedWebhookEvent, EvalRunCanceledWebhookEvent, EvalRunFailedWebhookEvent, EvalRunSucceededWebhookEvent, FineTuningJobCancelledWebhookEvent, FineTuningJobFailedWebhookEvent, FineTuningJobSucceededWebhookEvent, ResponseCancelledWebhookEvent, ResponseCompletedWebhookEvent, ResponseFailedWebhookEvent, ResponseIncompleteWebhookEvent.

Use the UnwrapWebhookEventUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (UnwrapWebhookEventUnion) AsAny

func (u UnwrapWebhookEventUnion) AsAny() anyUnwrapWebhookEvent

Use the following switch statement to find the correct variant

switch variant := UnwrapWebhookEventUnion.AsAny().(type) {
case webhooks.BatchCancelledWebhookEvent:
case webhooks.BatchCompletedWebhookEvent:
case webhooks.BatchExpiredWebhookEvent:
case webhooks.BatchFailedWebhookEvent:
case webhooks.EvalRunCanceledWebhookEvent:
case webhooks.EvalRunFailedWebhookEvent:
case webhooks.EvalRunSucceededWebhookEvent:
case webhooks.FineTuningJobCancelledWebhookEvent:
case webhooks.FineTuningJobFailedWebhookEvent:
case webhooks.FineTuningJobSucceededWebhookEvent:
case webhooks.ResponseCancelledWebhookEvent:
case webhooks.ResponseCompletedWebhookEvent:
case webhooks.ResponseFailedWebhookEvent:
case webhooks.ResponseIncompleteWebhookEvent:
default:
  fmt.Errorf("no variant present")
}

func (UnwrapWebhookEventUnion) AsBatchCancelled

func (u UnwrapWebhookEventUnion) AsBatchCancelled() (v BatchCancelledWebhookEvent)

func (UnwrapWebhookEventUnion) AsBatchCompleted

func (u UnwrapWebhookEventUnion) AsBatchCompleted() (v BatchCompletedWebhookEvent)

func (UnwrapWebhookEventUnion) AsBatchExpired

func (u UnwrapWebhookEventUnion) AsBatchExpired() (v BatchExpiredWebhookEvent)

func (UnwrapWebhookEventUnion) AsBatchFailed

func (u UnwrapWebhookEventUnion) AsBatchFailed() (v BatchFailedWebhookEvent)

func (UnwrapWebhookEventUnion) AsEvalRunCanceled

func (u UnwrapWebhookEventUnion) AsEvalRunCanceled() (v EvalRunCanceledWebhookEvent)

func (UnwrapWebhookEventUnion) AsEvalRunFailed

func (u UnwrapWebhookEventUnion) AsEvalRunFailed() (v EvalRunFailedWebhookEvent)

func (UnwrapWebhookEventUnion) AsEvalRunSucceeded

func (u UnwrapWebhookEventUnion) AsEvalRunSucceeded() (v EvalRunSucceededWebhookEvent)

func (UnwrapWebhookEventUnion) AsFineTuningJobCancelled

func (u UnwrapWebhookEventUnion) AsFineTuningJobCancelled() (v FineTuningJobCancelledWebhookEvent)

func (UnwrapWebhookEventUnion) AsFineTuningJobFailed

func (u UnwrapWebhookEventUnion) AsFineTuningJobFailed() (v FineTuningJobFailedWebhookEvent)

func (UnwrapWebhookEventUnion) AsFineTuningJobSucceeded

func (u UnwrapWebhookEventUnion) AsFineTuningJobSucceeded() (v FineTuningJobSucceededWebhookEvent)

func (UnwrapWebhookEventUnion) AsResponseCancelled

func (u UnwrapWebhookEventUnion) AsResponseCancelled() (v ResponseCancelledWebhookEvent)

func (UnwrapWebhookEventUnion) AsResponseCompleted

func (u UnwrapWebhookEventUnion) AsResponseCompleted() (v ResponseCompletedWebhookEvent)

func (UnwrapWebhookEventUnion) AsResponseFailed

func (u UnwrapWebhookEventUnion) AsResponseFailed() (v ResponseFailedWebhookEvent)

func (UnwrapWebhookEventUnion) AsResponseIncomplete

func (u UnwrapWebhookEventUnion) AsResponseIncomplete() (v ResponseIncompleteWebhookEvent)

func (UnwrapWebhookEventUnion) RawJSON

func (u UnwrapWebhookEventUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventUnion) UnmarshalJSON

func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error

type UnwrapWebhookEventUnionData

type UnwrapWebhookEventUnionData struct {
	ID   string `json:"id"`
	JSON struct {
		ID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UnwrapWebhookEventUnionData is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.

func (*UnwrapWebhookEventUnionData) UnmarshalJSON

func (r *UnwrapWebhookEventUnionData) UnmarshalJSON(data []byte) error

type WebhookService

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the openai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.

func NewWebhookService

func NewWebhookService(opts ...option.RequestOption) (r WebhookService)

NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WebhookService) Unwrap

func (r *WebhookService) Unwrap(body []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)

Validates that the given payload was sent by OpenAI and parses the payload.

func (*WebhookService) UnwrapWithTolerance

func (r *WebhookService) UnwrapWithTolerance(body []byte, headers http.Header, tolerance time.Duration, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)

UnwrapWithTolerance validates that the given payload was sent by OpenAI using custom tolerance, then parses the payload. tolerance specifies the maximum age of the webhook.

func (*WebhookService) UnwrapWithToleranceAndTime

func (r *WebhookService) UnwrapWithToleranceAndTime(body []byte, headers http.Header, tolerance time.Duration, now time.Time, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)

UnwrapWithToleranceAndTime validates that the given payload was sent by OpenAI using custom tolerance and time, then parses the payload. tolerance specifies the maximum age of the webhook. now allows specifying the current time for testing purposes.

func (*WebhookService) VerifySignature

func (r *WebhookService) VerifySignature(body []byte, headers http.Header, opts ...option.RequestOption) error

VerifySignature validates whether or not the webhook payload was sent by OpenAI. An error will be raised if the webhook signature is invalid. tolerance specifies the maximum age of the webhook (default: 5 minutes).

func (*WebhookService) VerifySignatureWithTolerance

func (r *WebhookService) VerifySignatureWithTolerance(body []byte, headers http.Header, tolerance time.Duration, opts ...option.RequestOption) error

VerifySignatureWithTolerance validates whether or not the webhook payload was sent by OpenAI. An error will be raised if the webhook signature is invalid. tolerance specifies the maximum age of the webhook.

func (*WebhookService) VerifySignatureWithToleranceAndTime

func (r *WebhookService) VerifySignatureWithToleranceAndTime(body []byte, headers http.Header, tolerance time.Duration, now time.Time, opts ...option.RequestOption) error

VerifySignatureWithToleranceAndTime validates whether or not the webhook payload was sent by OpenAI. An error will be raised if the webhook signature is invalid. tolerance specifies the maximum age of the webhook. now allows specifying the current time for testing purposes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL