realtime

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 12 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 ChatModelGPT5 = shared.ChatModelGPT5

Equals "gpt-5"

View Source
const ChatModelGPT5ChatLatest = shared.ChatModelGPT5ChatLatest

Equals "gpt-5-chat-latest"

View Source
const ChatModelGPT5Mini = shared.ChatModelGPT5Mini

Equals "gpt-5-mini"

View Source
const ChatModelGPT5Mini2025_08_07 = shared.ChatModelGPT5Mini2025_08_07

Equals "gpt-5-mini-2025-08-07"

View Source
const ChatModelGPT5Nano = shared.ChatModelGPT5Nano

Equals "gpt-5-nano"

View Source
const ChatModelGPT5Nano2025_08_07 = shared.ChatModelGPT5Nano2025_08_07

Equals "gpt-5-nano-2025-08-07"

View Source
const ChatModelGPT5_2025_08_07 = shared.ChatModelGPT5_2025_08_07

Equals "gpt-5-2025-08-07"

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 ReasoningEffortMinimal = shared.ReasoningEffortMinimal

Equals "minimal"

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 ChatModel

type ChatModel = shared.ChatModel

This is an alias to an internal type.

type ClientSecretNewParams

type ClientSecretNewParams struct {
	// Configuration for the ephemeral token expiration.
	ExpiresAfter ClientSecretNewParamsExpiresAfter `json:"expires_after,omitzero"`
	// Session configuration to use for the client secret. Choose either a realtime
	// session or a transcription session.
	Session ClientSecretNewParamsSessionUnion `json:"session,omitzero"`
	// contains filtered or unexported fields
}

func (ClientSecretNewParams) MarshalJSON

func (r ClientSecretNewParams) MarshalJSON() (data []byte, err error)

func (*ClientSecretNewParams) UnmarshalJSON

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

type ClientSecretNewParamsExpiresAfter

