A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/openai/openai-go@v1.12.0/responses below:

responses package - github.com/openai/openai-go/responses - Go Packages

Equals "chatgpt-4o-latest"

Equals "codex-mini-latest"

Equals "gpt-3.5-turbo"

Equals "gpt-3.5-turbo-0125"

Equals "gpt-3.5-turbo-0301"

Equals "gpt-3.5-turbo-0613"

Equals "gpt-3.5-turbo-1106"

Equals "gpt-3.5-turbo-16k"

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

Equals "gpt-4"

Equals "gpt-4-turbo"

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

Equals "gpt-4-turbo-preview"

Equals "gpt-4-vision-preview"

Equals "gpt-4-0125-preview"

Equals "gpt-4-0314"

Equals "gpt-4-0613"

Equals "gpt-4.1"

Equals "gpt-4-1106-preview"

Equals "gpt-4.1-mini"

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

Equals "gpt-4.1-nano"

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

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

Equals "gpt-4-32k"

Equals "gpt-4-32k-0314"

Equals "gpt-4-32k-0613"

Equals "gpt-4o"

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

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

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

Equals "gpt-4o-audio-preview"

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

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

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

Equals "gpt-4o-mini"

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

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

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

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

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

Equals "gpt-4o-search-preview"

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

Equals "o1"

Equals "o1-mini"

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

Equals "o1-preview"

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

Equals "o1-2024-12-17"

Equals "o3"

Equals "o3-mini"

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

Equals "o3-2025-04-16"

Equals "o4-mini"

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

Equals "eq"

Equals "gt"

Equals "gte"

Equals "lt"

Equals "lte"

Equals "ne"

Equals "and"

Equals "or"

Equals "high"

Equals "low"

Equals "medium"

Equals "auto"

Equals "concise"

Equals "detailed"

Equals "auto"

Equals "concise"

Equals "detailed"

Equals "computer-use-preview"

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

Equals "o1-pro"

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

Equals "o3-deep-research"

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

Equals "o3-pro"

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

Equals "o4-mini-deep-research"

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

This section is empty.

This section is empty.

This is an alias to an internal type.

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.

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.

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.

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

This is an alias to an internal type.

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

This is an alias to an internal type.

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

This is an alias to an internal type.

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

This is an alias to an internal type.

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

This is an alias to an internal type.

A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

Returns the unmodified JSON received from the API

ToParam converts this ComputerTool to a ComputerToolParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ComputerToolParam.Overrides()

type ComputerToolEnvironment string

The type of computer environment to control.

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions.

Returns the unmodified JSON received from the API

ToParam converts this EasyInputMessage to a EasyInputMessageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with EasyInputMessageParam.Overrides()

EasyInputMessageContentUnion contains all possible properties and values from [string], ResponseInputMessageContentList.

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: OfString OfInputItemContentList]

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions.

The properties Content, Role are required.

type EasyInputMessageRole string

The role of the message input. One of `user`, `assistant`, `system`, or `developer`.

type EasyInputMessageType string

The type of the message input. Always `message`.

This is an alias to an internal type.

A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

Returns the unmodified JSON received from the API

ToParam converts this FileSearchTool to a FileSearchToolParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FileSearchToolParam.Overrides()

FileSearchToolFiltersUnion contains all possible properties and values from shared.ComparisonFilter, shared.CompoundFilter.

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

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

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

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

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

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

Ranking options for search.

Returns the unmodified JSON received from the API

type FileSearchToolRankingOptionsParam struct {
	
	
	
	ScoreThreshold param.Opt[float64] `json:"score_threshold,omitzero"`
	
	
	
	Ranker string `json:"ranker,omitzero"`
	
}

Ranking options for search.

This is an alias to an internal type.

This is an alias to an internal type.

Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

Returns the unmodified JSON received from the API

ToParam converts this FunctionTool to a FunctionToolParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FunctionToolParam.Overrides()

type FunctionToolParam struct {
	
	Strict param.Opt[bool] `json:"strict,omitzero,required"`
	
	Parameters map[string]any `json:"parameters,omitzero,required"`
	
	Name string `json:"name,required"`
	
	
	Description param.Opt[string] `json:"description,omitzero"`
	
	
	
	Type constant.Function `json:"type,required"`
	
}

Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

The properties Name, Parameters, Strict, Type are required.

type InputItemListParamsOrder string

The order to return the input items in. Default is `desc`.

- `asc`: Return the input items in ascending order. - `desc`: Return the input items in descending order.

InputItemService 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 NewInputItemService method instead.

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

Returns a list of input items for a given response.

Returns a list of input items for a given response.

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.

**o-series models only**

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

This is an alias to an internal type.

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

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 Response struct {
	
	ID string `json:"id,required"`
	
	CreatedAt float64 `json:"created_at,required"`
	
	Error ResponseError `json:"error,required"`
	
	IncompleteDetails ResponseIncompleteDetails `json:"incomplete_details,required"`
	
	
	
	
	
	Instructions ResponseInstructionsUnion `json:"instructions,required"`
	
	
	
	
	
	
	Metadata shared.Metadata `json:"metadata,required"`
	
	
	
	
	
	Model shared.ResponsesModel `json:"model,required"`
	
	Object constant.Response `json:"object,required"`
	
	
	
	
	
	
	
	Output []ResponseOutputItemUnion `json:"output,required"`
	
	ParallelToolCalls bool `json:"parallel_tool_calls,required"`
	
	
	
	
	Temperature float64 `json:"temperature,required"`
	
	
	
	ToolChoice ResponseToolChoiceUnion `json:"tool_choice,required"`
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	Tools []ToolUnion `json:"tools,required"`
	
	
	
	
	
	TopP float64 `json:"top_p,required"`
	
	
	Background bool `json:"background,nullable"`
	
	
	
	MaxOutputTokens int64 `json:"max_output_tokens,nullable"`
	
	
	
	
	MaxToolCalls int64 `json:"max_tool_calls,nullable"`
	
	
	
	PreviousResponseID string `json:"previous_response_id,nullable"`
	
	
	Prompt ResponsePrompt `json:"prompt,nullable"`
	
	
	
	PromptCacheKey string `json:"prompt_cache_key"`
	
	
	
	
	Reasoning shared.Reasoning `json:"reasoning,nullable"`
	
	
	
	
	
	SafetyIdentifier string `json:"safety_identifier"`
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	ServiceTier ResponseServiceTier `json:"service_tier,nullable"`
	
	
	
	
	
	Status ResponseStatus `json:"status"`
	
	
	
	
	
	Text ResponseTextConfig `json:"text"`
	
	
	TopLogprobs int64 `json:"top_logprobs,nullable"`
	
	
	
	
	
	
	
	
	
	Truncation ResponseTruncation `json:"truncation,nullable"`
	
	
	Usage ResponseUsage `json:"usage"`
	
	
	
	
	
	
	
	User string `json:"user"`
	
	JSON struct {
		ID                 respjson.Field
		CreatedAt          respjson.Field
		Error              respjson.Field
		IncompleteDetails  respjson.Field
		Instructions       respjson.Field
		Metadata           respjson.Field
		Model              respjson.Field
		Object             respjson.Field
		Output             respjson.Field
		ParallelToolCalls  respjson.Field
		Temperature        respjson.Field
		ToolChoice         respjson.Field
		Tools              respjson.Field
		TopP               respjson.Field
		Background         respjson.Field
		MaxOutputTokens    respjson.Field
		MaxToolCalls       respjson.Field
		PreviousResponseID respjson.Field
		Prompt             respjson.Field
		PromptCacheKey     respjson.Field
		Reasoning          respjson.Field
		SafetyIdentifier   respjson.Field
		ServiceTier        respjson.Field
		Status             respjson.Field
		Text               respjson.Field
		TopLogprobs        respjson.Field
		Truncation         respjson.Field
		Usage              respjson.Field
		User               respjson.Field
		ExtraFields        map[string]respjson.Field
		
	} `json:"-"`
}

