aliases.go

  1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2
  3package openai
  4
  5import (
  6	"github.com/openai/openai-go/internal/apierror"
  7	"github.com/openai/openai-go/packages/param"
  8	"github.com/openai/openai-go/packages/resp"
  9	"github.com/openai/openai-go/shared"
 10)
 11
 12// aliased to make [param.APIUnion] private when embedding
 13type paramUnion = param.APIUnion
 14
 15// aliased to make [param.APIObject] private when embedding
 16type paramObj = param.APIObject
 17
 18type Error = apierror.Error
 19
 20// This is an alias to an internal type.
 21type ChatModel = shared.ChatModel
 22
 23// Equals "o3-mini"
 24const ChatModelO3Mini = shared.ChatModelO3Mini
 25
 26// Equals "o3-mini-2025-01-31"
 27const ChatModelO3Mini2025_01_31 = shared.ChatModelO3Mini2025_01_31
 28
 29// Equals "o1"
 30const ChatModelO1 = shared.ChatModelO1
 31
 32// Equals "o1-2024-12-17"
 33const ChatModelO1_2024_12_17 = shared.ChatModelO1_2024_12_17
 34
 35// Equals "o1-preview"
 36const ChatModelO1Preview = shared.ChatModelO1Preview
 37
 38// Equals "o1-preview-2024-09-12"
 39const ChatModelO1Preview2024_09_12 = shared.ChatModelO1Preview2024_09_12
 40
 41// Equals "o1-mini"
 42const ChatModelO1Mini = shared.ChatModelO1Mini
 43
 44// Equals "o1-mini-2024-09-12"
 45const ChatModelO1Mini2024_09_12 = shared.ChatModelO1Mini2024_09_12
 46
 47// Equals "gpt-4o"
 48const ChatModelGPT4o = shared.ChatModelGPT4o
 49
 50// Equals "gpt-4o-2024-11-20"
 51const ChatModelGPT4o2024_11_20 = shared.ChatModelGPT4o2024_11_20
 52
 53// Equals "gpt-4o-2024-08-06"
 54const ChatModelGPT4o2024_08_06 = shared.ChatModelGPT4o2024_08_06
 55
 56// Equals "gpt-4o-2024-05-13"
 57const ChatModelGPT4o2024_05_13 = shared.ChatModelGPT4o2024_05_13
 58
 59// Equals "gpt-4o-audio-preview"
 60const ChatModelGPT4oAudioPreview = shared.ChatModelGPT4oAudioPreview
 61
 62// Equals "gpt-4o-audio-preview-2024-10-01"
 63const ChatModelGPT4oAudioPreview2024_10_01 = shared.ChatModelGPT4oAudioPreview2024_10_01
 64
 65// Equals "gpt-4o-audio-preview-2024-12-17"
 66const ChatModelGPT4oAudioPreview2024_12_17 = shared.ChatModelGPT4oAudioPreview2024_12_17
 67
 68// Equals "gpt-4o-mini-audio-preview"
 69const ChatModelGPT4oMiniAudioPreview = shared.ChatModelGPT4oMiniAudioPreview
 70
 71// Equals "gpt-4o-mini-audio-preview-2024-12-17"
 72const ChatModelGPT4oMiniAudioPreview2024_12_17 = shared.ChatModelGPT4oMiniAudioPreview2024_12_17
 73
 74// Equals "gpt-4o-search-preview"
 75const ChatModelGPT4oSearchPreview = shared.ChatModelGPT4oSearchPreview
 76
 77// Equals "gpt-4o-mini-search-preview"
 78const ChatModelGPT4oMiniSearchPreview = shared.ChatModelGPT4oMiniSearchPreview
 79
 80// Equals "gpt-4o-search-preview-2025-03-11"
 81const ChatModelGPT4oSearchPreview2025_03_11 = shared.ChatModelGPT4oSearchPreview2025_03_11
 82
 83// Equals "gpt-4o-mini-search-preview-2025-03-11"
 84const ChatModelGPT4oMiniSearchPreview2025_03_11 = shared.ChatModelGPT4oMiniSearchPreview2025_03_11
 85
 86// Equals "chatgpt-4o-latest"
 87const ChatModelChatgpt4oLatest = shared.ChatModelChatgpt4oLatest
 88
 89// Equals "gpt-4o-mini"
 90const ChatModelGPT4oMini = shared.ChatModelGPT4oMini
 91
 92// Equals "gpt-4o-mini-2024-07-18"
 93const ChatModelGPT4oMini2024_07_18 = shared.ChatModelGPT4oMini2024_07_18
 94
 95// Equals "gpt-4-turbo"
 96const ChatModelGPT4Turbo = shared.ChatModelGPT4Turbo
 97
 98// Equals "gpt-4-turbo-2024-04-09"
 99const ChatModelGPT4Turbo2024_04_09 = shared.ChatModelGPT4Turbo2024_04_09