type ClientSecretNewParamsExpiresAfter struct {
	// The number of seconds from the anchor point to the expiration. Select a value
	// between `10` and `7200`.
	Seconds param.Opt[int64] `json:"seconds,omitzero"`
	// The anchor point for the ephemeral token expiration. Only `created_at` is
	// currently supported.
	//
	// Any of "created_at".
	Anchor string `json:"anchor,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the ephemeral token expiration.

func (ClientSecretNewParamsExpiresAfter) MarshalJSON

func (r ClientSecretNewParamsExpiresAfter) MarshalJSON() (data []byte, err error)

func (*ClientSecretNewParamsExpiresAfter) UnmarshalJSON

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

type ClientSecretNewParamsSessionUnion

type ClientSecretNewParamsSessionUnion struct {
	OfRealtime      *RealtimeSessionCreateRequestParam              `json:",omitzero,inline"`
	OfTranscription *RealtimeTranscriptionSessionCreateRequestParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ClientSecretNewParamsSessionUnion) GetAudio

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetClientSecret

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetInclude

func (u ClientSecretNewParamsSessionUnion) GetInclude() []string

Returns a pointer to the underlying variant's Include property, if present.

func (ClientSecretNewParamsSessionUnion) GetInputAudioFormat

func (u ClientSecretNewParamsSessionUnion) GetInputAudioFormat() *string

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetInputAudioNoiseReduction

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetInputAudioTranscription

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetInstructions

func (u ClientSecretNewParamsSessionUnion) GetInstructions() *string

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetMaxOutputTokens

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetModel

func (u ClientSecretNewParamsSessionUnion) GetModel() (res clientSecretNewParamsSessionUnionModel)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ClientSecretNewParamsSessionUnion) GetOutputModalities

func (u ClientSecretNewParamsSessionUnion) GetOutputModalities() []string

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetPrompt

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetTemperature

func (u ClientSecretNewParamsSessionUnion) GetTemperature() *float64

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetToolChoice

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetTools

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetTracing

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetTruncation

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetTurnDetection

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ClientSecretNewParamsSessionUnion) MarshalJSON

func (u ClientSecretNewParamsSessionUnion) MarshalJSON() ([]byte, error)

func (*ClientSecretNewParamsSessionUnion) UnmarshalJSON

func (u *ClientSecretNewParamsSessionUnion) UnmarshalJSON(data []byte) error

type ClientSecretNewResponse

type ClientSecretNewResponse struct {
	// Expiration timestamp for the client secret, in seconds since epoch.
	ExpiresAt int64 `json:"expires_at,required"`
	// The session configuration for either a realtime or transcription session.
	Session ClientSecretNewResponseSessionUnion `json:"session,required"`
	// The generated client secret value.
	Value string `json:"value,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Session     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response from creating a session and client secret for the Realtime API.

func (ClientSecretNewResponse) RawJSON

func (r ClientSecretNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponse) UnmarshalJSON

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

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObject

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObject struct {
	// Unique identifier for the session that looks like `sess_1234567890abcdef`.
	ID string `json:"id"`
	// Configuration for input audio for the session.
	Audio ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio `json:"audio"`
	// Expiration timestamp for the session, in seconds since epoch.
	ExpiresAt int64 `json:"expires_at"`
	// Additional fields to include in server outputs.
	//
	//   - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
	//     transcription.
	//
	// Any of "item.input_audio_transcription.logprobs".
	Include []string `json:"include"`
	// The object type. Always `realtime.transcription_session`.
	Object string `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Audio       respjson.Field
		ExpiresAt   respjson.Field
		Include     respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Realtime transcription session configuration object.

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObject) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObject) UnmarshalJSON

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio struct {
	Input ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput `json:"input"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Input       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for input audio for the session.

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio) UnmarshalJSON

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput struct {
	// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
	Format string `json:"format"`
	// Configuration for input audio noise reduction.
	NoiseReduction ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction `json:"noise_reduction"`
	// Configuration of the transcription model.
	Transcription ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription `json:"transcription"`
	// Configuration for turn detection.
	TurnDetection ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection `json:"turn_detection"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format         respjson.Field
		NoiseReduction respjson.Field
		Transcription  respjson.Field
		TurnDetection  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput) UnmarshalJSON

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction struct {
	// Any of "near_field", "far_field".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for input audio noise reduction.

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction) UnmarshalJSON

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription struct {
	// The language of the input audio. Supplying the input language in
	// [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
	// format will improve accuracy and latency.
	Language string `json:"language"`
	// The model to use for transcription. Can be `gpt-4o-transcribe`,
	// `gpt-4o-mini-transcribe`, or `whisper-1`.
	//
	// Any of "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1".
	Model string `json:"model"`
	// An optional text to guide the model's style or continue a previous audio
	// segment. The
	// [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
	// should match the audio language.
	Prompt string `json:"prompt"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Language    respjson.Field
		Model       respjson.Field
		Prompt      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration of the transcription model.

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription) UnmarshalJSON

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection

type ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection struct {
	PrefixPaddingMs   int64   `json:"prefix_padding_ms"`
	SilenceDurationMs int64   `json:"silence_duration_ms"`
	Threshold         float64 `json:"threshold"`
	// Type of turn detection, only `server_vad` is currently supported.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PrefixPaddingMs   respjson.Field
		SilenceDurationMs respjson.Field
		Threshold         respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for turn detection.

func (ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection) UnmarshalJSON

type ClientSecretNewResponseSessionUnion

type ClientSecretNewResponseSessionUnion struct {
	ID string `json:"id"`
	// This field is a union of [RealtimeSessionCreateResponseAudio],
	// [ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudio]
	Audio     ClientSecretNewResponseSessionUnionAudio `json:"audio"`
	ExpiresAt int64                                    `json:"expires_at"`
	Include   []string                                 `json:"include"`
	// This field is from variant [RealtimeSessionCreateResponse].
	Instructions string `json:"instructions"`
	// This field is from variant [RealtimeSessionCreateResponse].
	MaxOutputTokens RealtimeSessionCreateResponseMaxOutputTokensUnion `json:"max_output_tokens"`
	// This field is from variant [RealtimeSessionCreateResponse].
	Model  string `json:"model"`
	Object string `json:"object"`
	// This field is from variant [RealtimeSessionCreateResponse].
	OutputModalities []string `json:"output_modalities"`
	// This field is from variant [RealtimeSessionCreateResponse].
	ToolChoice string `json:"tool_choice"`
	// This field is from variant [RealtimeSessionCreateResponse].
	Tools []RealtimeSessionCreateResponseTool `json:"tools"`
	// This field is from variant [RealtimeSessionCreateResponse].
	Tracing RealtimeSessionCreateResponseTracingUnion `json:"tracing"`
	// This field is from variant [RealtimeSessionCreateResponse].
	TurnDetection RealtimeSessionCreateResponseTurnDetection `json:"turn_detection"`
	JSON          struct {
		ID               respjson.Field
		Audio            respjson.Field
		ExpiresAt        respjson.Field
		Include          respjson.Field
		Instructions     respjson.Field
		MaxOutputTokens  respjson.Field
		Model            respjson.Field
		Object           respjson.Field
		OutputModalities respjson.Field
		ToolChoice       respjson.Field
		Tools            respjson.Field
		Tracing          respjson.Field
		TurnDetection    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ClientSecretNewResponseSessionUnion contains all possible properties and values from RealtimeSessionCreateResponse, ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObject.

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

func (ClientSecretNewResponseSessionUnion) AsRealtimeSessionConfigurationObject

func (u ClientSecretNewResponseSessionUnion) AsRealtimeSessionConfigurationObject() (v RealtimeSessionCreateResponse)

func (ClientSecretNewResponseSessionUnion) AsRealtimeTranscriptionSessionConfigurationObject

func (ClientSecretNewResponseSessionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ClientSecretNewResponseSessionUnion) UnmarshalJSON

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

type ClientSecretNewResponseSessionUnionAudio

type ClientSecretNewResponseSessionUnionAudio struct {
	// This field is a union of [RealtimeSessionCreateResponseAudioInput],
	// [ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInput]
	Input ClientSecretNewResponseSessionUnionAudioInput `json:"input"`
	// This field is from variant [RealtimeSessionCreateResponseAudio].
	Output RealtimeSessionCreateResponseAudioOutput `json:"output"`
	JSON   struct {
		Input  respjson.Field
		Output respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ClientSecretNewResponseSessionUnionAudio is an implicit subunion of ClientSecretNewResponseSessionUnion. ClientSecretNewResponseSessionUnionAudio provides convenient access to the sub-properties of the union.

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

func (*ClientSecretNewResponseSessionUnionAudio) UnmarshalJSON

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

type ClientSecretNewResponseSessionUnionAudioInput

type ClientSecretNewResponseSessionUnionAudioInput struct {
	Format string `json:"format"`
	// This field is a union of
	// [RealtimeSessionCreateResponseAudioInputNoiseReduction],
	// [ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputNoiseReduction]
	NoiseReduction ClientSecretNewResponseSessionUnionAudioInputNoiseReduction `json:"noise_reduction"`
	// This field is a union of [RealtimeSessionCreateResponseAudioInputTranscription],
	// [ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTranscription]
	Transcription ClientSecretNewResponseSessionUnionAudioInputTranscription `json:"transcription"`
	// This field is a union of [RealtimeSessionCreateResponseAudioInputTurnDetection],
	// [ClientSecretNewResponseSessionRealtimeTranscriptionSessionConfigurationObjectAudioInputTurnDetection]
	TurnDetection ClientSecretNewResponseSessionUnionAudioInputTurnDetection `json:"turn_detection"`
	JSON          struct {
		Format         respjson.Field
		NoiseReduction respjson.Field
		Transcription  respjson.Field
		TurnDetection  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ClientSecretNewResponseSessionUnionAudioInput is an implicit subunion of ClientSecretNewResponseSessionUnion. ClientSecretNewResponseSessionUnionAudioInput provides convenient access to the sub-properties of the union.

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

func (*ClientSecretNewResponseSessionUnionAudioInput) UnmarshalJSON

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

type ClientSecretNewResponseSessionUnionAudioInputNoiseReduction

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

ClientSecretNewResponseSessionUnionAudioInputNoiseReduction is an implicit subunion of ClientSecretNewResponseSessionUnion. ClientSecretNewResponseSessionUnionAudioInputNoiseReduction provides convenient access to the sub-properties of the union.

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

func (*ClientSecretNewResponseSessionUnionAudioInputNoiseReduction) UnmarshalJSON

type ClientSecretNewResponseSessionUnionAudioInputTranscription

type ClientSecretNewResponseSessionUnionAudioInputTranscription struct {
	Language string `json:"language"`
	Model    string `json:"model"`
	Prompt   string `json:"prompt"`
	JSON     struct {
		Language respjson.Field
		Model    respjson.Field
		Prompt   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ClientSecretNewResponseSessionUnionAudioInputTranscription is an implicit subunion of ClientSecretNewResponseSessionUnion. ClientSecretNewResponseSessionUnionAudioInputTranscription provides convenient access to the sub-properties of the union.

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

func (*ClientSecretNewResponseSessionUnionAudioInputTranscription) UnmarshalJSON

type ClientSecretNewResponseSessionUnionAudioInputTurnDetection

type ClientSecretNewResponseSessionUnionAudioInputTurnDetection struct {
	PrefixPaddingMs   int64   `json:"prefix_padding_ms"`
	SilenceDurationMs int64   `json:"silence_duration_ms"`
	Threshold         float64 `json:"threshold"`
	Type              string  `json:"type"`
	JSON              struct {
		PrefixPaddingMs   respjson.Field
		SilenceDurationMs respjson.Field
		Threshold         respjson.Field
		Type              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ClientSecretNewResponseSessionUnionAudioInputTurnDetection is an implicit subunion of ClientSecretNewResponseSessionUnion. ClientSecretNewResponseSessionUnionAudioInputTurnDetection provides convenient access to the sub-properties of the union.

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

func (*ClientSecretNewResponseSessionUnionAudioInputTurnDetection) UnmarshalJSON

type ClientSecretService

type ClientSecretService struct {
	Options []option.RequestOption
}

ClientSecretService 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 NewClientSecretService method instead.

func NewClientSecretService

func NewClientSecretService(opts ...option.RequestOption) (r ClientSecretService)

NewClientSecretService 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 (*ClientSecretService) New

Create a Realtime session and client secret for either realtime or transcription.

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 CustomToolInputFormatGrammar

type CustomToolInputFormatGrammar = shared.CustomToolInputFormatGrammar

A grammar defined by the user.

This is an alias to an internal type.

type CustomToolInputFormatGrammarParam

type CustomToolInputFormatGrammarParam = shared.CustomToolInputFormatGrammarParam

A grammar defined by the user.

This is an alias to an internal type.

type CustomToolInputFormatText

type CustomToolInputFormatText = shared.CustomToolInputFormatText

Unconstrained free-form text.

This is an alias to an internal type.

type CustomToolInputFormatTextParam

type CustomToolInputFormatTextParam = shared.CustomToolInputFormatTextParam

Unconstrained free-form text.

This is an alias to an internal type.

type CustomToolInputFormatUnion

type CustomToolInputFormatUnion = shared.CustomToolInputFormatUnion

The input format for the custom tool. Default is unconstrained text.

This is an alias to an internal type.

type CustomToolInputFormatUnionParam

type CustomToolInputFormatUnionParam = shared.CustomToolInputFormatUnionParam

The input format for the custom tool. Default is unconstrained text.

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 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 RealtimeAudioConfigInputNoiseReductionParam

type RealtimeAudioConfigInputNoiseReductionParam struct {
	// Type of noise reduction. `near_field` is for close-talking microphones such as
	// headphones, `far_field` is for far-field microphones such as laptop or
	// conference room microphones.
	//
	// Any of "near_field", "far_field".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configuration for input audio noise reduction. This can be set to `null` to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.

func (RealtimeAudioConfigInputNoiseReductionParam) MarshalJSON

func (r RealtimeAudioConfigInputNoiseReductionParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigInputNoiseReductionParam) UnmarshalJSON

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

type RealtimeAudioConfigInputParam

type RealtimeAudioConfigInputParam struct {
	// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
	// `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
	// (mono), and little-endian byte order.
	//
	// Any of "pcm16", "g711_ulaw", "g711_alaw".
	Format string `json:"format,omitzero"`
	// Configuration for input audio noise reduction. This can be set to `null` to turn
	// off. Noise reduction filters audio added to the input audio buffer before it is
	// sent to VAD and the model. Filtering the audio can improve VAD and turn
	// detection accuracy (reducing false positives) and model performance by improving
	// perception of the input audio.
	NoiseReduction RealtimeAudioConfigInputNoiseReductionParam `json:"noise_reduction,omitzero"`
	// Configuration for input audio transcription, defaults to off and can be set to
	// `null` to turn off once on. Input audio transcription is not native to the
	// model, since the model consumes audio directly. Transcription runs
	// asynchronously through
	// [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
	// and should be treated as guidance of input audio content rather than precisely
	// what the model heard. The client can optionally set the language and prompt for
	// transcription, these offer additional guidance to the transcription service.
	Transcription RealtimeAudioConfigInputTranscriptionParam `json:"transcription,omitzero"`
	// Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
	// set to `null` to turn off, in which case the client must manually trigger model
	// response. Server VAD means that the model will detect the start and end of
	// speech based on audio volume and respond at the end of user speech. Semantic VAD
	// is more advanced and uses a turn detection model (in conjunction with VAD) to
	// semantically estimate whether the user has finished speaking, then dynamically
	// sets a timeout based on this probability. For example, if user audio trails off
	// with "uhhm", the model will score a low probability of turn end and wait longer
	// for the user to continue speaking. This can be useful for more natural
	// conversations, but may have a higher latency.
	TurnDetection RealtimeAudioConfigInputTurnDetectionParam `json:"turn_detection,omitzero"`
	// contains filtered or unexported fields
}

func (RealtimeAudioConfigInputParam) MarshalJSON

func (r RealtimeAudioConfigInputParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigInputParam) UnmarshalJSON

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

type RealtimeAudioConfigInputTranscriptionParam

type RealtimeAudioConfigInputTranscriptionParam struct {
	// The language of the input audio. Supplying the input language in
	// [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
	// format will improve accuracy and latency.
	Language param.Opt[string] `json:"language,omitzero"`
	// An optional text to guide the model's style or continue a previous audio
	// segment. For `whisper-1`, the
	// [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
	// For `gpt-4o-transcribe` models, the prompt is a free text string, for example
	// "expect words related to technology".
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// The model to use for transcription. Current options are `whisper-1`,
	// `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and
	// `gpt-4o-transcribe-diarize`.
	//
	// Any of "whisper-1", "gpt-4o-transcribe-latest", "gpt-4o-mini-transcribe",
	// "gpt-4o-transcribe", "gpt-4o-transcribe-diarize".
	Model string `json:"model,omitzero"`
	// contains filtered or unexported fields
}

Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.

func (RealtimeAudioConfigInputTranscriptionParam) MarshalJSON

func (r RealtimeAudioConfigInputTranscriptionParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigInputTranscriptionParam) UnmarshalJSON

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

type RealtimeAudioConfigInputTurnDetectionParam

type RealtimeAudioConfigInputTurnDetectionParam struct {
	// Optional idle timeout after which turn detection will auto-timeout when no
	// additional audio is received.
	IdleTimeoutMs param.Opt[int64] `json:"idle_timeout_ms,omitzero"`
	// Whether or not to automatically generate a response when a VAD stop event
	// occurs.
	CreateResponse param.Opt[bool] `json:"create_response,omitzero"`
	// Whether or not to automatically interrupt any ongoing response with output to
	// the default conversation (i.e. `conversation` of `auto`) when a VAD start event
	// occurs.
	InterruptResponse param.Opt[bool] `json:"interrupt_response,omitzero"`
	// Used only for `server_vad` mode. Amount of audio to include before the VAD
	// detected speech (in milliseconds). Defaults to 300ms.
	PrefixPaddingMs param.Opt[int64] `json:"prefix_padding_ms,omitzero"`
	// Used only for `server_vad` mode. Duration of silence to detect speech stop (in
	// milliseconds). Defaults to 500ms. With shorter values the model will respond
	// more quickly, but may jump in on short pauses from the user.
	SilenceDurationMs param.Opt[int64] `json:"silence_duration_ms,omitzero"`
	// Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
	// defaults to 0.5. A higher threshold will require louder audio to activate the
	// model, and thus might perform better in noisy environments.
	Threshold param.Opt[float64] `json:"threshold,omitzero"`
	// Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
	// will wait longer for the user to continue speaking, `high` will respond more
	// quickly. `auto` is the default and is equivalent to `medium`.
	//
	// Any of "low", "medium", "high", "auto".
	Eagerness string `json:"eagerness,omitzero"`
	// Type of turn detection.
	//
	// Any of "server_vad", "semantic_vad".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency.

func (RealtimeAudioConfigInputTurnDetectionParam) MarshalJSON

func (r RealtimeAudioConfigInputTurnDetectionParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigInputTurnDetectionParam) UnmarshalJSON

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

type RealtimeAudioConfigOutputParam

type RealtimeAudioConfigOutputParam struct {
	// The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
	// minimum speed. 1.5 is the maximum speed. This value can only be changed in
	// between model turns, not while a response is in progress.
	Speed param.Opt[float64] `json:"speed,omitzero"`
	// The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
	// For `pcm16`, output audio is sampled at a rate of 24kHz.
	//
	// Any of "pcm16", "g711_ulaw", "g711_alaw".
	Format string `json:"format,omitzero"`
	// The voice the model uses to respond. Voice cannot be changed during the session
	// once the model has responded with audio at least once. Current voice options are
	// `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
	// and `cedar`.
	Voice string `json:"voice,omitzero"`
	// contains filtered or unexported fields
}

func (RealtimeAudioConfigOutputParam) MarshalJSON

func (r RealtimeAudioConfigOutputParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigOutputParam) UnmarshalJSON

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

type RealtimeAudioConfigParam

type RealtimeAudioConfigParam struct {
	Input  RealtimeAudioConfigInputParam  `json:"input,omitzero"`
	Output RealtimeAudioConfigOutputParam `json:"output,omitzero"`
	// contains filtered or unexported fields
}

Configuration for input and output audio.

func (RealtimeAudioConfigParam) MarshalJSON

func (r RealtimeAudioConfigParam) MarshalJSON() (data []byte, err error)

func (*RealtimeAudioConfigParam) UnmarshalJSON

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

type RealtimeClientSecretConfigExpiresAfterParam

type RealtimeClientSecretConfigExpiresAfterParam struct {
	// The anchor point for the ephemeral token expiration. Only `created_at` is
	// currently supported.
	//
	// Any of "created_at".
	Anchor string `json:"anchor,omitzero,required"`
	// The number of seconds from the anchor point to the expiration. Select a value
	// between `10` and `7200`.
	Seconds param.Opt[int64] `json:"seconds,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the ephemeral token expiration.

The property Anchor is required.

func (RealtimeClientSecretConfigExpiresAfterParam) MarshalJSON

func (r RealtimeClientSecretConfigExpiresAfterParam) MarshalJSON() (data []byte, err error)

func (*RealtimeClientSecretConfigExpiresAfterParam) UnmarshalJSON

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

type RealtimeClientSecretConfigParam

type RealtimeClientSecretConfigParam struct {
	// Configuration for the ephemeral token expiration.
	ExpiresAfter RealtimeClientSecretConfigExpiresAfterParam `json:"expires_after,omitzero"`
	// contains filtered or unexported fields
}

Configuration options for the generated client secret.

func (RealtimeClientSecretConfigParam) MarshalJSON

func (r RealtimeClientSecretConfigParam) MarshalJSON() (data []byte, err error)

func (*RealtimeClientSecretConfigParam) UnmarshalJSON

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

type RealtimeService

type RealtimeService struct {
	Options       []option.RequestOption
	ClientSecrets ClientSecretService
}

RealtimeService 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 NewRealtimeService method instead.

func NewRealtimeService

func NewRealtimeService(opts ...option.RequestOption) (r RealtimeService)

NewRealtimeService 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.

type RealtimeSessionCreateRequestMaxOutputTokensUnionParam

type RealtimeSessionCreateRequestMaxOutputTokensUnionParam struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Construct this variant with constant.ValueOf[constant.Inf]()
	OfInf constant.Inf `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (RealtimeSessionCreateRequestMaxOutputTokensUnionParam) MarshalJSON

func (*RealtimeSessionCreateRequestMaxOutputTokensUnionParam) UnmarshalJSON

type RealtimeSessionCreateRequestModel

type RealtimeSessionCreateRequestModel = string

The Realtime model used for this session.

const (
	RealtimeSessionCreateRequestModelGPT4oRealtime                      RealtimeSessionCreateRequestModel = "gpt-4o-realtime"
	RealtimeSessionCreateRequestModelGPT4oMiniRealtime                  RealtimeSessionCreateRequestModel = "gpt-4o-mini-realtime"
	RealtimeSessionCreateRequestModelGPT4oRealtimePreview               RealtimeSessionCreateRequestModel = "gpt-4o-realtime-preview"
	RealtimeSessionCreateRequestModelGPT4oRealtimePreview2024_10_01     RealtimeSessionCreateRequestModel = "gpt-4o-realtime-preview-2024-10-01"
	RealtimeSessionCreateRequestModelGPT4oRealtimePreview2024_12_17     RealtimeSessionCreateRequestModel = "gpt-4o-realtime-preview-2024-12-17"
	RealtimeSessionCreateRequestModelGPT4oRealtimePreview2025_06_03     RealtimeSessionCreateRequestModel = "gpt-4o-realtime-preview-2025-06-03"
	RealtimeSessionCreateRequestModelGPT4oMiniRealtimePreview           RealtimeSessionCreateRequestModel = "gpt-4o-mini-realtime-preview"
	RealtimeSessionCreateRequestModelGPT4oMiniRealtimePreview2024_12_17 RealtimeSessionCreateRequestModel = "gpt-4o-mini-realtime-preview-2024-12-17"
)

type RealtimeSessionCreateRequestParam

type RealtimeSessionCreateRequestParam struct {
	// The Realtime model used for this session.
	Model RealtimeSessionCreateRequestModel `json:"model,omitzero,required"`
	// The default system instructions (i.e. system message) prepended to model calls.
	// This field allows the client to guide the model on desired responses. The model
	// can be instructed on response content and format, (e.g. "be extremely succinct",
	// "act friendly", "here are examples of good responses") and on audio behavior
	// (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
	// instructions are not guaranteed to be followed by the model, but they provide
	// guidance to the model on the desired behavior.
	//
	// Note that the server sets default instructions which will be used if this field
	// is not set and are visible in the `session.created` event at the start of the
	// session.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
	// temperature of 0.8 is highly recommended for best performance.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Reference to a prompt template and its variables.
	// [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
	Prompt responses.ResponsePromptParam `json:"prompt,omitzero"`
	// Configuration options for tracing. Set to null to disable tracing. Once tracing
	// is enabled for a session, the configuration cannot be modified.
	//
	// `auto` will create a trace for the session with default values for the workflow
	// name, group id, and metadata.
	Tracing RealtimeTracingConfigUnionParam `json:"tracing,omitzero"`
	// Configuration for input and output audio.
	Audio RealtimeAudioConfigParam `json:"audio,omitzero"`
	// Configuration options for the generated client secret.
	ClientSecret RealtimeClientSecretConfigParam `json:"client_secret,omitzero"`
	// Additional fields to include in server outputs.
	//
	//   - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
	//     transcription.
	//
	// Any of "item.input_audio_transcription.logprobs".
	Include []string `json:"include,omitzero"`
	// Maximum number of output tokens for a single assistant response, inclusive of
	// tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
	// `inf` for the maximum available tokens for a given model. Defaults to `inf`.
	MaxOutputTokens RealtimeSessionCreateRequestMaxOutputTokensUnionParam `json:"max_output_tokens,omitzero"`
	// The set of modalities the model can respond with. To disable audio, set this to
	// ["text"].
	//
	// Any of "text", "audio".
	OutputModalities []string `json:"output_modalities,omitzero"`
	// How the model chooses tools. Provide one of the string modes or force a specific
	// function/MCP tool.
	ToolChoice RealtimeToolChoiceConfigUnionParam `json:"tool_choice,omitzero"`
	// Tools available to the model.
	Tools RealtimeToolsConfigParam `json:"tools,omitzero"`
	// Controls how the realtime conversation is truncated prior to model inference.
	// The default is `auto`. When set to `retention_ratio`, the server retains a
	// fraction of the conversation tokens prior to the instructions.
	Truncation RealtimeTruncationUnionParam `json:"truncation,omitzero"`
	// The type of session to create. Always `realtime` for the Realtime API.
	//
	// This field can be elided, and will marshal its zero value as "realtime".
	Type constant.Realtime `json:"type,required"`
	// contains filtered or unexported fields
}

Realtime session object configuration.

The properties Model, Type are required.

func (RealtimeSessionCreateRequestParam) MarshalJSON

func (r RealtimeSessionCreateRequestParam) MarshalJSON() (data []byte, err error)

func (*RealtimeSessionCreateRequestParam) UnmarshalJSON

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

type RealtimeSessionCreateResponse

type RealtimeSessionCreateResponse struct {
	// Unique identifier for the session that looks like `sess_1234567890abcdef`.
	ID string `json:"id"`
	// Configuration for input and output audio for the session.
	Audio RealtimeSessionCreateResponseAudio `json:"audio"`
	// Expiration timestamp for the session, in seconds since epoch.
	ExpiresAt int64 `json:"expires_at"`
	// Additional fields to include in server outputs.
	//
	//   - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
	//     transcription.
	//
	// Any of "item.input_audio_transcription.logprobs".
	Include []string `json:"include"`
	// The default system instructions (i.e. system message) prepended to model calls.
	// This field allows the client to guide the model on desired responses. The model
	// can be instructed on response content and format, (e.g. "be extremely succinct",
	// "act friendly", "here are examples of good responses") and on audio behavior
	// (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
	// instructions are not guaranteed to be followed by the model, but they provide
	// guidance to the model on the desired behavior.
	//
	// Note that the server sets default instructions which will be used if this field
	// is not set and are visible in the `session.created` event at the start of the
	// session.
	Instructions string `json:"instructions"`
	// Maximum number of output tokens for a single assistant response, inclusive of
	// tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
	// `inf` for the maximum available tokens for a given model. Defaults to `inf`.
	MaxOutputTokens RealtimeSessionCreateResponseMaxOutputTokensUnion `json:"max_output_tokens"`
	// The Realtime model used for this session.
	Model string `json:"model"`
	// The object type. Always `realtime.session`.
	Object string `json:"object"`
	// The set of modalities the model can respond with. To disable audio, set this to
	// ["text"].
	//
	// Any of "text", "audio".
	OutputModalities []string `json:"output_modalities"`
	// How the model chooses tools. Options are `auto`, `none`, `required`, or specify
	// a function.
	ToolChoice string `json:"tool_choice"`
	// Tools (functions) available to the model.
	Tools []RealtimeSessionCreateResponseTool `json:"tools"`
	// Configuration options for tracing. Set to null to disable tracing. Once tracing
	// is enabled for a session, the configuration cannot be modified.
	//
	// `auto` will create a trace for the session with default values for the workflow
	// name, group id, and metadata.
	Tracing RealtimeSessionCreateResponseTracingUnion `json:"tracing"`
	// Configuration for turn detection. Can be set to `null` to turn off. Server VAD
	// means that the model will detect the start and end of speech based on audio
	// volume and respond at the end of user speech.
	TurnDetection RealtimeSessionCreateResponseTurnDetection `json:"turn_detection"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Audio            respjson.Field
		ExpiresAt        respjson.Field
		Include          respjson.Field
		Instructions     respjson.Field
		MaxOutputTokens  respjson.Field
		Model            respjson.Field
		Object           respjson.Field
		OutputModalities respjson.Field
		ToolChoice       respjson.Field
		Tools            respjson.Field
		Tracing          respjson.Field
		TurnDetection    respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Realtime session configuration object.

func (RealtimeSessionCreateResponse) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponse) UnmarshalJSON

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

type RealtimeSessionCreateResponseAudio

type RealtimeSessionCreateResponseAudio struct {
	Input  RealtimeSessionCreateResponseAudioInput  `json:"input"`
	Output RealtimeSessionCreateResponseAudioOutput `json:"output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Input       respjson.Field
		Output      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for input and output audio for the session.

func (RealtimeSessionCreateResponseAudio) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudio) UnmarshalJSON

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

type RealtimeSessionCreateResponseAudioInput

type RealtimeSessionCreateResponseAudioInput struct {
	// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
	Format string `json:"format"`
	// Configuration for input audio noise reduction.
	NoiseReduction RealtimeSessionCreateResponseAudioInputNoiseReduction `json:"noise_reduction"`
	// Configuration for input audio transcription.
	Transcription RealtimeSessionCreateResponseAudioInputTranscription `json:"transcription"`
	// Configuration for turn detection.
	TurnDetection RealtimeSessionCreateResponseAudioInputTurnDetection `json:"turn_detection"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format         respjson.Field
		NoiseReduction respjson.Field
		Transcription  respjson.Field
		TurnDetection  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RealtimeSessionCreateResponseAudioInput) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudioInput) UnmarshalJSON

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

type RealtimeSessionCreateResponseAudioInputNoiseReduction

type RealtimeSessionCreateResponseAudioInputNoiseReduction struct {
	// Any of "near_field", "far_field".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for input audio noise reduction.

func (RealtimeSessionCreateResponseAudioInputNoiseReduction) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudioInputNoiseReduction) UnmarshalJSON

type RealtimeSessionCreateResponseAudioInputTranscription

type RealtimeSessionCreateResponseAudioInputTranscription struct {
	// The language of the input audio.
	Language string `json:"language"`
	// The model to use for transcription.
	Model string `json:"model"`
	// Optional text to guide the model's style or continue a previous audio segment.
	Prompt string `json:"prompt"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Language    respjson.Field
		Model       respjson.Field
		Prompt      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for input audio transcription.

func (RealtimeSessionCreateResponseAudioInputTranscription) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudioInputTranscription) UnmarshalJSON

type RealtimeSessionCreateResponseAudioInputTurnDetection

type RealtimeSessionCreateResponseAudioInputTurnDetection struct {
	PrefixPaddingMs   int64   `json:"prefix_padding_ms"`
	SilenceDurationMs int64   `json:"silence_duration_ms"`
	Threshold         float64 `json:"threshold"`
	// Type of turn detection, only `server_vad` is currently supported.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PrefixPaddingMs   respjson.Field
		SilenceDurationMs respjson.Field
		Threshold         respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for turn detection.

func (RealtimeSessionCreateResponseAudioInputTurnDetection) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudioInputTurnDetection) UnmarshalJSON

type RealtimeSessionCreateResponseAudioOutput

type RealtimeSessionCreateResponseAudioOutput struct {
	// The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
	Format string  `json:"format"`
	Speed  float64 `json:"speed"`
	Voice  string  `json:"voice"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format      respjson.Field
		Speed       respjson.Field
		Voice       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RealtimeSessionCreateResponseAudioOutput) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseAudioOutput) UnmarshalJSON

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

type RealtimeSessionCreateResponseMaxOutputTokensUnion

type RealtimeSessionCreateResponseMaxOutputTokensUnion struct {
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [constant.Inf] instead of an
	// object.
	OfInf constant.Inf `json:",inline"`
	JSON  struct {
		OfInt respjson.Field
		OfInf respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RealtimeSessionCreateResponseMaxOutputTokensUnion contains all possible properties and values from [int64], constant.Inf.

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

If the underlying value is not a json object, one of the following properties will be valid: OfInt OfInf]

func (RealtimeSessionCreateResponseMaxOutputTokensUnion) AsInf

func (RealtimeSessionCreateResponseMaxOutputTokensUnion) AsInt

func (RealtimeSessionCreateResponseMaxOutputTokensUnion) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseMaxOutputTokensUnion) UnmarshalJSON

type RealtimeSessionCreateResponseTool

type RealtimeSessionCreateResponseTool struct {
	// The description of the function, including guidance on when and how to call it,
	// and guidance about what to tell the user when calling (if anything).
	Description string `json:"description"`
	// The name of the function.
	Name string `json:"name"`
	// Parameters of the function in JSON Schema.
	Parameters any `json:"parameters"`
	// The type of the tool, i.e. `function`.
	//
	// Any of "function".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		Name        respjson.Field
		Parameters  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RealtimeSessionCreateResponseTool) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseTool) UnmarshalJSON

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

type RealtimeSessionCreateResponseTracingTracingConfiguration

type RealtimeSessionCreateResponseTracingTracingConfiguration struct {
	// The group id to attach to this trace to enable filtering and grouping in the
	// traces dashboard.
	GroupID string `json:"group_id"`
	// The arbitrary metadata to attach to this trace to enable filtering in the traces
	// dashboard.
	Metadata any `json:"metadata"`
	// The name of the workflow to attach to this trace. This is used to name the trace
	// in the traces dashboard.
	WorkflowName string `json:"workflow_name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GroupID      respjson.Field
		Metadata     respjson.Field
		WorkflowName respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Granular configuration for tracing.

func (RealtimeSessionCreateResponseTracingTracingConfiguration) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseTracingTracingConfiguration) UnmarshalJSON

type RealtimeSessionCreateResponseTracingUnion

type RealtimeSessionCreateResponseTracingUnion struct {
	// This field will be present if the value is a [constant.Auto] instead of an
	// object.
	OfAuto constant.Auto `json:",inline"`
	// This field is from variant
	// [RealtimeSessionCreateResponseTracingTracingConfiguration].
	GroupID string `json:"group_id"`
	// This field is from variant
	// [RealtimeSessionCreateResponseTracingTracingConfiguration].
	Metadata any `json:"metadata"`
	// This field is from variant
	// [RealtimeSessionCreateResponseTracingTracingConfiguration].
	WorkflowName string `json:"workflow_name"`
	JSON         struct {
		OfAuto       respjson.Field
		GroupID      respjson.Field
		Metadata     respjson.Field
		WorkflowName respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RealtimeSessionCreateResponseTracingUnion contains all possible properties and values from constant.Auto, RealtimeSessionCreateResponseTracingTracingConfiguration.

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

If the underlying value is not a json object, one of the following properties will be valid: OfAuto]

func (RealtimeSessionCreateResponseTracingUnion) AsAuto

func (RealtimeSessionCreateResponseTracingUnion) AsTracingConfiguration

func (RealtimeSessionCreateResponseTracingUnion) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseTracingUnion) UnmarshalJSON

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

type RealtimeSessionCreateResponseTurnDetection

type RealtimeSessionCreateResponseTurnDetection struct {
	// Amount of audio to include before the VAD detected speech (in milliseconds).
	// Defaults to 300ms.
	PrefixPaddingMs int64 `json:"prefix_padding_ms"`
	// Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
	// With shorter values the model will respond more quickly, but may jump in on
	// short pauses from the user.
	SilenceDurationMs int64 `json:"silence_duration_ms"`
	// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
	// threshold will require louder audio to activate the model, and thus might
	// perform better in noisy environments.
	Threshold float64 `json:"threshold"`
	// Type of turn detection, only `server_vad` is currently supported.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PrefixPaddingMs   respjson.Field
		SilenceDurationMs respjson.Field
		Threshold         respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

func (RealtimeSessionCreateResponseTurnDetection) RawJSON

Returns the unmodified JSON received from the API

func (*RealtimeSessionCreateResponseTurnDetection) UnmarshalJSON

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

type RealtimeToolChoiceConfigUnionParam

type RealtimeToolChoiceConfigUnionParam struct {
	// Check if union is this variant with !param.IsOmitted(union.OfToolChoiceMode)
	OfToolChoiceMode param.Opt[responses.ToolChoiceOptions] `json:",omitzero,inline"`
	OfFunctionTool   *responses.ToolChoiceFunctionParam     `json:",omitzero,inline"`
	OfMcpTool        *responses.ToolChoiceMcpParam          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func RealtimeToolChoiceConfigParamOfFunctionTool

func RealtimeToolChoiceConfigParamOfFunctionTool(name string) RealtimeToolChoiceConfigUnionParam

func RealtimeToolChoiceConfigParamOfMcpTool

func RealtimeToolChoiceConfigParamOfMcpTool(serverLabel string) RealtimeToolChoiceConfigUnionParam

func (RealtimeToolChoiceConfigUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolChoiceConfigUnionParam) GetServerLabel

func (u RealtimeToolChoiceConfigUnionParam) GetServerLabel() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolChoiceConfigUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolChoiceConfigUnionParam) MarshalJSON

func (u RealtimeToolChoiceConfigUnionParam) MarshalJSON() ([]byte, error)

func (*RealtimeToolChoiceConfigUnionParam) UnmarshalJSON

func (u *RealtimeToolChoiceConfigUnionParam) UnmarshalJSON(data []byte) error

type RealtimeToolsConfigParam

type RealtimeToolsConfigParam []RealtimeToolsConfigUnionParam

type RealtimeToolsConfigUnionFunctionParam

type RealtimeToolsConfigUnionFunctionParam struct {
	// The description of the function, including guidance on when and how to call it,
	// and guidance about what to tell the user when calling (if anything).
	Description param.Opt[string] `json:"description,omitzero"`
	// The name of the function.
	Name param.Opt[string] `json:"name,omitzero"`
	// Parameters of the function in JSON Schema.
	Parameters any `json:"parameters,omitzero"`
	// The type of the tool, i.e. `function`.
	//
	// Any of "function".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (RealtimeToolsConfigUnionFunctionParam) MarshalJSON

func (r RealtimeToolsConfigUnionFunctionParam) MarshalJSON() (data []byte, err error)

func (*RealtimeToolsConfigUnionFunctionParam) UnmarshalJSON

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

type RealtimeToolsConfigUnionMcpAllowedToolsMcpToolFilterParam

type RealtimeToolsConfigUnionMcpAllowedToolsMcpToolFilterParam struct {
	// Indicates whether or not a tool modifies data or is read-only. If an MCP server
	// is
	// [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
	// it will match this filter.
	ReadOnly param.Opt[bool] `json:"read_only,omitzero"`
	// List of allowed tool names.
	ToolNames []string `json:"tool_names,omitzero"`
	// contains filtered or unexported fields
}

A filter object to specify which tools are allowed.

func (RealtimeToolsConfigUnionMcpAllowedToolsMcpToolFilterParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpAllowedToolsMcpToolFilterParam) UnmarshalJSON

type RealtimeToolsConfigUnionMcpAllowedToolsParam

type RealtimeToolsConfigUnionMcpAllowedToolsParam struct {
	OfMcpAllowedTools []string                                                   `json:",omitzero,inline"`
	OfMcpToolFilter   *RealtimeToolsConfigUnionMcpAllowedToolsMcpToolFilterParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (RealtimeToolsConfigUnionMcpAllowedToolsParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpAllowedToolsParam) UnmarshalJSON

func (u *RealtimeToolsConfigUnionMcpAllowedToolsParam) UnmarshalJSON(data []byte) error

type RealtimeToolsConfigUnionMcpParam

type RealtimeToolsConfigUnionMcpParam struct {
	// A label for this MCP server, used to identify it in tool calls.
	ServerLabel string `json:"server_label,required"`
	// An OAuth access token that can be used with a remote MCP server, either with a
	// custom MCP server URL or a service connector. Your application must handle the
	// OAuth authorization flow and provide the token here.
	Authorization param.Opt[string] `json:"authorization,omitzero"`
	// Optional description of the MCP server, used to provide more context.
	ServerDescription param.Opt[string] `json:"server_description,omitzero"`
	// The URL for the MCP server. One of `server_url` or `connector_id` must be
	// provided.
	ServerURL param.Opt[string] `json:"server_url,omitzero"`
	// List of allowed tool names or a filter object.
	AllowedTools RealtimeToolsConfigUnionMcpAllowedToolsParam `json:"allowed_tools,omitzero"`
	// Optional HTTP headers to send to the MCP server. Use for authentication or other
	// purposes.
	Headers map[string]string `json:"headers,omitzero"`
	// Specify which of the MCP server's tools require approval.
	RequireApproval RealtimeToolsConfigUnionMcpRequireApprovalParam `json:"require_approval,omitzero"`
	// Identifier for service connectors, like those available in ChatGPT. One of
	// `server_url` or `connector_id` must be provided. Learn more about service
	// connectors
	// [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
	//
	// Currently supported `connector_id` values are:
	//
	// - Dropbox: `connector_dropbox`
	// - Gmail: `connector_gmail`
	// - Google Calendar: `connector_googlecalendar`
	// - Google Drive: `connector_googledrive`
	// - Microsoft Teams: `connector_microsoftteams`
	// - Outlook Calendar: `connector_outlookcalendar`
	// - Outlook Email: `connector_outlookemail`
	// - SharePoint: `connector_sharepoint`
	//
	// Any of "connector_dropbox", "connector_gmail", "connector_googlecalendar",
	// "connector_googledrive", "connector_microsoftteams",
	// "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint".
	ConnectorID string `json:"connector_id,omitzero"`
	// The type of the MCP tool. Always `mcp`.
	//
	// This field can be elided, and will marshal its zero value as "mcp".
	Type constant.Mcp `json:"type,required"`
	// contains filtered or unexported fields
}

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).

The properties ServerLabel, Type are required.

func (RealtimeToolsConfigUnionMcpParam) MarshalJSON

func (r RealtimeToolsConfigUnionMcpParam) MarshalJSON() (data []byte, err error)

func (*RealtimeToolsConfigUnionMcpParam) UnmarshalJSON

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

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterAlwaysParam

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterAlwaysParam struct {
	// Indicates whether or not a tool modifies data or is read-only. If an MCP server
	// is
	// [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
	// it will match this filter.
	ReadOnly param.Opt[bool] `json:"read_only,omitzero"`
	// List of allowed tool names.
	ToolNames []string `json:"tool_names,omitzero"`
	// contains filtered or unexported fields
}

A filter object to specify which tools are allowed.

func (RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterAlwaysParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterAlwaysParam) UnmarshalJSON

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterNeverParam

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterNeverParam struct {
	// Indicates whether or not a tool modifies data or is read-only. If an MCP server
	// is
	// [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
	// it will match this filter.
	ReadOnly param.Opt[bool] `json:"read_only,omitzero"`
	// List of allowed tool names.
	ToolNames []string `json:"tool_names,omitzero"`
	// contains filtered or unexported fields
}

A filter object to specify which tools are allowed.

func (RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterNeverParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterNeverParam) UnmarshalJSON

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterParam

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterParam struct {
	// A filter object to specify which tools are allowed.
	Always RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterAlwaysParam `json:"always,omitzero"`
	// A filter object to specify which tools are allowed.
	Never RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterNeverParam `json:"never,omitzero"`
	// contains filtered or unexported fields
}

Specify which of the MCP server's tools require approval. Can be `always`, `never`, or a filter object associated with tools that require approval.

func (RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterParam) UnmarshalJSON

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSetting

type RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSetting string

Specify a single approval policy for all tools. One of `always` or `never`. When set to `always`, all tools will require approval. When set to `never`, all tools will not require approval.

const (
	RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSettingAlways RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSetting = "always"
	RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSettingNever  RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalSetting = "never"
)

type RealtimeToolsConfigUnionMcpRequireApprovalParam

type RealtimeToolsConfigUnionMcpRequireApprovalParam struct {
	OfMcpToolApprovalFilter *RealtimeToolsConfigUnionMcpRequireApprovalMcpToolApprovalFilterParam `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfMcpToolApprovalSetting)
	OfMcpToolApprovalSetting param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (RealtimeToolsConfigUnionMcpRequireApprovalParam) MarshalJSON

func (*RealtimeToolsConfigUnionMcpRequireApprovalParam) UnmarshalJSON

type RealtimeToolsConfigUnionParam

type RealtimeToolsConfigUnionParam struct {
	OfFunction *RealtimeToolsConfigUnionFunctionParam `json:",omitzero,inline"`
	OfMcp      *RealtimeToolsConfigUnionMcpParam      `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func RealtimeToolsConfigUnionParamOfMcp

func RealtimeToolsConfigUnionParamOfMcp(serverLabel string) RealtimeToolsConfigUnionParam

func (RealtimeToolsConfigUnionParam) GetAllowedTools

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetAuthorization

func (u RealtimeToolsConfigUnionParam) GetAuthorization() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetConnectorID

func (u RealtimeToolsConfigUnionParam) GetConnectorID() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetDescription

func (u RealtimeToolsConfigUnionParam) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetHeaders

func (u RealtimeToolsConfigUnionParam) GetHeaders() map[string]string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetParameters

func (u RealtimeToolsConfigUnionParam) GetParameters() *any

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetRequireApproval

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetServerDescription

func (u RealtimeToolsConfigUnionParam) GetServerDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetServerLabel

func (u RealtimeToolsConfigUnionParam) GetServerLabel() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetServerURL

func (u RealtimeToolsConfigUnionParam) GetServerURL() *string

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (RealtimeToolsConfigUnionParam) MarshalJSON

func (u RealtimeToolsConfigUnionParam) MarshalJSON() ([]byte, error)

func (*RealtimeToolsConfigUnionParam) UnmarshalJSON

func (u *RealtimeToolsConfigUnionParam) UnmarshalJSON(data []byte) error

type RealtimeTracingConfigTracingConfigurationParam

type RealtimeTracingConfigTracingConfigurationParam struct {
	// The group id to attach to this trace to enable filtering and grouping in the
	// traces dashboard.
	GroupID param.Opt[string] `json:"group_id,omitzero"`
	// The name of the workflow to attach to this trace. This is used to name the trace
	// in the traces dashboard.
	WorkflowName param.Opt[string] `json:"workflow_name,omitzero"`
	// The arbitrary metadata to attach to this trace to enable filtering in the traces
	// dashboard.
	Metadata any `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

Granular configuration for tracing.

func (RealtimeTracingConfigTracingConfigurationParam) MarshalJSON

func (r RealtimeTracingConfigTracingConfigurationParam) MarshalJSON() (data []byte, err error)

func (*RealtimeTracingConfigTracingConfigurationParam) UnmarshalJSON

type RealtimeTracingConfigUnionParam

type RealtimeTracingConfigUnionParam struct {
	// Construct this variant with constant.ValueOf[constant.Auto]()
	OfAuto                 constant.Auto                                   `json:",omitzero,inline"`
	OfTracingConfiguration *RealtimeTracingConfigTracingConfigurationParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func RealtimeTracingConfigParamOfAuto

func RealtimeTracingConfigParamOfAuto() RealtimeTracingConfigUnionParam

func (RealtimeTracingConfigUnionParam) MarshalJSON

func (u RealtimeTracingConfigUnionParam) MarshalJSON() ([]byte, error)

func (*RealtimeTracingConfigUnionParam) UnmarshalJSON

func (u *RealtimeTracingConfigUnionParam) UnmarshalJSON(data []byte) error

type RealtimeTranscriptionSessionCreateRequestInputAudioFormat

type RealtimeTranscriptionSessionCreateRequestInputAudioFormat string

The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel (mono), and little-endian byte order.

const (
	RealtimeTranscriptionSessionCreateRequestInputAudioFormatPcm16    RealtimeTranscriptionSessionCreateRequestInputAudioFormat = "pcm16"
	RealtimeTranscriptionSessionCreateRequestInputAudioFormatG711Ulaw RealtimeTranscriptionSessionCreateRequestInputAudioFormat = "g711_ulaw"
	RealtimeTranscriptionSessionCreateRequestInputAudioFormatG711Alaw RealtimeTranscriptionSessionCreateRequestInputAudioFormat = "g711_alaw"
)

type RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionParam

type RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionParam struct {
	// Type of noise reduction. `near_field` is for close-talking microphones such as
	// headphones, `far_field` is for far-field microphones such as laptop or
	// conference room microphones.
	//
	// Any of "near_field", "far_field".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configuration for input audio noise reduction. This can be set to `null` to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.

func (RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionParam) MarshalJSON

func (*RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionParam) UnmarshalJSON

type RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionParam

type RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionParam struct {
	// The language of the input audio. Supplying the input language in
	// [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
	// format will improve accuracy and latency.
	Language param.Opt[string] `json:"language,omitzero"`
	// An optional text to guide the model's style or continue a previous audio
	// segment. For `whisper-1`, the
	// [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
	// For `gpt-4o-transcribe` models, the prompt is a free text string, for example
	// "expect words related to technology".
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// The model to use for transcription, current options are `gpt-4o-transcribe`,
	// `gpt-4o-mini-transcribe`, and `whisper-1`.
	//
	// Any of "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1".
	Model string `json:"model,omitzero"`
	// contains filtered or unexported fields
}

Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.

func (RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionParam) MarshalJSON

func (*RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionParam) UnmarshalJSON

type RealtimeTranscriptionSessionCreateRequestModel

type RealtimeTranscriptionSessionCreateRequestModel = string

ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model).

const (
	RealtimeTranscriptionSessionCreateRequestModelWhisper1            RealtimeTranscriptionSessionCreateRequestModel = "whisper-1"
	RealtimeTranscriptionSessionCreateRequestModelGPT4oTranscribe     RealtimeTranscriptionSessionCreateRequestModel = "gpt-4o-transcribe"
	RealtimeTranscriptionSessionCreateRequestModelGPT4oMiniTranscribe RealtimeTranscriptionSessionCreateRequestModel = "gpt-4o-mini-transcribe"
)

type RealtimeTranscriptionSessionCreateRequestParam

type RealtimeTranscriptionSessionCreateRequestParam struct {
	// ID of the model to use. The options are `gpt-4o-transcribe`,
	// `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source
	// Whisper V2 model).
	Model RealtimeTranscriptionSessionCreateRequestModel `json:"model,omitzero,required"`
	// The set of items to include in the transcription. Current available items are:
	//
	// - `item.input_audio_transcription.logprobs`
	//
	// Any of "item.input_audio_transcription.logprobs".
	Include []string `json:"include,omitzero"`
	// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
	// `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
	// (mono), and little-endian byte order.
	//
	// Any of "pcm16", "g711_ulaw", "g711_alaw".
	InputAudioFormat RealtimeTranscriptionSessionCreateRequestInputAudioFormat `json:"input_audio_format,omitzero"`
	// Configuration for input audio noise reduction. This can be set to `null` to turn
	// off. Noise reduction filters audio added to the input audio buffer before it is
	// sent to VAD and the model. Filtering the audio can improve VAD and turn
	// detection accuracy (reducing false positives) and model performance by improving
	// perception of the input audio.
	InputAudioNoiseReduction RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionParam `json:"input_audio_noise_reduction,omitzero"`
	// Configuration for input audio transcription. The client can optionally set the
	// language and prompt for transcription, these offer additional guidance to the
	// transcription service.
	InputAudioTranscription RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionParam `json:"input_audio_transcription,omitzero"`
	// Configuration for turn detection. Can be set to `null` to turn off. Server VAD
	// means that the model will detect the start and end of speech based on audio
	// volume and respond at the end of user speech.
	TurnDetection RealtimeTranscriptionSessionCreateRequestTurnDetectionParam `json:"turn_detection,omitzero"`
	// The type of session to create. Always `transcription` for transcription
	// sessions.
	//
	// This field can be elided, and will marshal its zero value as "transcription".
	Type constant.Transcription `json:"type,required"`
	// contains filtered or unexported fields
}

Realtime transcription session object configuration.

The properties Model, Type are required.

func (RealtimeTranscriptionSessionCreateRequestParam) MarshalJSON

func (r RealtimeTranscriptionSessionCreateRequestParam) MarshalJSON() (data []byte, err error)

func (*RealtimeTranscriptionSessionCreateRequestParam) UnmarshalJSON

type RealtimeTranscriptionSessionCreateRequestTurnDetectionParam

type RealtimeTranscriptionSessionCreateRequestTurnDetectionParam struct {
	// Amount of audio to include before the VAD detected speech (in milliseconds).
	// Defaults to 300ms.
	PrefixPaddingMs param.Opt[int64] `json:"prefix_padding_ms,omitzero"`
	// Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
	// With shorter values the model will respond more quickly, but may jump in on
	// short pauses from the user.
	SilenceDurationMs param.Opt[int64] `json:"silence_duration_ms,omitzero"`
	// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
	// threshold will require louder audio to activate the model, and thus might
	// perform better in noisy environments.
	Threshold param.Opt[float64] `json:"threshold,omitzero"`
	// Type of turn detection. Only `server_vad` is currently supported for
	// transcription sessions.
	//
	// Any of "server_vad".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

func (RealtimeTranscriptionSessionCreateRequestTurnDetectionParam) MarshalJSON

func (*RealtimeTranscriptionSessionCreateRequestTurnDetectionParam) UnmarshalJSON

type RealtimeTruncationRealtimeTruncationStrategy

type RealtimeTruncationRealtimeTruncationStrategy string

The truncation strategy to use for the session.

const (
	RealtimeTruncationRealtimeTruncationStrategyAuto     RealtimeTruncationRealtimeTruncationStrategy = "auto"
	RealtimeTruncationRealtimeTruncationStrategyDisabled RealtimeTruncationRealtimeTruncationStrategy = "disabled"
)

type RealtimeTruncationRetentionRatioTruncationParam

type RealtimeTruncationRetentionRatioTruncationParam struct {
	// Fraction of pre-instruction conversation tokens to retain (0.0 - 1.0).
	RetentionRatio float64 `json:"retention_ratio,required"`
	// Optional cap on tokens allowed after the instructions.
	PostInstructionsTokenLimit param.Opt[int64] `json:"post_instructions_token_limit,omitzero"`
	// Use retention ratio truncation.
	//
	// This field can be elided, and will marshal its zero value as "retention_ratio".
	Type constant.RetentionRatio `json:"type,required"`
	// contains filtered or unexported fields
}

Retain a fraction of the conversation tokens.

The properties RetentionRatio, Type are required.

func (RealtimeTruncationRetentionRatioTruncationParam) MarshalJSON

func (r RealtimeTruncationRetentionRatioTruncationParam) MarshalJSON() (data []byte, err error)

func (*RealtimeTruncationRetentionRatioTruncationParam) UnmarshalJSON

type RealtimeTruncationUnionParam

type RealtimeTruncationUnionParam struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfRealtimeTruncationStrategy)
	OfRealtimeTruncationStrategy param.Opt[string]                                `json:",omitzero,inline"`
	OfRetentionRatioTruncation   *RealtimeTruncationRetentionRatioTruncationParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func RealtimeTruncationParamOfRetentionRatioTruncation

func RealtimeTruncationParamOfRetentionRatioTruncation(retentionRatio float64) RealtimeTruncationUnionParam

func (RealtimeTruncationUnionParam) MarshalJSON

func (u RealtimeTruncationUnionParam) MarshalJSON() ([]byte, error)

func (*RealtimeTruncationUnionParam) UnmarshalJSON

func (u *RealtimeTruncationUnionParam) UnmarshalJSON(data []byte) error

type Reasoning

type Reasoning = shared.Reasoning

**gpt-5 and 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

Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `minimal`, `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

**gpt-5 and 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 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 ResponsesModel

type ResponsesModel = shared.ResponsesModel

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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