1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3package constant
4
5import (
6 "encoding/json"
7)
8
9type Constant[T any] interface {
10 Default() T
11}
12
13// ValueOf gives the default value of a constant from its type. It's helpful when
14// constructing constants as variants in a one-of. Note that empty structs are
15// marshalled by default. Usage: constant.ValueOf[constant.Foo]()
16func ValueOf[T Constant[T]]() T {
17 var t T
18 return t.Default()
19}
20
21type Approximate string // Always "approximate"
22type Assistant string // Always "assistant"
23type AssistantDeleted string // Always "assistant.deleted"
24type Auto string // Always "auto"
25type Batch string // Always "batch"
26type ChatCompletion string // Always "chat.completion"
27type ChatCompletionChunk string // Always "chat.completion.chunk"
28type ChatCompletionDeleted string // Always "chat.completion.deleted"
29type Click string // Always "click"
30type CodeInterpreter string // Always "code_interpreter"
31type CodeInterpreterCall string // Always "code_interpreter_call"
32type ComputerCallOutput string // Always "computer_call_output"
33type ComputerScreenshot string // Always "computer_screenshot"
34type ComputerUsePreview string // Always "computer_use_preview"
35type Content string // Always "content"
36type Developer string // Always "developer"
37type DoubleClick string // Always "double_click"
38type Drag string // Always "drag"
39type Embedding string // Always "embedding"
40type Error string // Always "error"
41type File string // Always "file"
42type FileCitation string // Always "file_citation"
43type FilePath string // Always "file_path"
44type FileSearch string // Always "file_search"
45type FileSearchCall string // Always "file_search_call"
46type Files string // Always "files"
47type FineTuningJob string // Always "fine_tuning.job"
48type FineTuningJobCheckpoint string // Always "fine_tuning.job.checkpoint"
49type FineTuningJobEvent string // Always "fine_tuning.job.event"
50type Function string // Always "function"
51type FunctionCall string // Always "function_call"
52type FunctionCallOutput string // Always "function_call_output"
53type Image string // Always "image"
54type ImageFile string // Always "image_file"
55type ImageURL string // Always "image_url"
56type InputAudio string // Always "input_audio"
57type InputFile string // Always "input_file"
58type InputImage string // Always "input_image"
59type InputText string // Always "input_text"
60type ItemReference string // Always "item_reference"
61type JSONObject string // Always "json_object"
62type JSONSchema string // Always "json_schema"
63type Keypress string // Always "keypress"
64type LastActiveAt string // Always "last_active_at"
65type List string // Always "list"
66type Logs string // Always "logs"
67type Message string // Always "message"
68type MessageCreation string // Always "message_creation"
69type Model string // Always "model"
70type Move string // Always "move"
71type Other string // Always "other"
72type OutputAudio string // Always "output_audio"
73type OutputText string // Always "output_text"
74type Reasoning string // Always "reasoning"
75type Refusal string // Always "refusal"
76type Response string // Always "response"
77type ResponseAudioDelta string // Always "response.audio.delta"
78type ResponseAudioDone string // Always "response.audio.done"
79type ResponseAudioTranscriptDelta string // Always "response.audio.transcript.delta"
80type ResponseAudioTranscriptDone string // Always "response.audio.transcript.done"
81type ResponseCodeInterpreterCallCodeDelta string // Always "response.code_interpreter_call.code.delta"
82type ResponseCodeInterpreterCallCodeDone string // Always "response.code_interpreter_call.code.done"
83type ResponseCodeInterpreterCallCompleted string // Always "response.code_interpreter_call.completed"
84type ResponseCodeInterpreterCallInProgress string // Always "response.code_interpreter_call.in_progress"
85type ResponseCodeInterpreterCallInterpreting string // Always "response.code_interpreter_call.interpreting"
86type ResponseCompleted string // Always "response.completed"
87type ResponseContentPartAdded string // Always "response.content_part.added"
88type ResponseContentPartDone string // Always "response.content_part.done"
89type ResponseCreated string // Always "response.created"
90type ResponseFailed string // Always "response.failed"
91type ResponseFileSearchCallCompleted string // Always "response.file_search_call.completed"
92type ResponseFileSearchCallInProgress string // Always "response.file_search_call.in_progress"
93type ResponseFileSearchCallSearching string // Always "response.file_search_call.searching"
94type ResponseFunctionCallArgumentsDelta string // Always "response.function_call_arguments.delta"
95type ResponseFunctionCallArgumentsDone string // Always "response.function_call_arguments.done"
96type ResponseInProgress string // Always "response.in_progress"
97type ResponseIncomplete string // Always "response.incomplete"
98type ResponseOutputItemAdded string // Always "response.output_item.added"
99type ResponseOutputItemDone string // Always "response.output_item.done"
100type ResponseOutputTextAnnotationAdded string // Always "response.output_text.annotation.added"
101type ResponseOutputTextDelta string // Always "response.output_text.delta"
102type ResponseOutputTextDone string // Always "response.output_text.done"
103type ResponseRefusalDelta string // Always "response.refusal.delta"
104type ResponseRefusalDone string // Always "response.refusal.done"
105type ResponseWebSearchCallCompleted string // Always "response.web_search_call.completed"
106type ResponseWebSearchCallInProgress string // Always "response.web_search_call.in_progress"
107type ResponseWebSearchCallSearching string // Always "response.web_search_call.searching"
108type Screenshot string // Always "screenshot"
109type Scroll string // Always "scroll"
110type Static string // Always "static"
111type SubmitToolOutputs string // Always "submit_tool_outputs"
112type SummaryText string // Always "summary_text"
113type System string // Always "system"
114type Text string // Always "text"
115type TextCompletion string // Always "text_completion"
116type Thread string // Always "thread"
117type ThreadCreated string // Always "thread.created"
118type ThreadDeleted string // Always "thread.deleted"
119type ThreadMessage string // Always "thread.message"
120type ThreadMessageCompleted string // Always "thread.message.completed"
121type ThreadMessageCreated string // Always "thread.message.created"
122type ThreadMessageDeleted string // Always "thread.message.deleted"
123type ThreadMessageDelta string // Always "thread.message.delta"
124type ThreadMessageInProgress string // Always "thread.message.in_progress"
125type ThreadMessageIncomplete string // Always "thread.message.incomplete"
126type ThreadRun string // Always "thread.run"
127type ThreadRunCancelled string // Always "thread.run.cancelled"
128type ThreadRunCancelling string // Always "thread.run.cancelling"
129type ThreadRunCompleted string // Always "thread.run.completed"
130type ThreadRunCreated string // Always "thread.run.created"
131type ThreadRunExpired string // Always "thread.run.expired"
132type ThreadRunFailed string // Always "thread.run.failed"
133type ThreadRunInProgress string // Always "thread.run.in_progress"
134type ThreadRunIncomplete string // Always "thread.run.incomplete"
135type ThreadRunQueued string // Always "thread.run.queued"
136type ThreadRunRequiresAction string // Always "thread.run.requires_action"
137type ThreadRunStep string // Always "thread.run.step"
138type ThreadRunStepCancelled string // Always "thread.run.step.cancelled"
139type ThreadRunStepCompleted string // Always "thread.run.step.completed"
140type ThreadRunStepCreated string // Always "thread.run.step.created"
141type ThreadRunStepDelta string // Always "thread.run.step.delta"
142type ThreadRunStepExpired string // Always "thread.run.step.expired"
143type ThreadRunStepFailed string // Always "thread.run.step.failed"
144type ThreadRunStepInProgress string // Always "thread.run.step.in_progress"
145type Tool string // Always "tool"
146type ToolCalls string // Always "tool_calls"
147type TranscriptTextDelta string // Always "transcript.text.delta"
148type TranscriptTextDone string // Always "transcript.text.done"
149type Type string // Always "type"
150type Upload string // Always "upload"
151type UploadPart string // Always "upload.part"
152type URLCitation string // Always "url_citation"
153type User string // Always "user"
154type VectorStore string // Always "vector_store"
155type VectorStoreDeleted string // Always "vector_store.deleted"
156type VectorStoreFile string // Always "vector_store.file"
157type VectorStoreFileContentPage string // Always "vector_store.file_content.page"
158type VectorStoreFileDeleted string // Always "vector_store.file.deleted"
159type VectorStoreFilesBatch string // Always "vector_store.files_batch"
160type VectorStoreSearchResultsPage string // Always "vector_store.search_results.page"
161type Wait string // Always "wait"
162type Wandb string // Always "wandb"
163type WebSearchCall string // Always "web_search_call"
164
165func (c Approximate) Default() Approximate { return "approximate" }
166func (c Assistant) Default() Assistant { return "assistant" }
167func (c AssistantDeleted) Default() AssistantDeleted { return "assistant.deleted" }
168func (c Auto) Default() Auto { return "auto" }
169func (c Batch) Default() Batch { return "batch" }
170func (c ChatCompletion) Default() ChatCompletion { return "chat.completion" }
171func (c ChatCompletionChunk) Default() ChatCompletionChunk { return "chat.completion.chunk" }
172func (c ChatCompletionDeleted) Default() ChatCompletionDeleted { return "chat.completion.deleted" }
173func (c Click) Default() Click { return "click" }
174func (c CodeInterpreter) Default() CodeInterpreter { return "code_interpreter" }
175func (c CodeInterpreterCall) Default() CodeInterpreterCall { return "code_interpreter_call" }
176func (c ComputerCallOutput) Default() ComputerCallOutput { return "computer_call_output" }
177func (c ComputerScreenshot) Default() ComputerScreenshot { return "computer_screenshot" }
178func (c ComputerUsePreview) Default() ComputerUsePreview { return "computer_use_preview" }
179func (c Content) Default() Content { return "content" }
180func (c Developer) Default() Developer { return "developer" }
181func (c DoubleClick) Default() DoubleClick { return "double_click" }
182func (c Drag) Default() Drag { return "drag" }
183func (c Embedding) Default() Embedding { return "embedding" }
184func (c Error) Default() Error { return "error" }
185func (c File) Default() File { return "file" }
186func (c FileCitation) Default() FileCitation { return "file_citation" }
187func (c FilePath) Default() FilePath { return "file_path" }
188func (c FileSearch) Default() FileSearch { return "file_search" }
189func (c FileSearchCall) Default() FileSearchCall { return "file_search_call" }
190func (c Files) Default() Files { return "files" }
191func (c FineTuningJob) Default() FineTuningJob { return "fine_tuning.job" }
192func (c FineTuningJobCheckpoint) Default() FineTuningJobCheckpoint {
193 return "fine_tuning.job.checkpoint"
194}
195func (c FineTuningJobEvent) Default() FineTuningJobEvent { return "fine_tuning.job.event" }
196func (c Function) Default() Function { return "function" }
197func (c FunctionCall) Default() FunctionCall { return "function_call" }
198func (c FunctionCallOutput) Default() FunctionCallOutput { return "function_call_output" }
199func (c Image) Default() Image { return "image" }
200func (c ImageFile) Default() ImageFile { return "image_file" }
201func (c ImageURL) Default() ImageURL { return "image_url" }
202func (c InputAudio) Default() InputAudio { return "input_audio" }
203func (c InputFile) Default() InputFile { return "input_file" }
204func (c InputImage) Default() InputImage { return "input_image" }
205func (c InputText) Default() InputText { return "input_text" }
206func (c ItemReference) Default() ItemReference { return "item_reference" }
207func (c JSONObject) Default() JSONObject { return "json_object" }
208func (c JSONSchema) Default() JSONSchema { return "json_schema" }
209func (c Keypress) Default() Keypress { return "keypress" }
210func (c LastActiveAt) Default() LastActiveAt { return "last_active_at" }
211func (c List) Default() List { return "list" }
212func (c Logs) Default() Logs { return "logs" }
213func (c Message) Default() Message { return "message" }
214func (c MessageCreation) Default() MessageCreation { return "message_creation" }
215func (c Model) Default() Model { return "model" }
216func (c Move) Default() Move { return "move" }
217func (c Other) Default() Other { return "other" }
218func (c OutputAudio) Default() OutputAudio { return "output_audio" }
219func (c OutputText) Default() OutputText { return "output_text" }
220func (c Reasoning) Default() Reasoning { return "reasoning" }
221func (c Refusal) Default() Refusal { return "refusal" }
222func (c Response) Default() Response { return "response" }
223func (c ResponseAudioDelta) Default() ResponseAudioDelta { return "response.audio.delta" }
224func (c ResponseAudioDone) Default() ResponseAudioDone { return "response.audio.done" }
225func (c ResponseAudioTranscriptDelta) Default() ResponseAudioTranscriptDelta {
226 return "response.audio.transcript.delta"
227}
228func (c ResponseAudioTranscriptDone) Default() ResponseAudioTranscriptDone {
229 return "response.audio.transcript.done"
230}
231func (c ResponseCodeInterpreterCallCodeDelta) Default() ResponseCodeInterpreterCallCodeDelta {
232 return "response.code_interpreter_call.code.delta"
233}
234func (c ResponseCodeInterpreterCallCodeDone) Default() ResponseCodeInterpreterCallCodeDone {
235 return "response.code_interpreter_call.code.done"
236}
237func (c ResponseCodeInterpreterCallCompleted) Default() ResponseCodeInterpreterCallCompleted {
238 return "response.code_interpreter_call.completed"
239}
240func (c ResponseCodeInterpreterCallInProgress) Default() ResponseCodeInterpreterCallInProgress {
241 return "response.code_interpreter_call.in_progress"
242}
243func (c ResponseCodeInterpreterCallInterpreting) Default() ResponseCodeInterpreterCallInterpreting {
244 return "response.code_interpreter_call.interpreting"
245}
246func (c ResponseCompleted) Default() ResponseCompleted { return "response.completed" }
247func (c ResponseContentPartAdded) Default() ResponseContentPartAdded {
248 return "response.content_part.added"
249}
250func (c ResponseContentPartDone) Default() ResponseContentPartDone {
251 return "response.content_part.done"
252}
253func (c ResponseCreated) Default() ResponseCreated { return "response.created" }
254func (c ResponseFailed) Default() ResponseFailed { return "response.failed" }
255func (c ResponseFileSearchCallCompleted) Default() ResponseFileSearchCallCompleted {
256 return "response.file_search_call.completed"
257}
258func (c ResponseFileSearchCallInProgress) Default() ResponseFileSearchCallInProgress {
259 return "response.file_search_call.in_progress"
260}
261func (c ResponseFileSearchCallSearching) Default() ResponseFileSearchCallSearching {
262 return "response.file_search_call.searching"
263}
264func (c ResponseFunctionCallArgumentsDelta) Default() ResponseFunctionCallArgumentsDelta {
265 return "response.function_call_arguments.delta"
266}
267func (c ResponseFunctionCallArgumentsDone) Default() ResponseFunctionCallArgumentsDone {
268 return "response.function_call_arguments.done"
269}
270func (c ResponseInProgress) Default() ResponseInProgress { return "response.in_progress" }
271func (c ResponseIncomplete) Default() ResponseIncomplete { return "response.incomplete" }
272func (c ResponseOutputItemAdded) Default() ResponseOutputItemAdded {
273 return "response.output_item.added"
274}
275func (c ResponseOutputItemDone) Default() ResponseOutputItemDone { return "response.output_item.done" }
276func (c ResponseOutputTextAnnotationAdded) Default() ResponseOutputTextAnnotationAdded {
277 return "response.output_text.annotation.added"
278}
279func (c ResponseOutputTextDelta) Default() ResponseOutputTextDelta {
280 return "response.output_text.delta"
281}
282func (c ResponseOutputTextDone) Default() ResponseOutputTextDone { return "response.output_text.done" }
283func (c ResponseRefusalDelta) Default() ResponseRefusalDelta { return "response.refusal.delta" }
284func (c ResponseRefusalDone) Default() ResponseRefusalDone { return "response.refusal.done" }
285func (c ResponseWebSearchCallCompleted) Default() ResponseWebSearchCallCompleted {
286 return "response.web_search_call.completed"
287}
288func (c ResponseWebSearchCallInProgress) Default() ResponseWebSearchCallInProgress {
289 return "response.web_search_call.in_progress"
290}
291func (c ResponseWebSearchCallSearching) Default() ResponseWebSearchCallSearching {
292 return "response.web_search_call.searching"
293}
294func (c Screenshot) Default() Screenshot { return "screenshot" }
295func (c Scroll) Default() Scroll { return "scroll" }
296func (c Static) Default() Static { return "static" }
297func (c SubmitToolOutputs) Default() SubmitToolOutputs { return "submit_tool_outputs" }
298func (c SummaryText) Default() SummaryText { return "summary_text" }
299func (c System) Default() System { return "system" }
300func (c Text) Default() Text { return "text" }
301func (c TextCompletion) Default() TextCompletion { return "text_completion" }
302func (c Thread) Default() Thread { return "thread" }
303func (c ThreadCreated) Default() ThreadCreated { return "thread.created" }
304func (c ThreadDeleted) Default() ThreadDeleted { return "thread.deleted" }
305func (c ThreadMessage) Default() ThreadMessage { return "thread.message" }
306func (c ThreadMessageCompleted) Default() ThreadMessageCompleted { return "thread.message.completed" }
307func (c ThreadMessageCreated) Default() ThreadMessageCreated { return "thread.message.created" }
308func (c ThreadMessageDeleted) Default() ThreadMessageDeleted { return "thread.message.deleted" }
309func (c ThreadMessageDelta) Default() ThreadMessageDelta { return "thread.message.delta" }
310func (c ThreadMessageInProgress) Default() ThreadMessageInProgress {
311 return "thread.message.in_progress"
312}
313func (c ThreadMessageIncomplete) Default() ThreadMessageIncomplete {
314 return "thread.message.incomplete"
315}
316func (c ThreadRun) Default() ThreadRun { return "thread.run" }
317func (c ThreadRunCancelled) Default() ThreadRunCancelled { return "thread.run.cancelled" }
318func (c ThreadRunCancelling) Default() ThreadRunCancelling { return "thread.run.cancelling" }
319func (c ThreadRunCompleted) Default() ThreadRunCompleted { return "thread.run.completed" }
320func (c ThreadRunCreated) Default() ThreadRunCreated { return "thread.run.created" }
321func (c ThreadRunExpired) Default() ThreadRunExpired { return "thread.run.expired" }
322func (c ThreadRunFailed) Default() ThreadRunFailed { return "thread.run.failed" }
323func (c ThreadRunInProgress) Default() ThreadRunInProgress { return "thread.run.in_progress" }
324func (c ThreadRunIncomplete) Default() ThreadRunIncomplete { return "thread.run.incomplete" }
325func (c ThreadRunQueued) Default() ThreadRunQueued { return "thread.run.queued" }
326func (c ThreadRunRequiresAction) Default() ThreadRunRequiresAction {
327 return "thread.run.requires_action"
328}
329func (c ThreadRunStep) Default() ThreadRunStep { return "thread.run.step" }
330func (c ThreadRunStepCancelled) Default() ThreadRunStepCancelled { return "thread.run.step.cancelled" }
331func (c ThreadRunStepCompleted) Default() ThreadRunStepCompleted { return "thread.run.step.completed" }
332func (c ThreadRunStepCreated) Default() ThreadRunStepCreated { return "thread.run.step.created" }
333func (c ThreadRunStepDelta) Default() ThreadRunStepDelta { return "thread.run.step.delta" }
334func (c ThreadRunStepExpired) Default() ThreadRunStepExpired { return "thread.run.step.expired" }
335func (c ThreadRunStepFailed) Default() ThreadRunStepFailed { return "thread.run.step.failed" }
336func (c ThreadRunStepInProgress) Default() ThreadRunStepInProgress {
337 return "thread.run.step.in_progress"
338}
339func (c Tool) Default() Tool { return "tool" }
340func (c ToolCalls) Default() ToolCalls { return "tool_calls" }
341func (c TranscriptTextDelta) Default() TranscriptTextDelta { return "transcript.text.delta" }
342func (c TranscriptTextDone) Default() TranscriptTextDone { return "transcript.text.done" }
343func (c Type) Default() Type { return "type" }
344func (c Upload) Default() Upload { return "upload" }
345func (c UploadPart) Default() UploadPart { return "upload.part" }
346func (c URLCitation) Default() URLCitation { return "url_citation" }
347func (c User) Default() User { return "user" }
348func (c VectorStore) Default() VectorStore { return "vector_store" }
349func (c VectorStoreDeleted) Default() VectorStoreDeleted { return "vector_store.deleted" }
350func (c VectorStoreFile) Default() VectorStoreFile { return "vector_store.file" }
351func (c VectorStoreFileContentPage) Default() VectorStoreFileContentPage {
352 return "vector_store.file_content.page"
353}
354func (c VectorStoreFileDeleted) Default() VectorStoreFileDeleted { return "vector_store.file.deleted" }
355func (c VectorStoreFilesBatch) Default() VectorStoreFilesBatch { return "vector_store.files_batch" }
356func (c VectorStoreSearchResultsPage) Default() VectorStoreSearchResultsPage {
357 return "vector_store.search_results.page"
358}
359func (c Wait) Default() Wait { return "wait" }
360func (c Wandb) Default() Wandb { return "wandb" }
361func (c WebSearchCall) Default() WebSearchCall { return "web_search_call" }
362
363func (c Approximate) MarshalJSON() ([]byte, error) { return marshalString(c) }
364func (c Assistant) MarshalJSON() ([]byte, error) { return marshalString(c) }
365func (c AssistantDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
366func (c Auto) MarshalJSON() ([]byte, error) { return marshalString(c) }
367func (c Batch) MarshalJSON() ([]byte, error) { return marshalString(c) }
368func (c ChatCompletion) MarshalJSON() ([]byte, error) { return marshalString(c) }
369func (c ChatCompletionChunk) MarshalJSON() ([]byte, error) { return marshalString(c) }
370func (c ChatCompletionDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
371func (c Click) MarshalJSON() ([]byte, error) { return marshalString(c) }
372func (c CodeInterpreter) MarshalJSON() ([]byte, error) { return marshalString(c) }
373func (c CodeInterpreterCall) MarshalJSON() ([]byte, error) { return marshalString(c) }
374func (c ComputerCallOutput) MarshalJSON() ([]byte, error) { return marshalString(c) }
375func (c ComputerScreenshot) MarshalJSON() ([]byte, error) { return marshalString(c) }
376func (c ComputerUsePreview) MarshalJSON() ([]byte, error) { return marshalString(c) }
377func (c Content) MarshalJSON() ([]byte, error) { return marshalString(c) }
378func (c Developer) MarshalJSON() ([]byte, error) { return marshalString(c) }
379func (c DoubleClick) MarshalJSON() ([]byte, error) { return marshalString(c) }
380func (c Drag) MarshalJSON() ([]byte, error) { return marshalString(c) }
381func (c Embedding) MarshalJSON() ([]byte, error) { return marshalString(c) }
382func (c Error) MarshalJSON() ([]byte, error) { return marshalString(c) }
383func (c File) MarshalJSON() ([]byte, error) { return marshalString(c) }
384func (c FileCitation) MarshalJSON() ([]byte, error) { return marshalString(c) }
385func (c FilePath) MarshalJSON() ([]byte, error) { return marshalString(c) }
386func (c FileSearch) MarshalJSON() ([]byte, error) { return marshalString(c) }
387func (c FileSearchCall) MarshalJSON() ([]byte, error) { return marshalString(c) }
388func (c Files) MarshalJSON() ([]byte, error) { return marshalString(c) }
389func (c FineTuningJob) MarshalJSON() ([]byte, error) { return marshalString(c) }
390func (c FineTuningJobCheckpoint) MarshalJSON() ([]byte, error) { return marshalString(c) }
391func (c FineTuningJobEvent) MarshalJSON() ([]byte, error) { return marshalString(c) }
392func (c Function) MarshalJSON() ([]byte, error) { return marshalString(c) }
393func (c FunctionCall) MarshalJSON() ([]byte, error) { return marshalString(c) }
394func (c FunctionCallOutput) MarshalJSON() ([]byte, error) { return marshalString(c) }
395func (c Image) MarshalJSON() ([]byte, error) { return marshalString(c) }
396func (c ImageFile) MarshalJSON() ([]byte, error) { return marshalString(c) }
397func (c ImageURL) MarshalJSON() ([]byte, error) { return marshalString(c) }
398func (c InputAudio) MarshalJSON() ([]byte, error) { return marshalString(c) }
399func (c InputFile) MarshalJSON() ([]byte, error) { return marshalString(c) }
400func (c InputImage) MarshalJSON() ([]byte, error) { return marshalString(c) }
401func (c InputText) MarshalJSON() ([]byte, error) { return marshalString(c) }
402func (c ItemReference) MarshalJSON() ([]byte, error) { return marshalString(c) }
403func (c JSONObject) MarshalJSON() ([]byte, error) { return marshalString(c) }
404func (c JSONSchema) MarshalJSON() ([]byte, error) { return marshalString(c) }
405func (c Keypress) MarshalJSON() ([]byte, error) { return marshalString(c) }
406func (c LastActiveAt) MarshalJSON() ([]byte, error) { return marshalString(c) }
407func (c List) MarshalJSON() ([]byte, error) { return marshalString(c) }
408func (c Logs) MarshalJSON() ([]byte, error) { return marshalString(c) }
409func (c Message) MarshalJSON() ([]byte, error) { return marshalString(c) }
410func (c MessageCreation) MarshalJSON() ([]byte, error) { return marshalString(c) }
411func (c Model) MarshalJSON() ([]byte, error) { return marshalString(c) }
412func (c Move) MarshalJSON() ([]byte, error) { return marshalString(c) }
413func (c Other) MarshalJSON() ([]byte, error) { return marshalString(c) }
414func (c OutputAudio) MarshalJSON() ([]byte, error) { return marshalString(c) }
415func (c OutputText) MarshalJSON() ([]byte, error) { return marshalString(c) }
416func (c Reasoning) MarshalJSON() ([]byte, error) { return marshalString(c) }
417func (c Refusal) MarshalJSON() ([]byte, error) { return marshalString(c) }
418func (c Response) MarshalJSON() ([]byte, error) { return marshalString(c) }
419func (c ResponseAudioDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
420func (c ResponseAudioDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
421func (c ResponseAudioTranscriptDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
422func (c ResponseAudioTranscriptDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
423func (c ResponseCodeInterpreterCallCodeDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
424func (c ResponseCodeInterpreterCallCodeDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
425func (c ResponseCodeInterpreterCallCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
426func (c ResponseCodeInterpreterCallInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
427func (c ResponseCodeInterpreterCallInterpreting) MarshalJSON() ([]byte, error) {
428 return marshalString(c)
429}
430func (c ResponseCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
431func (c ResponseContentPartAdded) MarshalJSON() ([]byte, error) { return marshalString(c) }
432func (c ResponseContentPartDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
433func (c ResponseCreated) MarshalJSON() ([]byte, error) { return marshalString(c) }
434func (c ResponseFailed) MarshalJSON() ([]byte, error) { return marshalString(c) }
435func (c ResponseFileSearchCallCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
436func (c ResponseFileSearchCallInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
437func (c ResponseFileSearchCallSearching) MarshalJSON() ([]byte, error) { return marshalString(c) }
438func (c ResponseFunctionCallArgumentsDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
439func (c ResponseFunctionCallArgumentsDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
440func (c ResponseInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
441func (c ResponseIncomplete) MarshalJSON() ([]byte, error) { return marshalString(c) }
442func (c ResponseOutputItemAdded) MarshalJSON() ([]byte, error) { return marshalString(c) }
443func (c ResponseOutputItemDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
444func (c ResponseOutputTextAnnotationAdded) MarshalJSON() ([]byte, error) { return marshalString(c) }
445func (c ResponseOutputTextDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
446func (c ResponseOutputTextDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
447func (c ResponseRefusalDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
448func (c ResponseRefusalDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
449func (c ResponseWebSearchCallCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
450func (c ResponseWebSearchCallInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
451func (c ResponseWebSearchCallSearching) MarshalJSON() ([]byte, error) { return marshalString(c) }
452func (c Screenshot) MarshalJSON() ([]byte, error) { return marshalString(c) }
453func (c Scroll) MarshalJSON() ([]byte, error) { return marshalString(c) }
454func (c Static) MarshalJSON() ([]byte, error) { return marshalString(c) }
455func (c SubmitToolOutputs) MarshalJSON() ([]byte, error) { return marshalString(c) }
456func (c SummaryText) MarshalJSON() ([]byte, error) { return marshalString(c) }
457func (c System) MarshalJSON() ([]byte, error) { return marshalString(c) }
458func (c Text) MarshalJSON() ([]byte, error) { return marshalString(c) }
459func (c TextCompletion) MarshalJSON() ([]byte, error) { return marshalString(c) }
460func (c Thread) MarshalJSON() ([]byte, error) { return marshalString(c) }
461func (c ThreadCreated) MarshalJSON() ([]byte, error) { return marshalString(c) }
462func (c ThreadDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
463func (c ThreadMessage) MarshalJSON() ([]byte, error) { return marshalString(c) }
464func (c ThreadMessageCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
465func (c ThreadMessageCreated) MarshalJSON() ([]byte, error) { return marshalString(c) }
466func (c ThreadMessageDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
467func (c ThreadMessageDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
468func (c ThreadMessageInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
469func (c ThreadMessageIncomplete) MarshalJSON() ([]byte, error) { return marshalString(c) }
470func (c ThreadRun) MarshalJSON() ([]byte, error) { return marshalString(c) }
471func (c ThreadRunCancelled) MarshalJSON() ([]byte, error) { return marshalString(c) }
472func (c ThreadRunCancelling) MarshalJSON() ([]byte, error) { return marshalString(c) }
473func (c ThreadRunCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
474func (c ThreadRunCreated) MarshalJSON() ([]byte, error) { return marshalString(c) }
475func (c ThreadRunExpired) MarshalJSON() ([]byte, error) { return marshalString(c) }
476func (c ThreadRunFailed) MarshalJSON() ([]byte, error) { return marshalString(c) }
477func (c ThreadRunInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
478func (c ThreadRunIncomplete) MarshalJSON() ([]byte, error) { return marshalString(c) }
479func (c ThreadRunQueued) MarshalJSON() ([]byte, error) { return marshalString(c) }
480func (c ThreadRunRequiresAction) MarshalJSON() ([]byte, error) { return marshalString(c) }
481func (c ThreadRunStep) MarshalJSON() ([]byte, error) { return marshalString(c) }
482func (c ThreadRunStepCancelled) MarshalJSON() ([]byte, error) { return marshalString(c) }
483func (c ThreadRunStepCompleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
484func (c ThreadRunStepCreated) MarshalJSON() ([]byte, error) { return marshalString(c) }
485func (c ThreadRunStepDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
486func (c ThreadRunStepExpired) MarshalJSON() ([]byte, error) { return marshalString(c) }
487func (c ThreadRunStepFailed) MarshalJSON() ([]byte, error) { return marshalString(c) }
488func (c ThreadRunStepInProgress) MarshalJSON() ([]byte, error) { return marshalString(c) }
489func (c Tool) MarshalJSON() ([]byte, error) { return marshalString(c) }
490func (c ToolCalls) MarshalJSON() ([]byte, error) { return marshalString(c) }
491func (c TranscriptTextDelta) MarshalJSON() ([]byte, error) { return marshalString(c) }
492func (c TranscriptTextDone) MarshalJSON() ([]byte, error) { return marshalString(c) }
493func (c Type) MarshalJSON() ([]byte, error) { return marshalString(c) }
494func (c Upload) MarshalJSON() ([]byte, error) { return marshalString(c) }
495func (c UploadPart) MarshalJSON() ([]byte, error) { return marshalString(c) }
496func (c URLCitation) MarshalJSON() ([]byte, error) { return marshalString(c) }
497func (c User) MarshalJSON() ([]byte, error) { return marshalString(c) }
498func (c VectorStore) MarshalJSON() ([]byte, error) { return marshalString(c) }
499func (c VectorStoreDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
500func (c VectorStoreFile) MarshalJSON() ([]byte, error) { return marshalString(c) }
501func (c VectorStoreFileContentPage) MarshalJSON() ([]byte, error) { return marshalString(c) }
502func (c VectorStoreFileDeleted) MarshalJSON() ([]byte, error) { return marshalString(c) }
503func (c VectorStoreFilesBatch) MarshalJSON() ([]byte, error) { return marshalString(c) }
504func (c VectorStoreSearchResultsPage) MarshalJSON() ([]byte, error) { return marshalString(c) }
505func (c Wait) MarshalJSON() ([]byte, error) { return marshalString(c) }
506func (c Wandb) MarshalJSON() ([]byte, error) { return marshalString(c) }
507func (c WebSearchCall) MarshalJSON() ([]byte, error) { return marshalString(c) }
508
509type constant[T any] interface {
510 Constant[T]
511 *T
512}
513
514func marshalString[T ~string, PT constant[T]](v T) ([]byte, error) {
515 var zero T
516 if v == zero {
517 v = PT(&v).Default()
518 }
519 return json.Marshal(string(v))
520}