100
101// Equals "gpt-4-0125-preview"
102const ChatModelGPT4_0125Preview = shared.ChatModelGPT4_0125Preview
103
104// Equals "gpt-4-turbo-preview"
105const ChatModelGPT4TurboPreview = shared.ChatModelGPT4TurboPreview
106
107// Equals "gpt-4-1106-preview"
108const ChatModelGPT4_1106Preview = shared.ChatModelGPT4_1106Preview
109
110// Equals "gpt-4-vision-preview"
111const ChatModelGPT4VisionPreview = shared.ChatModelGPT4VisionPreview
112
113// Equals "gpt-4"
114const ChatModelGPT4 = shared.ChatModelGPT4
115
116// Equals "gpt-4-0314"
117const ChatModelGPT4_0314 = shared.ChatModelGPT4_0314
118
119// Equals "gpt-4-0613"
120const ChatModelGPT4_0613 = shared.ChatModelGPT4_0613
121
122// Equals "gpt-4-32k"
123const ChatModelGPT4_32k = shared.ChatModelGPT4_32k
124
125// Equals "gpt-4-32k-0314"
126const ChatModelGPT4_32k0314 = shared.ChatModelGPT4_32k0314
127
128// Equals "gpt-4-32k-0613"
129const ChatModelGPT4_32k0613 = shared.ChatModelGPT4_32k0613
130
131// Equals "gpt-3.5-turbo"
132const ChatModelGPT3_5Turbo = shared.ChatModelGPT3_5Turbo
133
134// Equals "gpt-3.5-turbo-16k"
135const ChatModelGPT3_5Turbo16k = shared.ChatModelGPT3_5Turbo16k
136
137// Equals "gpt-3.5-turbo-0301"
138const ChatModelGPT3_5Turbo0301 = shared.ChatModelGPT3_5Turbo0301
139
140// Equals "gpt-3.5-turbo-0613"
141const ChatModelGPT3_5Turbo0613 = shared.ChatModelGPT3_5Turbo0613
142
143// Equals "gpt-3.5-turbo-1106"
144const ChatModelGPT3_5Turbo1106 = shared.ChatModelGPT3_5Turbo1106
145
146// Equals "gpt-3.5-turbo-0125"
147const ChatModelGPT3_5Turbo0125 = shared.ChatModelGPT3_5Turbo0125
148
149// Equals "gpt-3.5-turbo-16k-0613"
150const ChatModelGPT3_5Turbo16k0613 = shared.ChatModelGPT3_5Turbo16k0613
151
152// A filter used to compare a specified attribute key to a given value using a
153// defined comparison operation.
154//
155// This is an alias to an internal type.
156type ComparisonFilter = shared.ComparisonFilter
157
158// Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.
159//
160// - `eq`: equals
161// - `ne`: not equal
162// - `gt`: greater than
163// - `gte`: greater than or equal
164// - `lt`: less than
165// - `lte`: less than or equal
166//
167// This is an alias to an internal type.
168type ComparisonFilterType = shared.ComparisonFilterType
169
170// Equals "eq"
171const ComparisonFilterTypeEq = shared.ComparisonFilterTypeEq
172
173// Equals "ne"
174const ComparisonFilterTypeNe = shared.ComparisonFilterTypeNe
175
176// Equals "gt"
177const ComparisonFilterTypeGt = shared.ComparisonFilterTypeGt
178
179// Equals "gte"
180const ComparisonFilterTypeGte = shared.ComparisonFilterTypeGte
181
182// Equals "lt"
183const ComparisonFilterTypeLt = shared.ComparisonFilterTypeLt
184
185// Equals "lte"
186const ComparisonFilterTypeLte = shared.ComparisonFilterTypeLte
187
188// The value to compare against the attribute key; supports string, number, or
189// boolean types.
190//
191// This is an alias to an internal type.
192type ComparisonFilterValueUnion = shared.ComparisonFilterValueUnion
193
194// A filter used to compare a specified attribute key to a given value using a
195// defined comparison operation.
196//
197// This is an alias to an internal type.
198type ComparisonFilterParam = shared.ComparisonFilterParam
199
200// The value to compare against the attribute key; supports string, number, or
201// boolean types.
202//
203// This is an alias to an internal type.
204type ComparisonFilterValueUnionParam = shared.ComparisonFilterValueUnionParam
205
206// Combine multiple filters using `and` or `or`.
207//
208// This is an alias to an internal type.
209type CompoundFilter = shared.CompoundFilter
210
211// Type of operation: `and` or `or`.
212//
213// This is an alias to an internal type.
214type CompoundFilterType = shared.CompoundFilterType
215
216// Equals "and"
217const CompoundFilterTypeAnd = shared.CompoundFilterTypeAnd
218
219// Equals "or"
220const CompoundFilterTypeOr = shared.CompoundFilterTypeOr
221
222// Combine multiple filters using `and` or `or`.
223//
224// This is an alias to an internal type.
225type CompoundFilterParam = shared.CompoundFilterParam
226
227// This is an alias to an internal type.
228type ErrorObject = shared.ErrorObject
229
230// This is an alias to an internal type.
231type FunctionDefinition = shared.FunctionDefinition
232
233// This is an alias to an internal type.
234type FunctionDefinitionParam = shared.FunctionDefinitionParam
235
236// The parameters the functions accepts, described as a JSON Schema object. See the
237// [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
238// and the
239// [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
240// documentation about the format.
241//
242// Omitting `parameters` defines a function with an empty parameter list.
243//
244// This is an alias to an internal type.
245type FunctionParameters = shared.FunctionParameters
246
247// Set of 16 key-value pairs that can be attached to an object. This can be useful
248// for storing additional information about the object in a structured format, and
249// querying for objects via API or the dashboard.
250//
251// Keys are strings with a maximum length of 64 characters. Values are strings with
252// a maximum length of 512 characters.
253//
254// This is an alias to an internal type.
255type Metadata = shared.Metadata
256
257// Set of 16 key-value pairs that can be attached to an object. This can be useful
258// for storing additional information about the object in a structured format, and
259// querying for objects via API or the dashboard.
260//
261// Keys are strings with a maximum length of 64 characters. Values are strings with
262// a maximum length of 512 characters.
263//
264// This is an alias to an internal type.
265type MetadataParam = shared.MetadataParam
266
267// **o-series models only**
268//
269// Configuration options for
270// [reasoning models](https://platform.openai.com/docs/guides/reasoning).
271//
272// This is an alias to an internal type.
273type Reasoning = shared.Reasoning
274
275// **computer_use_preview only**
276//
277// A summary of the reasoning performed by the model. This can be useful for
278// debugging and understanding the model's reasoning process. One of `concise` or
279// `detailed`.
280//
281// This is an alias to an internal type.
282type ReasoningGenerateSummary = shared.ReasoningGenerateSummary
283
284// Equals "concise"
285const ReasoningGenerateSummaryConcise = shared.ReasoningGenerateSummaryConcise
286
287// Equals "detailed"
288const ReasoningGenerateSummaryDetailed = shared.ReasoningGenerateSummaryDetailed
289
290// **o-series models only**
291//
292// Configuration options for
293// [reasoning models](https://platform.openai.com/docs/guides/reasoning).
294//
295// This is an alias to an internal type.
296type ReasoningParam = shared.ReasoningParam
297
298// **o-series models only**
299//
300// Constrains effort on reasoning for
301// [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
302// supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
303// result in faster responses and fewer tokens used on reasoning in a response.
304//
305// This is an alias to an internal type.
306type ReasoningEffort = shared.ReasoningEffort
307
308// Equals "low"
309const ReasoningEffortLow = shared.ReasoningEffortLow
310
311// Equals "medium"
312const ReasoningEffortMedium = shared.ReasoningEffortMedium
313
314// Equals "high"
315const ReasoningEffortHigh = shared.ReasoningEffortHigh
316
317// JSON object response format. An older method of generating JSON responses. Using
318// `json_schema` is recommended for models that support it. Note that the model
319// will not generate JSON without a system or user message instructing it to do so.
320//
321// This is an alias to an internal type.
322type ResponseFormatJSONObject = shared.ResponseFormatJSONObject
323
324// JSON object response format. An older method of generating JSON responses. Using
325// `json_schema` is recommended for models that support it. Note that the model
326// will not generate JSON without a system or user message instructing it to do so.
327//
328// This is an alias to an internal type.
329type ResponseFormatJSONObjectParam = shared.ResponseFormatJSONObjectParam
330
331// JSON Schema response format. Used to generate structured JSON responses. Learn
332// more about
333// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
334//
335// This is an alias to an internal type.
336type ResponseFormatJSONSchema = shared.ResponseFormatJSONSchema
337
338// Structured Outputs configuration options, including a JSON Schema.
339//
340// This is an alias to an internal type.
341type ResponseFormatJSONSchemaJSONSchema = shared.ResponseFormatJSONSchemaJSONSchema
342
343// JSON Schema response format. Used to generate structured JSON responses. Learn
344// more about
345// [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
346//
347// This is an alias to an internal type.
348type ResponseFormatJSONSchemaParam = shared.ResponseFormatJSONSchemaParam
349
350// Structured Outputs configuration options, including a JSON Schema.
351//
352// This is an alias to an internal type.
353type ResponseFormatJSONSchemaJSONSchemaParam = shared.ResponseFormatJSONSchemaJSONSchemaParam
354
355// Default response format. Used to generate text responses.
356//
357// This is an alias to an internal type.
358type ResponseFormatText = shared.ResponseFormatText
359
360// Default response format. Used to generate text responses.
361//
362// This is an alias to an internal type.
363type ResponseFormatTextParam = shared.ResponseFormatTextParam
364
365// This is an alias to an internal type.
366type ResponsesModel = shared.ResponsesModel
367
368// Equals "o1-pro"
369const ResponsesModelO1Pro = shared.ResponsesModelO1Pro
370
371// Equals "o1-pro-2025-03-19"
372const ResponsesModelO1Pro2025_03_19 = shared.ResponsesModelO1Pro2025_03_19
373
374// Equals "computer-use-preview"
375const ResponsesModelComputerUsePreview = shared.ResponsesModelComputerUsePreview
376
377// Equals "computer-use-preview-2025-03-11"
378const ResponsesModelComputerUsePreview2025_03_11 = shared.ResponsesModelComputerUsePreview2025_03_11
379
380func toParam[T comparable](value T, meta resp.Field) param.Opt[T] {
381	if meta.IsPresent() {
382		return param.NewOpt(value)
383	}
384	if meta.IsExplicitNull() {
385		return param.NullOpt[T]()
386	}
387	return param.Opt[T]{}
388}