Returns the unmodified JSON received from the API

Emitted when there is a partial audio response.

Returns the unmodified JSON received from the API

Emitted when the audio response is complete.

Returns the unmodified JSON received from the API

Emitted when there is a partial transcript of audio.

Returns the unmodified JSON received from the API

Emitted when the full audio transcript is completed.

Returns the unmodified JSON received from the API

Emitted when a partial code snippet is streamed by the code interpreter.

Returns the unmodified JSON received from the API

Emitted when the code snippet is finalized by the code interpreter.

Returns the unmodified JSON received from the API

Emitted when the code interpreter call is completed.

Returns the unmodified JSON received from the API

Emitted when a code interpreter call is in progress.

Returns the unmodified JSON received from the API

Emitted when the code interpreter is actively interpreting the code snippet.

Returns the unmodified JSON received from the API

A tool call to run code.

Returns the unmodified JSON received from the API

ToParam converts this ResponseCodeInterpreterToolCall to a ResponseCodeInterpreterToolCallParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseCodeInterpreterToolCallParam.Overrides()

The image output from the code interpreter.

Returns the unmodified JSON received from the API

type ResponseCodeInterpreterToolCallOutputImageParam struct {
	
	URL string `json:"url,required"`
	
	
	
	Type constant.Image `json:"type,required"`
	
}

The image output from the code interpreter.

The properties Type, URL are required.

The logs output from the code interpreter.

Returns the unmodified JSON received from the API

type ResponseCodeInterpreterToolCallOutputLogsParam struct {
	
	Logs string `json:"logs,required"`
	
	
	
	Type constant.Logs `json:"type,required"`
	
}

The logs output from the code interpreter.

The properties Logs, Type are required.

ResponseCodeInterpreterToolCallOutputUnion contains all possible properties and values from ResponseCodeInterpreterToolCallOutputLogs, ResponseCodeInterpreterToolCallOutputImage.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseCodeInterpreterToolCallOutputUnion.AsAny().(type) {
case responses.ResponseCodeInterpreterToolCallOutputLogs:
case responses.ResponseCodeInterpreterToolCallOutputImage:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

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

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

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

A tool call to run code.

The properties ID, Code, ContainerID, Outputs, Status, Type are required.

type ResponseCodeInterpreterToolCallStatus string

The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

Emitted when the model response is complete.

Returns the unmodified JSON received from the API

A tool call to a computer use tool. See the [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.

Returns the unmodified JSON received from the API

ToParam converts this ResponseComputerToolCall to a ResponseComputerToolCallParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseComputerToolCallParam.Overrides()

A click action.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionClickParam struct {
	
	
	
	
	Button string `json:"button,omitzero,required"`
	
	X int64 `json:"x,required"`
	
	Y int64 `json:"y,required"`
	
	
	
	
	Type constant.Click `json:"type,required"`
	
}

A click action.

The properties Button, Type, X, Y are required.

A double click action.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionDoubleClickParam struct {
	
	X int64 `json:"x,required"`
	
	Y int64 `json:"y,required"`
	
	
	
	
	Type constant.DoubleClick `json:"type,required"`
	
}

A double click action.

The properties Type, X, Y are required.

A drag action.

Returns the unmodified JSON received from the API

A drag action.

The properties Path, Type are required.

A series of x/y coordinate pairs in the drag path.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionDragPathParam struct {
	
	X int64 `json:"x,required"`
	
	Y int64 `json:"y,required"`
	
}

A series of x/y coordinate pairs in the drag path.

The properties X, Y are required.

A collection of keypresses the model would like to perform.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionKeypressParam struct {
	
	
	Keys []string `json:"keys,omitzero,required"`
	
	
	
	
	Type constant.Keypress `json:"type,required"`
	
}

A collection of keypresses the model would like to perform.

The properties Keys, Type are required.

A mouse move action.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionMoveParam struct {
	
	X int64 `json:"x,required"`
	
	Y int64 `json:"y,required"`
	
	
	
	
	Type constant.Move `json:"type,required"`
	
}

A mouse move action.

The properties Type, X, Y are required.

A screenshot action.

Returns the unmodified JSON received from the API

A scroll action.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionScrollParam struct {
	
	ScrollX int64 `json:"scroll_x,required"`
	
	ScrollY int64 `json:"scroll_y,required"`
	
	X int64 `json:"x,required"`
	
	Y int64 `json:"y,required"`
	
	
	
	
	Type constant.Scroll `json:"type,required"`
	
}

A scroll action.

The properties ScrollX, ScrollY, Type, X, Y are required.

An action to type in text.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallActionTypeParam struct {
	
	Text string `json:"text,required"`
	
	
	
	
	Type constant.Type `json:"type,required"`
	
}

An action to type in text.

The properties Text, Type are required.

type ResponseComputerToolCallActionUnionParam struct {
	OfClick       *ResponseComputerToolCallActionClickParam       `json:",omitzero,inline"`
	OfDoubleClick *ResponseComputerToolCallActionDoubleClickParam `json:",omitzero,inline"`
	OfDrag        *ResponseComputerToolCallActionDragParam        `json:",omitzero,inline"`
	OfKeypress    *ResponseComputerToolCallActionKeypressParam    `json:",omitzero,inline"`
	OfMove        *ResponseComputerToolCallActionMoveParam        `json:",omitzero,inline"`
	OfScreenshot  *ResponseComputerToolCallActionScreenshotParam  `json:",omitzero,inline"`
	OfScroll      *ResponseComputerToolCallActionScrollParam      `json:",omitzero,inline"`
	OfType        *ResponseComputerToolCallActionTypeParam        `json:",omitzero,inline"`
	OfWait        *ResponseComputerToolCallActionWaitParam        `json:",omitzero,inline"`
	
}

Only one field can be non-zero.

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

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

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

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

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

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

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

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

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

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

A wait action.

Returns the unmodified JSON received from the API

Returns the unmodified JSON received from the API

A pending safety check for the computer call.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallOutputItemStatus string

The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

A computer screenshot image used with the computer use tool.

Returns the unmodified JSON received from the API

ToParam converts this ResponseComputerToolCallOutputScreenshot to a ResponseComputerToolCallOutputScreenshotParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseComputerToolCallOutputScreenshotParam.Overrides()

A computer screenshot image used with the computer use tool.

The property Type is required.

type ResponseComputerToolCallParam struct {
	
	ID string `json:"id,required"`
	
	Action ResponseComputerToolCallActionUnionParam `json:"action,omitzero,required"`
	
	CallID string `json:"call_id,required"`
	
	PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckParam `json:"pending_safety_checks,omitzero,required"`
	
	
	
	
	Status ResponseComputerToolCallStatus `json:"status,omitzero,required"`
	
	
	
	Type ResponseComputerToolCallType `json:"type,omitzero,required"`
	
}

A tool call to a computer use tool. See the [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.

The properties ID, Action, CallID, PendingSafetyChecks, Status, Type are required.

A pending safety check for the computer call.

Returns the unmodified JSON received from the API

type ResponseComputerToolCallPendingSafetyCheckParam struct {
	
	ID string `json:"id,required"`
	
	Code string `json:"code,required"`
	
	Message string `json:"message,required"`
	
}

A pending safety check for the computer call.

The properties ID, Code, Message are required.

type ResponseComputerToolCallStatus string

The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

type ResponseComputerToolCallType string

The type of the computer call. Always `computer_call`.

Emitted when a new content part is added.

Returns the unmodified JSON received from the API

ResponseContentPartAddedEventPartUnion contains all possible properties and values from ResponseOutputText, ResponseOutputRefusal.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseContentPartAddedEventPartUnion.AsAny().(type) {
case responses.ResponseOutputText:
case responses.ResponseOutputRefusal:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

Emitted when a content part is done.

Returns the unmodified JSON received from the API

ResponseContentPartDoneEventPartUnion contains all possible properties and values from ResponseOutputText, ResponseOutputRefusal.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseContentPartDoneEventPartUnion.AsAny().(type) {
case responses.ResponseOutputText:
case responses.ResponseOutputRefusal:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

An event that is emitted when a response is created.

Returns the unmodified JSON received from the API

An error object returned when the model fails to generate a Response.

Returns the unmodified JSON received from the API

The error code for the response.

Emitted when an error occurs.

Returns the unmodified JSON received from the API

An event that is emitted when a response fails.

Returns the unmodified JSON received from the API

Emitted when a file search call is completed (results found).

Returns the unmodified JSON received from the API

Emitted when a file search call is initiated.

Returns the unmodified JSON received from the API

Emitted when a file search is currently searching.

Returns the unmodified JSON received from the API

The results of a file search tool call. See the [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.

Returns the unmodified JSON received from the API

ToParam converts this ResponseFileSearchToolCall to a ResponseFileSearchToolCallParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFileSearchToolCallParam.Overrides()

Returns the unmodified JSON received from the API

ResponseFileSearchToolCallResultAttributeUnion contains all possible properties and values from [string], [float64], [bool].

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: OfString OfFloat OfBool]

Returns the unmodified JSON received from the API

type ResponseFileSearchToolCallResultAttributeUnionParam struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	OfBool   param.Opt[bool]    `json:",omitzero,inline"`
	
}

Only one field can be non-zero.

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

type ResponseFileSearchToolCallStatus string

The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,

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.

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.

Structured Outputs configuration options, including a JSON Schema.

This is an alias to an internal type.

Structured Outputs configuration options, including a JSON Schema.

This is an alias to an internal type.

Default response format. Used to generate text responses.

This is an alias to an internal type.

ResponseFormatTextConfigUnion contains all possible properties and values from shared.ResponseFormatText, ResponseFormatTextJSONSchemaConfig, shared.ResponseFormatJSONObject.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseFormatTextConfigUnion.AsAny().(type) {
case shared.ResponseFormatText:
case responses.ResponseFormatTextJSONSchemaConfig:
case shared.ResponseFormatJSONObject:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

ToParam converts this ResponseFormatTextConfigUnion to a ResponseFormatTextConfigUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFormatTextConfigUnionParam.Overrides()

Only one field can be non-zero.

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

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

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

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

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

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

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

Returns the unmodified JSON received from the API

ToParam converts this ResponseFormatTextJSONSchemaConfig to a ResponseFormatTextJSONSchemaConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFormatTextJSONSchemaConfigParam.Overrides()

Default response format. Used to generate text responses.

This is an alias to an internal type.

Emitted when there is a partial function-call arguments delta.

Returns the unmodified JSON received from the API

Emitted when function-call arguments are finalized.

Returns the unmodified JSON received from the API

A tool call to run a function. See the [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

Returns the unmodified JSON received from the API

ToParam converts this ResponseFunctionToolCall to a ResponseFunctionToolCallParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFunctionToolCallParam.Overrides()

Returns the unmodified JSON received from the API

type ResponseFunctionToolCallOutputItemStatus string

The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

type ResponseFunctionToolCallStatus string

The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

The results of a web search tool call. See the [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.

Returns the unmodified JSON received from the API

ToParam converts this ResponseFunctionWebSearch to a ResponseFunctionWebSearchParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFunctionWebSearchParam.Overrides()

Action type "find": Searches for a pattern within a loaded page.

Returns the unmodified JSON received from the API

type ResponseFunctionWebSearchActionFindParam struct {
	
	Pattern string `json:"pattern,required"`
	
	URL string `json:"url,required" format:"uri"`
	
	
	
	Type constant.Find `json:"type,required"`
	
}

Action type "find": Searches for a pattern within a loaded page.

The properties Pattern, Type, URL are required.

Action type "open_page" - Opens a specific URL from search results.

Returns the unmodified JSON received from the API

type ResponseFunctionWebSearchActionOpenPageParam struct {
	
	URL string `json:"url,required" format:"uri"`
	
	
	
	Type constant.OpenPage `json:"type,required"`
	
}

Action type "open_page" - Opens a specific URL from search results.

The properties Type, URL are required.

Action type "search" - Performs a web search query.

Returns the unmodified JSON received from the API

type ResponseFunctionWebSearchActionSearchParam struct {
	
	Query string `json:"query,required"`
	
	
	
	Type constant.Search `json:"type,required"`
	
}

Action type "search" - Performs a web search query.

The properties Query, Type are required.

Only one field can be non-zero.

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

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

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

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

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

type ResponseFunctionWebSearchStatus string

The status of the web search tool call.

type ResponseGetParams struct {
	
	StartingAfter param.Opt[int64] `query:"starting_after,omitzero" json:"-"`
	
	
	Include []ResponseIncludable `query:"include,omitzero" json:"-"`
	
}

Emitted when an image generation tool call has completed and the final image is available.

Returns the unmodified JSON received from the API

Emitted when an image generation tool call is actively generating an image (intermediate state).

Returns the unmodified JSON received from the API

Emitted when an image generation tool call is in progress.

Returns the unmodified JSON received from the API

Emitted when a partial image is available during image generation streaming.

Returns the unmodified JSON received from the API

Emitted when the response is in progress.

Returns the unmodified JSON received from the API

type ResponseIncludable string

Specify additional output data to include in the model response. Currently supported values are:

const (
	ResponseIncludableCodeInterpreterCallOutputs       ResponseIncludable = "code_interpreter_call.outputs"
	ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url"
	ResponseIncludableFileSearchCallResults            ResponseIncludable = "file_search_call.results"
	ResponseIncludableMessageInputImageImageURL        ResponseIncludable = "message.input_image.image_url"
	ResponseIncludableMessageOutputTextLogprobs        ResponseIncludable = "message.output_text.logprobs"
	ResponseIncludableReasoningEncryptedContent        ResponseIncludable = "reasoning.encrypted_content"
)

Details about why the response is incomplete.

Returns the unmodified JSON received from the API

An event that is emitted when a response finishes as incomplete.

Returns the unmodified JSON received from the API

ResponseInputContentUnion contains all possible properties and values from ResponseInputText, ResponseInputImage, ResponseInputFile.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseInputContentUnion.AsAny().(type) {
case responses.ResponseInputText:
case responses.ResponseInputImage:
case responses.ResponseInputFile:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

ToParam converts this ResponseInputContentUnion to a ResponseInputContentUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseInputContentUnionParam.Overrides()

Only one field can be non-zero.

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

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

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

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

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

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

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

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

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

A file input to the model.

Returns the unmodified JSON received from the API

ToParam converts this ResponseInputFile to a ResponseInputFileParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseInputFileParam.Overrides()

A file input to the model.

The property Type is required.

An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

Returns the unmodified JSON received from the API

ToParam converts this ResponseInputImage to a ResponseInputImageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseInputImageParam.Overrides()

type ResponseInputImageDetail string

The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.

The output of a computer tool call.

Returns the unmodified JSON received from the API

A pending safety check for the computer call.

Returns the unmodified JSON received from the API

type ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckParam struct {
	
	ID string `json:"id,required"`
	
	Code param.Opt[string] `json:"code,omitzero"`
	
	Message param.Opt[string] `json:"message,omitzero"`
	
}

A pending safety check for the computer call.

The property ID is required.

The output of a computer tool call.

The properties CallID, Output, Type are required.

The output of a function tool call.

Returns the unmodified JSON received from the API

The output of a function tool call.

The properties CallID, Output, Type are required.

An image generation request made by the model.

Returns the unmodified JSON received from the API

An image generation request made by the model.

The properties ID, Result, Status, Type are required.

An internal identifier for an item to reference.

Returns the unmodified JSON received from the API

type ResponseInputItemItemReferenceParam struct {
	
	ID string `json:"id,required"`
	
	
	
	Type string `json:"type,omitzero"`
	
}

An internal identifier for an item to reference.

The property ID is required.

A tool call to run a command on the local shell.

Returns the unmodified JSON received from the API

Execute a shell command on the server.

Returns the unmodified JSON received from the API

type ResponseInputItemLocalShellCallActionParam struct {
	
	Command []string `json:"command,omitzero,required"`
	
	Env map[string]string `json:"env,omitzero,required"`
	
	TimeoutMs param.Opt[int64] `json:"timeout_ms,omitzero"`
	
	User param.Opt[string] `json:"user,omitzero"`
	
	WorkingDirectory param.Opt[string] `json:"working_directory,omitzero"`
	
	
	
	Type constant.Exec `json:"type,required"`
	
}

Execute a shell command on the server.

The properties Command, Env, Type are required.

The output of a local shell tool call.

Returns the unmodified JSON received from the API

The output of a local shell tool call.

The properties ID, Output, Type are required.

A tool call to run a command on the local shell.

The properties ID, Action, CallID, Status, Type are required.

A request for human approval of a tool invocation.

Returns the unmodified JSON received from the API

type ResponseInputItemMcpApprovalRequestParam struct {
	
	ID string `json:"id,required"`
	
	Arguments string `json:"arguments,required"`
	
	Name string `json:"name,required"`
	
	ServerLabel string `json:"server_label,required"`
	
	
	
	
	Type constant.McpApprovalRequest `json:"type,required"`
	
}

A request for human approval of a tool invocation.

The properties ID, Arguments, Name, ServerLabel, Type are required.

A response to an MCP approval request.

Returns the unmodified JSON received from the API

A response to an MCP approval request.

The properties ApprovalRequestID, Approve, Type are required.

An invocation of a tool on an MCP server.

Returns the unmodified JSON received from the API

type ResponseInputItemMcpCallParam struct {
	
	ID string `json:"id,required"`
	
	Arguments string `json:"arguments,required"`
	
	Name string `json:"name,required"`
	
	ServerLabel string `json:"server_label,required"`
	
	Error param.Opt[string] `json:"error,omitzero"`
	
	Output param.Opt[string] `json:"output,omitzero"`
	
	
	
	Type constant.McpCall `json:"type,required"`
	
}

An invocation of a tool on an MCP server.

The properties ID, Arguments, Name, ServerLabel, Type are required.

A list of tools available on an MCP server.

Returns the unmodified JSON received from the API

A list of tools available on an MCP server.

The properties ID, ServerLabel, Tools, Type are required.

A tool available on an MCP server.

Returns the unmodified JSON received from the API

type ResponseInputItemMcpListToolsToolParam struct {
	
	InputSchema any `json:"input_schema,omitzero,required"`
	
	Name string `json:"name,required"`
	
	Description param.Opt[string] `json:"description,omitzero"`
	
	Annotations any `json:"annotations,omitzero"`
	
}

A tool available on an MCP server.

The properties InputSchema, Name are required.

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role.

Returns the unmodified JSON received from the API

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role.

The properties Content, Role are required.

ResponseInputItemUnion contains all possible properties and values from EasyInputMessage, ResponseInputItemMessage, ResponseOutputMessage, ResponseFileSearchToolCall, ResponseComputerToolCall, ResponseInputItemComputerCallOutput, ResponseFunctionWebSearch, ResponseFunctionToolCall, ResponseInputItemFunctionCallOutput, ResponseReasoningItem, ResponseInputItemImageGenerationCall, ResponseCodeInterpreterToolCall, ResponseInputItemLocalShellCall, ResponseInputItemLocalShellCallOutput, ResponseInputItemMcpListTools, ResponseInputItemMcpApprovalRequest, ResponseInputItemMcpApprovalResponse, ResponseInputItemMcpCall, ResponseInputItemItemReference.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseInputItemUnion.AsAny().(type) {
case responses.EasyInputMessage:
case responses.ResponseInputItemMessage:
case responses.ResponseOutputMessage:
case responses.ResponseFileSearchToolCall:
case responses.ResponseComputerToolCall:
case responses.ResponseInputItemComputerCallOutput:
case responses.ResponseFunctionWebSearch:
case responses.ResponseFunctionToolCall:
case responses.ResponseInputItemFunctionCallOutput:
case responses.ResponseReasoningItem:
case responses.ResponseInputItemImageGenerationCall:
case responses.ResponseCodeInterpreterToolCall:
case responses.ResponseInputItemLocalShellCall:
case responses.ResponseInputItemLocalShellCallOutput:
case responses.ResponseInputItemMcpListTools:
case responses.ResponseInputItemMcpApprovalRequest:
case responses.ResponseInputItemMcpApprovalResponse:
case responses.ResponseInputItemMcpCall:
case responses.ResponseInputItemItemReference:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

ToParam converts this ResponseInputItemUnion to a ResponseInputItemUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseInputItemUnionParam.Overrides()

ResponseInputItemUnionAction is an implicit subunion of ResponseInputItemUnion. ResponseInputItemUnionAction provides convenient access to the sub-properties of the union.

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

ResponseInputItemUnionContent is an implicit subunion of ResponseInputItemUnion. ResponseInputItemUnionContent provides convenient access to the sub-properties of the union.

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

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

ResponseInputItemUnionOutput is an implicit subunion of ResponseInputItemUnion. ResponseInputItemUnionOutput provides convenient access to the sub-properties of the union.

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

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

type ResponseInputItemUnionParam struct {
	OfMessage              *EasyInputMessageParam                      `json:",omitzero,inline"`
	OfInputMessage         *ResponseInputItemMessageParam              `json:",omitzero,inline"`
	OfOutputMessage        *ResponseOutputMessageParam                 `json:",omitzero,inline"`
	OfFileSearchCall       *ResponseFileSearchToolCallParam            `json:",omitzero,inline"`
	OfComputerCall         *ResponseComputerToolCallParam              `json:",omitzero,inline"`
	OfComputerCallOutput   *ResponseInputItemComputerCallOutputParam   `json:",omitzero,inline"`
	OfWebSearchCall        *ResponseFunctionWebSearchParam             `json:",omitzero,inline"`
	OfFunctionCall         *ResponseFunctionToolCallParam              `json:",omitzero,inline"`
	OfFunctionCallOutput   *ResponseInputItemFunctionCallOutputParam   `json:",omitzero,inline"`
	OfReasoning            *ResponseReasoningItemParam                 `json:",omitzero,inline"`
	OfImageGenerationCall  *ResponseInputItemImageGenerationCallParam  `json:",omitzero,inline"`
	OfCodeInterpreterCall  *ResponseCodeInterpreterToolCallParam       `json:",omitzero,inline"`
	OfLocalShellCall       *ResponseInputItemLocalShellCallParam       `json:",omitzero,inline"`
	OfLocalShellCallOutput *ResponseInputItemLocalShellCallOutputParam `json:",omitzero,inline"`
	OfMcpListTools         *ResponseInputItemMcpListToolsParam         `json:",omitzero,inline"`
	OfMcpApprovalRequest   *ResponseInputItemMcpApprovalRequestParam   `json:",omitzero,inline"`
	OfMcpApprovalResponse  *ResponseInputItemMcpApprovalResponseParam  `json:",omitzero,inline"`
	OfMcpCall              *ResponseInputItemMcpCallParam              `json:",omitzero,inline"`
	OfItemReference        *ResponseInputItemItemReferenceParam        `json:",omitzero,inline"`
	
}

Only one field can be non-zero.

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

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

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

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

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

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

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

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

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

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

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

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

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

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

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

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

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

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

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

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

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

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

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

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

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

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

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

Returns the unmodified JSON received from the API

type ResponseInputMessageItemRole string

The role of the message input. One of `user`, `system`, or `developer`.

type ResponseInputMessageItemStatus string

The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

type ResponseInputMessageItemType string

The type of the message input. Always set to `message`.

A text input to the model.

Returns the unmodified JSON received from the API

ToParam converts this ResponseInputText to a ResponseInputTextParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseInputTextParam.Overrides()

type ResponseInputTextParam struct {
	
	Text string `json:"text,required"`
	
	
	
	Type constant.InputText `json:"type,required"`
	
}

A text input to the model.

The properties Text, Type are required.

ResponseInstructionsUnion contains all possible properties and values from [string], [[]ResponseInputItemUnion].

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: OfString OfInputItemList]

Returns the unmodified JSON received from the API

An image generation request made by the model.

Returns the unmodified JSON received from the API

A list of Response items.

Returns the unmodified JSON received from the API

A tool call to run a command on the local shell.

Returns the unmodified JSON received from the API

Execute a shell command on the server.

Returns the unmodified JSON received from the API

The output of a local shell tool call.

Returns the unmodified JSON received from the API

A request for human approval of a tool invocation.

Returns the unmodified JSON received from the API

A response to an MCP approval request.

Returns the unmodified JSON received from the API

An invocation of a tool on an MCP server.

Returns the unmodified JSON received from the API

A list of tools available on an MCP server.

Returns the unmodified JSON received from the API

A tool available on an MCP server.

Returns the unmodified JSON received from the API

ResponseItemUnion contains all possible properties and values from ResponseInputMessageItem, ResponseOutputMessage, ResponseFileSearchToolCall, ResponseComputerToolCall, ResponseComputerToolCallOutputItem, ResponseFunctionWebSearch, ResponseFunctionToolCallItem, ResponseFunctionToolCallOutputItem, ResponseItemImageGenerationCall, ResponseCodeInterpreterToolCall, ResponseItemLocalShellCall, ResponseItemLocalShellCallOutput, ResponseItemMcpListTools, ResponseItemMcpApprovalRequest, ResponseItemMcpApprovalResponse, ResponseItemMcpCall.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseItemUnion.AsAny().(type) {
case responses.ResponseInputMessageItem:
case responses.ResponseOutputMessage:
case responses.ResponseFileSearchToolCall:
case responses.ResponseComputerToolCall:
case responses.ResponseComputerToolCallOutputItem:
case responses.ResponseFunctionWebSearch:
case responses.ResponseFunctionToolCallItem:
case responses.ResponseFunctionToolCallOutputItem:
case responses.ResponseItemImageGenerationCall:
case responses.ResponseCodeInterpreterToolCall:
case responses.ResponseItemLocalShellCall:
case responses.ResponseItemLocalShellCallOutput:
case responses.ResponseItemMcpListTools:
case responses.ResponseItemMcpApprovalRequest:
case responses.ResponseItemMcpApprovalResponse:
case responses.ResponseItemMcpCall:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

ResponseItemUnionAction is an implicit subunion of ResponseItemUnion. ResponseItemUnionAction provides convenient access to the sub-properties of the union.

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

ResponseItemUnionContent is an implicit subunion of ResponseItemUnion. ResponseItemUnionContent provides convenient access to the sub-properties of the union.

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

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

ResponseItemUnionOutput is an implicit subunion of ResponseItemUnion. ResponseItemUnionOutput provides convenient access to the sub-properties of the union.

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

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

Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

Returns the unmodified JSON received from the API

Emitted when the arguments for an MCP tool call are finalized.

Returns the unmodified JSON received from the API

Emitted when an MCP tool call has completed successfully.

Returns the unmodified JSON received from the API

Emitted when an MCP tool call has failed.

Returns the unmodified JSON received from the API

Emitted when an MCP tool call is in progress.

Returns the unmodified JSON received from the API

Emitted when the list of available MCP tools has been successfully retrieved.

Returns the unmodified JSON received from the API

Emitted when the attempt to list available MCP tools has failed.

Returns the unmodified JSON received from the API

Emitted when the system is in the process of retrieving the list of available MCP tools.

Returns the unmodified JSON received from the API

type ResponseNewParams struct {
	
	
	Background param.Opt[bool] `json:"background,omitzero"`
	
	
	
	
	
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	
	
	
	MaxOutputTokens param.Opt[int64] `json:"max_output_tokens,omitzero"`
	
	
	
	
	MaxToolCalls param.Opt[int64] `json:"max_tool_calls,omitzero"`
	
	ParallelToolCalls param.Opt[bool] `json:"parallel_tool_calls,omitzero"`
	
	
	
	PreviousResponseID param.Opt[string] `json:"previous_response_id,omitzero"`
	
	Store param.Opt[bool] `json:"store,omitzero"`
	
	
	
	
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	
	
	TopLogprobs param.Opt[int64] `json:"top_logprobs,omitzero"`
	
	
	
	
	
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	
	
	
	PromptCacheKey param.Opt[string] `json:"prompt_cache_key,omitzero"`
	
	
	
	
	
	SafetyIdentifier param.Opt[string] `json:"safety_identifier,omitzero"`
	
	
	
	
	
	User param.Opt[string] `json:"user,omitzero"`
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	Include []ResponseIncludable `json:"include,omitzero"`
	
	
	
	
	
	
	Metadata shared.Metadata `json:"metadata,omitzero"`
	
	
	Prompt ResponsePromptParam `json:"prompt,omitzero"`
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	ServiceTier ResponseNewParamsServiceTier `json:"service_tier,omitzero"`
	
	
	
	
	
	
	
	
	
	Truncation ResponseNewParamsTruncation `json:"truncation,omitzero"`
	
	
	
	
	
	
	
	
	
	Input ResponseNewParamsInputUnion `json:"input,omitzero"`
	
	
	
	
	
	Model shared.ResponsesModel `json:"model,omitzero"`
	
	
	
	
	Reasoning shared.ReasoningParam `json:"reasoning,omitzero"`
	
	
	
	
	
	Text ResponseTextConfigParam `json:"text,omitzero"`
	
	
	
	ToolChoice ResponseNewParamsToolChoiceUnion `json:"tool_choice,omitzero"`
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	Tools []ToolUnionParam `json:"tools,omitzero"`
	
}

Only one field can be non-zero.

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

type ResponseNewParamsServiceTier string

Specifies the processing type used for serving the request.

When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

Only one field can be non-zero.

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

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

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

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

type ResponseNewParamsTruncation string

The truncation strategy to use for the model response.

Emitted when a new output item is added.

Returns the unmodified JSON received from the API

Emitted when an output item is marked done.

Returns the unmodified JSON received from the API

An image generation request made by the model.

Returns the unmodified JSON received from the API

A tool call to run a command on the local shell.

Returns the unmodified JSON received from the API

Execute a shell command on the server.

Returns the unmodified JSON received from the API

A request for human approval of a tool invocation.

Returns the unmodified JSON received from the API

An invocation of a tool on an MCP server.

Returns the unmodified JSON received from the API

A list of tools available on an MCP server.

Returns the unmodified JSON received from the API

A tool available on an MCP server.

Returns the unmodified JSON received from the API

ResponseOutputItemUnion contains all possible properties and values from ResponseOutputMessage, ResponseFileSearchToolCall, ResponseFunctionToolCall, ResponseFunctionWebSearch, ResponseComputerToolCall, ResponseReasoningItem, ResponseOutputItemImageGenerationCall, ResponseCodeInterpreterToolCall, ResponseOutputItemLocalShellCall, ResponseOutputItemMcpCall, ResponseOutputItemMcpListTools, ResponseOutputItemMcpApprovalRequest.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseOutputItemUnion.AsAny().(type) {
case responses.ResponseOutputMessage:
case responses.ResponseFileSearchToolCall:
case responses.ResponseFunctionToolCall:
case responses.ResponseFunctionWebSearch:
case responses.ResponseComputerToolCall:
case responses.ResponseReasoningItem:
case responses.ResponseOutputItemImageGenerationCall:
case responses.ResponseCodeInterpreterToolCall:
case responses.ResponseOutputItemLocalShellCall:
case responses.ResponseOutputItemMcpCall:
case responses.ResponseOutputItemMcpListTools:
case responses.ResponseOutputItemMcpApprovalRequest:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

ResponseOutputItemUnionAction is an implicit subunion of ResponseOutputItemUnion. ResponseOutputItemUnionAction provides convenient access to the sub-properties of the union.

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

An output message from the model.

Returns the unmodified JSON received from the API

ToParam converts this ResponseOutputMessage to a ResponseOutputMessageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseOutputMessageParam.Overrides()

ResponseOutputMessageContentUnion contains all possible properties and values from ResponseOutputText, ResponseOutputRefusal.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseOutputMessageContentUnion.AsAny().(type) {
case responses.ResponseOutputText:
case responses.ResponseOutputRefusal:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

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

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

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

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

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

An output message from the model.

The properties ID, Content, Role, Status, Type are required.

type ResponseOutputMessageStatus string

The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

A refusal from the model.

Returns the unmodified JSON received from the API

ToParam converts this ResponseOutputRefusal to a ResponseOutputRefusalParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseOutputRefusalParam.Overrides()

type ResponseOutputRefusalParam struct {
	
	Refusal string `json:"refusal,required"`
	
	
	
	Type constant.Refusal `json:"type,required"`
	
}

A refusal from the model.

The properties Refusal, Type are required.

A text output from the model.

Returns the unmodified JSON received from the API

ToParam converts this ResponseOutputText to a ResponseOutputTextParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseOutputTextParam.Overrides()

Emitted when an annotation is added to output text content.

Returns the unmodified JSON received from the API

A citation for a container file used to generate a model response.

Returns the unmodified JSON received from the API

type ResponseOutputTextAnnotationContainerFileCitationParam struct {
	
	ContainerID string `json:"container_id,required"`
	
	EndIndex int64 `json:"end_index,required"`
	
	FileID string `json:"file_id,required"`
	
	Filename string `json:"filename,required"`
	
	StartIndex int64 `json:"start_index,required"`
	
	
	
	
	Type constant.ContainerFileCitation `json:"type,required"`
	
}

A citation for a container file used to generate a model response.

The properties ContainerID, EndIndex, FileID, Filename, StartIndex, Type are required.

A citation to a file.

Returns the unmodified JSON received from the API

type ResponseOutputTextAnnotationFileCitationParam struct {
	
	FileID string `json:"file_id,required"`
	
	Filename string `json:"filename,required"`
	
	Index int64 `json:"index,required"`
	
	
	
	Type constant.FileCitation `json:"type,required"`
	
}

A citation to a file.

The properties FileID, Filename, Index, Type are required.

A path to a file.

Returns the unmodified JSON received from the API

type ResponseOutputTextAnnotationFilePathParam struct {
	
	FileID string `json:"file_id,required"`
	
	Index int64 `json:"index,required"`
	
	
	
	Type constant.FilePath `json:"type,required"`
	
}

A path to a file.

The properties FileID, Index, Type are required.

A citation for a web resource used to generate a model response.

Returns the unmodified JSON received from the API

type ResponseOutputTextAnnotationURLCitationParam struct {
	
	EndIndex int64 `json:"end_index,required"`
	
	StartIndex int64 `json:"start_index,required"`
	
	Title string `json:"title,required"`
	
	URL string `json:"url,required"`
	
	
	
	Type constant.URLCitation `json:"type,required"`
	
}

A citation for a web resource used to generate a model response.

The properties EndIndex, StartIndex, Title, Type, URL are required.

Only one field can be non-zero.

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

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

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

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

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

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

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

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

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

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

The log probability of a token.

Returns the unmodified JSON received from the API

The log probability of a token.

The properties Token, Bytes, Logprob, TopLogprobs are required.

The top log probability of a token.

Returns the unmodified JSON received from the API

type ResponseOutputTextLogprobTopLogprobParam struct {
	Token   string  `json:"token,required"`
	Bytes   []int64 `json:"bytes,omitzero,required"`
	Logprob float64 `json:"logprob,required"`
	
}

The top log probability of a token.

The properties Token, Bytes, Logprob are required.

A text output from the model.

The properties Annotations, Text, Type are required.

Reference to a prompt template and its variables. [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

Returns the unmodified JSON received from the API

ToParam converts this ResponsePrompt to a ResponsePromptParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponsePromptParam.Overrides()

ResponsePromptVariableUnion contains all possible properties and values from [string], ResponseInputText, ResponseInputImage, ResponseInputFile.

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: OfString]

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

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

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

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

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

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

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

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

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

Emitted when a response is queued and waiting to be processed.

Returns the unmodified JSON received from the API

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your `input` to the Responses API for subsequent turns of a conversation if you are manually [managing context](https://platform.openai.com/docs/guides/conversation-state).

Returns the unmodified JSON received from the API

ToParam converts this ResponseReasoningItem to a ResponseReasoningItemParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseReasoningItemParam.Overrides()

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your `input` to the Responses API for subsequent turns of a conversation if you are manually [managing context](https://platform.openai.com/docs/guides/conversation-state).

The properties ID, Summary, Type are required.

type ResponseReasoningItemStatus string

The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

Returns the unmodified JSON received from the API

type ResponseReasoningItemSummaryParam struct {
	
	Text string `json:"text,required"`
	
	
	
	Type constant.SummaryText `json:"type,required"`
	
}

The properties Text, Type are required.

Emitted when there is a delta (partial update) to the reasoning summary content.

Returns the unmodified JSON received from the API

Emitted when the reasoning summary content is finalized for an item.

Returns the unmodified JSON received from the API

Emitted when a new reasoning summary part is added.

Returns the unmodified JSON received from the API

The summary part that was added.

Returns the unmodified JSON received from the API

Emitted when a reasoning summary part is completed.

Returns the unmodified JSON received from the API

The completed summary part.

Returns the unmodified JSON received from the API

Emitted when a delta is added to a reasoning summary text.

Returns the unmodified JSON received from the API

Emitted when a reasoning summary text is completed.

Returns the unmodified JSON received from the API

Emitted when there is a partial refusal text.

Returns the unmodified JSON received from the API

Emitted when refusal text is finalized.

Returns the unmodified JSON received from the API

ResponseService 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 NewResponseService method instead.

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

Deletes a model response with the given ID.

Retrieves a model response with the given ID.

Retrieves a model response with the given ID.

type ResponseServiceTier string

Specifies the processing type used for serving the request.

When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`.

ResponseStreamEventUnion contains all possible properties and values from ResponseAudioDeltaEvent, ResponseAudioDoneEvent, ResponseAudioTranscriptDeltaEvent, ResponseAudioTranscriptDoneEvent, ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, ResponseCodeInterpreterCallCompletedEvent, ResponseCodeInterpreterCallInProgressEvent, ResponseCodeInterpreterCallInterpretingEvent, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, ResponseCreatedEvent, ResponseErrorEvent, ResponseFileSearchCallCompletedEvent, ResponseFileSearchCallInProgressEvent, ResponseFileSearchCallSearchingEvent, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseInProgressEvent, ResponseFailedEvent, ResponseIncompleteEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseReasoningSummaryPartAddedEvent, ResponseReasoningSummaryPartDoneEvent, ResponseReasoningSummaryTextDeltaEvent, ResponseReasoningSummaryTextDoneEvent, ResponseRefusalDeltaEvent, ResponseRefusalDoneEvent, ResponseTextDeltaEvent, ResponseTextDoneEvent, ResponseWebSearchCallCompletedEvent, ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent, ResponseImageGenCallCompletedEvent, ResponseImageGenCallGeneratingEvent, ResponseImageGenCallInProgressEvent, ResponseImageGenCallPartialImageEvent, ResponseMcpCallArgumentsDeltaEvent, ResponseMcpCallArgumentsDoneEvent, ResponseMcpCallCompletedEvent, ResponseMcpCallFailedEvent, ResponseMcpCallInProgressEvent, ResponseMcpListToolsCompletedEvent, ResponseMcpListToolsFailedEvent, ResponseMcpListToolsInProgressEvent, ResponseOutputTextAnnotationAddedEvent, ResponseQueuedEvent, ResponseReasoningSummaryDeltaEvent, ResponseReasoningSummaryDoneEvent.

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

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

Use the following switch statement to find the correct variant

switch variant := ResponseStreamEventUnion.AsAny().(type) {
case responses.ResponseAudioDeltaEvent:
case responses.ResponseAudioDoneEvent:
case responses.ResponseAudioTranscriptDeltaEvent:
case responses.ResponseAudioTranscriptDoneEvent:
case responses.ResponseCodeInterpreterCallCodeDeltaEvent:
case responses.ResponseCodeInterpreterCallCodeDoneEvent:
case responses.ResponseCodeInterpreterCallCompletedEvent:
case responses.ResponseCodeInterpreterCallInProgressEvent:
case responses.ResponseCodeInterpreterCallInterpretingEvent:
case responses.ResponseCompletedEvent:
case responses.ResponseContentPartAddedEvent:
case responses.ResponseContentPartDoneEvent:
case responses.ResponseCreatedEvent:
case responses.ResponseErrorEvent:
case responses.ResponseFileSearchCallCompletedEvent:
case responses.ResponseFileSearchCallInProgressEvent:
case responses.ResponseFileSearchCallSearchingEvent:
case responses.ResponseFunctionCallArgumentsDeltaEvent:
case responses.ResponseFunctionCallArgumentsDoneEvent:
case responses.ResponseInProgressEvent:
case responses.ResponseFailedEvent:
case responses.ResponseIncompleteEvent:
case responses.ResponseOutputItemAddedEvent:
case responses.ResponseOutputItemDoneEvent:
case responses.ResponseReasoningSummaryPartAddedEvent:
case responses.ResponseReasoningSummaryPartDoneEvent:
case responses.ResponseReasoningSummaryTextDeltaEvent:
case responses.ResponseReasoningSummaryTextDoneEvent:
case responses.ResponseRefusalDeltaEvent:
case responses.ResponseRefusalDoneEvent:
case responses.ResponseTextDeltaEvent:
case responses.ResponseTextDoneEvent:
case responses.ResponseWebSearchCallCompletedEvent:
case responses.ResponseWebSearchCallInProgressEvent:
case responses.ResponseWebSearchCallSearchingEvent:
case responses.ResponseImageGenCallCompletedEvent:
case responses.ResponseImageGenCallGeneratingEvent:
case responses.ResponseImageGenCallInProgressEvent:
case responses.ResponseImageGenCallPartialImageEvent:
case responses.ResponseMcpCallArgumentsDeltaEvent:
case responses.ResponseMcpCallArgumentsDoneEvent:
case responses.ResponseMcpCallCompletedEvent:
case responses.ResponseMcpCallFailedEvent:
case responses.ResponseMcpCallInProgressEvent:
case responses.ResponseMcpListToolsCompletedEvent:
case responses.ResponseMcpListToolsFailedEvent:
case responses.ResponseMcpListToolsInProgressEvent:
case responses.ResponseOutputTextAnnotationAddedEvent:
case responses.ResponseQueuedEvent:
case responses.ResponseReasoningSummaryDeltaEvent:
case responses.ResponseReasoningSummaryDoneEvent:
default:
  fmt.Errorf("no variant present")
}

Returns the unmodified JSON received from the API

type ResponseStreamEventUnionDelta struct {
	
	OfString string `json:",inline"`
	
	OfResponseReasoningSummaryDeltaEventDelta any `json:",inline"`
	JSON                                      struct {
		OfString                                  respjson.Field
		OfResponseReasoningSummaryDeltaEventDelta respjson.Field
		
	} `json:"-"`
}

ResponseStreamEventUnionDelta is an implicit subunion of ResponseStreamEventUnion. ResponseStreamEventUnionDelta provides convenient access to the sub-properties of the union.

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

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

ResponseStreamEventUnionLogprobs is an implicit subunion of ResponseStreamEventUnion. ResponseStreamEventUnionLogprobs provides convenient access to the sub-properties of the union.

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

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

ResponseStreamEventUnionPart is an implicit subunion of ResponseStreamEventUnion. ResponseStreamEventUnionPart provides convenient access to the sub-properties of the union.

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

Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:

- [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)

Returns the unmodified JSON received from the API

ToParam converts this ResponseTextConfig to a ResponseTextConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseTextConfigParam.Overrides()

Emitted when there is an additional text delta.

Returns the unmodified JSON received from the API

A logprob is the logarithmic probability that the model assigns to producing a particular token at a given position in the sequence. Less-negative (higher) logprob values indicate greater model confidence in that token choice.

Returns the unmodified JSON received from the API

Returns the unmodified JSON received from the API

Emitted when text content is finalized.

Returns the unmodified JSON received from the API

A logprob is the logarithmic probability that the model assigns to producing a particular token at a given position in the sequence. Less-negative (higher) logprob values indicate greater model confidence in that token choice.

Returns the unmodified JSON received from the API

Returns the unmodified JSON received from the API

ResponseToolChoiceUnion contains all possible properties and values from ToolChoiceOptions, ToolChoiceTypes, ToolChoiceFunction, ToolChoiceMcp.

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: OfToolChoiceMode]

Returns the unmodified JSON received from the API

type ResponseTruncation string

The truncation strategy to use for the model response.

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.

Returns the unmodified JSON received from the API

type ResponseUsageInputTokensDetails struct {
	
	
	CachedTokens int64 `json:"cached_tokens,required"`
	
	JSON struct {
		CachedTokens respjson.Field
		ExtraFields  map[string]respjson.Field
		
	} `json:"-"`
}

A detailed breakdown of the input tokens.

Returns the unmodified JSON received from the API

type ResponseUsageOutputTokensDetails struct {
	
	ReasoningTokens int64 `json:"reasoning_tokens,required"`
	
	JSON struct {
		ReasoningTokens respjson.Field
		ExtraFields     map[string]respjson.Field
		
	} `json:"-"`
}

A detailed breakdown of the output tokens.

Returns the unmodified JSON received from the API

Emitted when a web search call is completed.

Returns the unmodified JSON received from the API

Emitted when a web search call is initiated.

Returns the unmodified JSON received from the API

Emitted when a web search call is executing.

Returns the unmodified JSON received from the API

This is an alias to an internal type.

Use this option to force the model to call a specific function.

Returns the unmodified JSON received from the API

ToParam converts this ToolChoiceFunction to a ToolChoiceFunctionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolChoiceFunctionParam.Overrides()

type ToolChoiceFunctionParam struct {
	
	Name string `json:"name,required"`
	
	
	
	Type constant.Function `json:"type,required"`
	
}

Use this option to force the model to call a specific function.

The properties Name, Type are required.

Use this option to force the model to call a specific tool on a remote MCP server.

Returns the unmodified JSON received from the API

ToParam converts this ToolChoiceMcp to a ToolChoiceMcpParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolChoiceMcpParam.Overrides()

type ToolChoiceMcpParam struct {
	
	ServerLabel string `json:"server_label,required"`
	
	Name param.Opt[string] `json:"name,omitzero"`
	
	
	
	Type constant.Mcp `json:"type,required"`
	
}

Use this option to force the model to call a specific tool on a remote MCP server.

The properties ServerLabel, Type are required.

Controls which (if any) tool is called by the model.

`none` means the model will not call any tool and instead generates a message.

`auto` means the model can pick between generating a message or calling one or more tools.

`required` means the model must call one or more tools.

Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).

Returns the unmodified JSON received from the API

ToParam converts this ToolChoiceTypes to a ToolChoiceTypesParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolChoiceTypesParam.Overrides()

type ToolChoiceTypesType string

The type of hosted tool the model should to use. Learn more about [built-in tools](https://platform.openai.com/docs/guides/tools).

Allowed values are:

- `file_search` - `web_search_preview` - `computer_use_preview` - `code_interpreter` - `image_generation`

A tool that runs Python code to help generate a response to a prompt.

Returns the unmodified JSON received from the API

Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

Returns the unmodified JSON received from the API

type ToolCodeInterpreterContainerCodeInterpreterContainerAutoParam struct {
	
	FileIDs []string `json:"file_ids,omitzero"`
	
	
	
	Type constant.Auto `json:"type,required"`
	
}

Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

The property Type is required.

ToolCodeInterpreterContainerUnion contains all possible properties and values from [string], ToolCodeInterpreterContainerCodeInterpreterContainerAuto.

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: OfString]

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

A tool that runs Python code to help generate a response to a prompt.

The properties Container, Type are required.

A tool that generates images using a model like `gpt-image-1`.

Returns the unmodified JSON received from the API

Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional).

Returns the unmodified JSON received from the API

type ToolImageGenerationInputImageMaskParam struct {
	
	FileID param.Opt[string] `json:"file_id,omitzero"`
	
	ImageURL param.Opt[string] `json:"image_url,omitzero"`
	
}

Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional).

type ToolImageGenerationParam struct {
	
	OutputCompression param.Opt[int64] `json:"output_compression,omitzero"`
	
	
	PartialImages param.Opt[int64] `json:"partial_images,omitzero"`
	
	
	
	
	
	InputFidelity string `json:"input_fidelity,omitzero"`
	
	
	
	
	Background string `json:"background,omitzero"`
	
	
	InputImageMask ToolImageGenerationInputImageMaskParam `json:"input_image_mask,omitzero"`
	
	
	
	Model string `json:"model,omitzero"`
	
	
	
	Moderation string `json:"moderation,omitzero"`
	
	
	
	
	OutputFormat string `json:"output_format,omitzero"`
	
	
	
	
	Quality string `json:"quality,omitzero"`
	
	
	
	
	Size string `json:"size,omitzero"`
	
	
	
	Type constant.ImageGeneration `json:"type,required"`
	
}

A tool that generates images using a model like `gpt-image-1`.

The property Type is required.

A tool that allows the model to execute shell commands in a local environment.

Returns the unmodified JSON received from the API

A tool that allows the model to execute shell commands in a local environment.

This struct has a constant value, construct it with NewToolLocalShellParam.

A filter object to specify which tools are allowed.

Returns the unmodified JSON received from the API

type ToolMcpAllowedToolsMcpAllowedToolsFilterParam struct {
	
	ToolNames []string `json:"tool_names,omitzero"`
	
}

A filter object to specify which tools are allowed.

type ToolMcpAllowedToolsUnion struct {
	
	OfMcpAllowedTools []string `json:",inline"`
	
	ToolNames []string `json:"tool_names"`
	JSON      struct {
		OfMcpAllowedTools respjson.Field
		ToolNames         respjson.Field
		
	} `json:"-"`
}

ToolMcpAllowedToolsUnion contains all possible properties and values from [[]string], ToolMcpAllowedToolsMcpAllowedToolsFilter.

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: OfMcpAllowedTools]

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

Returns the unmodified JSON received from the API

type ToolMcpRequireApprovalMcpToolApprovalFilterAlways struct {
	
	ToolNames []string `json:"tool_names"`
	
	JSON struct {
		ToolNames   respjson.Field
		ExtraFields map[string]respjson.Field
		
	} `json:"-"`
}

A list of tools that always require approval.

Returns the unmodified JSON received from the API

type ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysParam struct {
	
	ToolNames []string `json:"tool_names,omitzero"`
	
}

A list of tools that always require approval.

type ToolMcpRequireApprovalMcpToolApprovalFilterNever struct {
	
	ToolNames []string `json:"tool_names"`
	
	JSON struct {
		ToolNames   respjson.Field
		ExtraFields map[string]respjson.Field
		
	} `json:"-"`
}

A list of tools that never require approval.

Returns the unmodified JSON received from the API

type ToolMcpRequireApprovalMcpToolApprovalFilterNeverParam struct {
	
	ToolNames []string `json:"tool_names,omitzero"`
	
}

A list of tools that never require approval.

type ToolMcpRequireApprovalMcpToolApprovalSetting 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.

ToolMcpRequireApprovalUnion contains all possible properties and values from ToolMcpRequireApprovalMcpToolApprovalFilter, [string].

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: OfMcpToolApprovalSetting]

Returns the unmodified JSON received from the API

Only one field can be non-zero.

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

ToolUnion contains all possible properties and values from FunctionTool, FileSearchTool, WebSearchTool, ComputerTool, ToolMcp, ToolCodeInterpreter, ToolImageGeneration, ToolLocalShell.

Use the [ToolUnion.AsAny] method to switch on the variant.

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

Returns the unmodified JSON received from the API

ToParam converts this ToolUnion to a ToolUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolUnionParam.Overrides()

type ToolUnionParam struct {
	OfFunction           *FunctionToolParam        `json:",omitzero,inline"`
	OfFileSearch         *FileSearchToolParam      `json:",omitzero,inline"`
	OfWebSearchPreview   *WebSearchToolParam       `json:",omitzero,inline"`
	OfComputerUsePreview *ComputerToolParam        `json:",omitzero,inline"`
	OfMcp                *ToolMcpParam             `json:",omitzero,inline"`
	OfCodeInterpreter    *ToolCodeInterpreterParam `json:",omitzero,inline"`
	OfImageGeneration    *ToolImageGenerationParam `json:",omitzero,inline"`
	OfLocalShell         *ToolLocalShellParam      `json:",omitzero,inline"`
	
}

Only one field can be non-zero.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

Returns the unmodified JSON received from the API

ToParam converts this WebSearchTool to a WebSearchToolParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with WebSearchToolParam.Overrides()

type WebSearchToolSearchContextSize string

High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

const (
	WebSearchToolTypeWebSearchPreview           WebSearchToolType = "web_search_preview"
	WebSearchToolTypeWebSearchPreview2025_03_11 WebSearchToolType = "web_search_preview_2025_03_11"
)

The user's location.

Returns the unmodified JSON received from the API

The user's location.

The property Type is required.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4