Skip to content

Commit 5df5ea9

Browse files
feat(client): allow overriding unions
1 parent 9c70d89 commit 5df5ea9

21 files changed

+124
-82
lines changed

audiotranscription.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ type AudioTranscriptionNewParamsChunkingStrategyUnion struct {
398398
}
399399

400400
func (u AudioTranscriptionNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error) {
401-
return param.MarshalUnion[AudioTranscriptionNewParamsChunkingStrategyUnion](u.OfAuto, u.OfAudioTranscriptionNewsChunkingStrategyVadConfig)
401+
return param.MarshalUnion(u, u.OfAuto, u.OfAudioTranscriptionNewsChunkingStrategyVadConfig)
402402
}
403403
func (u *AudioTranscriptionNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error {
404404
return apijson.UnmarshalRoot(data, u)

betaassistant.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ type AssistantToolUnionParam struct {
14271427
}
14281428

14291429
func (u AssistantToolUnionParam) MarshalJSON() ([]byte, error) {
1430-
return param.MarshalUnion[AssistantToolUnionParam](u.OfCodeInterpreter, u.OfFileSearch, u.OfFunction)
1430+
return param.MarshalUnion(u, u.OfCodeInterpreter, u.OfFileSearch, u.OfFunction)
14311431
}
14321432
func (u *AssistantToolUnionParam) UnmarshalJSON(data []byte) error {
14331433
return apijson.UnmarshalRoot(data, u)
@@ -1922,7 +1922,7 @@ type BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUni
19221922
}
19231923

19241924
func (u BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion) MarshalJSON() ([]byte, error) {
1925-
return param.MarshalUnion[BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion](u.OfAuto, u.OfStatic)
1925+
return param.MarshalUnion(u, u.OfAuto, u.OfStatic)
19261926
}
19271927
func (u *BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion) UnmarshalJSON(data []byte) error {
19281928
return apijson.UnmarshalRoot(data, u)

betathread.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ type AssistantResponseFormatOptionUnionParam struct {
211211
}
212212

213213
func (u AssistantResponseFormatOptionUnionParam) MarshalJSON() ([]byte, error) {
214-
return param.MarshalUnion[AssistantResponseFormatOptionUnionParam](u.OfAuto, u.OfText, u.OfJSONObject, u.OfJSONSchema)
214+
return param.MarshalUnion(u, u.OfAuto, u.OfText, u.OfJSONObject, u.OfJSONSchema)
215215
}
216216
func (u *AssistantResponseFormatOptionUnionParam) UnmarshalJSON(data []byte) error {
217217
return apijson.UnmarshalRoot(data, u)
@@ -432,7 +432,7 @@ type AssistantToolChoiceOptionUnionParam struct {
432432
}
433433

434434
func (u AssistantToolChoiceOptionUnionParam) MarshalJSON() ([]byte, error) {
435-
return param.MarshalUnion[AssistantToolChoiceOptionUnionParam](u.OfAuto, u.OfAssistantToolChoice)
435+
return param.MarshalUnion(u, u.OfAuto, u.OfAssistantToolChoice)
436436
}
437437
func (u *AssistantToolChoiceOptionUnionParam) UnmarshalJSON(data []byte) error {
438438
return apijson.UnmarshalRoot(data, u)
@@ -643,7 +643,7 @@ type BetaThreadNewParamsMessageContentUnion struct {
643643
}
644644

645645
func (u BetaThreadNewParamsMessageContentUnion) MarshalJSON() ([]byte, error) {
646-
return param.MarshalUnion[BetaThreadNewParamsMessageContentUnion](u.OfString, u.OfArrayOfContentParts)
646+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
647647
}
648648
func (u *BetaThreadNewParamsMessageContentUnion) UnmarshalJSON(data []byte) error {
649649
return apijson.UnmarshalRoot(data, u)
@@ -684,7 +684,7 @@ type BetaThreadNewParamsMessageAttachmentToolUnion struct {
684684
}
685685

686686
func (u BetaThreadNewParamsMessageAttachmentToolUnion) MarshalJSON() ([]byte, error) {
687-
return param.MarshalUnion[BetaThreadNewParamsMessageAttachmentToolUnion](u.OfCodeInterpreter, u.OfFileSearch)
687+
return param.MarshalUnion(u, u.OfCodeInterpreter, u.OfFileSearch)
688688
}
689689
func (u *BetaThreadNewParamsMessageAttachmentToolUnion) UnmarshalJSON(data []byte) error {
690690
return apijson.UnmarshalRoot(data, u)
@@ -831,7 +831,7 @@ type BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion
831831
}
832832

833833
func (u BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion) MarshalJSON() ([]byte, error) {
834-
return param.MarshalUnion[BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion](u.OfAuto, u.OfStatic)
834+
return param.MarshalUnion(u, u.OfAuto, u.OfStatic)
835835
}
836836
func (u *BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion) UnmarshalJSON(data []byte) error {
837837
return apijson.UnmarshalRoot(data, u)
@@ -1188,7 +1188,7 @@ type BetaThreadNewAndRunParamsThreadMessageContentUnion struct {
11881188
}
11891189

11901190
func (u BetaThreadNewAndRunParamsThreadMessageContentUnion) MarshalJSON() ([]byte, error) {
1191-
return param.MarshalUnion[BetaThreadNewAndRunParamsThreadMessageContentUnion](u.OfString, u.OfArrayOfContentParts)
1191+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
11921192
}
11931193
func (u *BetaThreadNewAndRunParamsThreadMessageContentUnion) UnmarshalJSON(data []byte) error {
11941194
return apijson.UnmarshalRoot(data, u)
@@ -1229,7 +1229,7 @@ type BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion struct {
12291229
}
12301230

12311231
func (u BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion) MarshalJSON() ([]byte, error) {
1232-
return param.MarshalUnion[BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion](u.OfCodeInterpreter, u.OfFileSearch)
1232+
return param.MarshalUnion(u, u.OfCodeInterpreter, u.OfFileSearch)
12331233
}
12341234
func (u *BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion) UnmarshalJSON(data []byte) error {
12351235
return apijson.UnmarshalRoot(data, u)
@@ -1376,7 +1376,7 @@ type BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingSt
13761376
}
13771377

13781378
func (u BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyUnion) MarshalJSON() ([]byte, error) {
1379-
return param.MarshalUnion[BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyUnion](u.OfAuto, u.OfStatic)
1379+
return param.MarshalUnion(u, u.OfAuto, u.OfStatic)
13801380
}
13811381
func (u *BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyUnion) UnmarshalJSON(data []byte) error {
13821382
return apijson.UnmarshalRoot(data, u)

betathreadmessage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ type MessageContentPartParamUnion struct {
12161216
}
12171217

12181218
func (u MessageContentPartParamUnion) MarshalJSON() ([]byte, error) {
1219-
return param.MarshalUnion[MessageContentPartParamUnion](u.OfImageFile, u.OfImageURL, u.OfText)
1219+
return param.MarshalUnion(u, u.OfImageFile, u.OfImageURL, u.OfText)
12201220
}
12211221
func (u *MessageContentPartParamUnion) UnmarshalJSON(data []byte) error {
12221222
return apijson.UnmarshalRoot(data, u)
@@ -1541,7 +1541,7 @@ type BetaThreadMessageNewParamsContentUnion struct {
15411541
}
15421542

15431543
func (u BetaThreadMessageNewParamsContentUnion) MarshalJSON() ([]byte, error) {
1544-
return param.MarshalUnion[BetaThreadMessageNewParamsContentUnion](u.OfString, u.OfArrayOfContentParts)
1544+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
15451545
}
15461546
func (u *BetaThreadMessageNewParamsContentUnion) UnmarshalJSON(data []byte) error {
15471547
return apijson.UnmarshalRoot(data, u)
@@ -1595,7 +1595,7 @@ type BetaThreadMessageNewParamsAttachmentToolUnion struct {
15951595
}
15961596

15971597
func (u BetaThreadMessageNewParamsAttachmentToolUnion) MarshalJSON() ([]byte, error) {
1598-
return param.MarshalUnion[BetaThreadMessageNewParamsAttachmentToolUnion](u.OfCodeInterpreter, u.OfFileSearch)
1598+
return param.MarshalUnion(u, u.OfCodeInterpreter, u.OfFileSearch)
15991599
}
16001600
func (u *BetaThreadMessageNewParamsAttachmentToolUnion) UnmarshalJSON(data []byte) error {
16011601
return apijson.UnmarshalRoot(data, u)

betathreadrun.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ type BetaThreadRunNewParamsAdditionalMessageContentUnion struct {
741741
}
742742

743743
func (u BetaThreadRunNewParamsAdditionalMessageContentUnion) MarshalJSON() ([]byte, error) {
744-
return param.MarshalUnion[BetaThreadRunNewParamsAdditionalMessageContentUnion](u.OfString, u.OfArrayOfContentParts)
744+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
745745
}
746746
func (u *BetaThreadRunNewParamsAdditionalMessageContentUnion) UnmarshalJSON(data []byte) error {
747747
return apijson.UnmarshalRoot(data, u)
@@ -782,7 +782,7 @@ type BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion struct {
782782
}
783783

784784
func (u BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion) MarshalJSON() ([]byte, error) {
785-
return param.MarshalUnion[BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion](u.OfCodeInterpreter, u.OfFileSearch)
785+
return param.MarshalUnion(u, u.OfCodeInterpreter, u.OfFileSearch)
786786
}
787787
func (u *BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion) UnmarshalJSON(data []byte) error {
788788
return apijson.UnmarshalRoot(data, u)

chatcompletion.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ type ChatCompletionAssistantMessageParamContentUnion struct {
366366
}
367367

368368
func (u ChatCompletionAssistantMessageParamContentUnion) MarshalJSON() ([]byte, error) {
369-
return param.MarshalUnion[ChatCompletionAssistantMessageParamContentUnion](u.OfString, u.OfArrayOfContentParts)
369+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
370370
}
371371
func (u *ChatCompletionAssistantMessageParamContentUnion) UnmarshalJSON(data []byte) error {
372372
return apijson.UnmarshalRoot(data, u)
@@ -391,7 +391,7 @@ type ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion struct {
391391
}
392392

393393
func (u ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion) MarshalJSON() ([]byte, error) {
394-
return param.MarshalUnion[ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion](u.OfText, u.OfRefusal)
394+
return param.MarshalUnion(u, u.OfText, u.OfRefusal)
395395
}
396396
func (u *ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion) UnmarshalJSON(data []byte) error {
397397
return apijson.UnmarshalRoot(data, u)
@@ -847,7 +847,7 @@ type ChatCompletionContentPartUnionParam struct {
847847
}
848848

849849
func (u ChatCompletionContentPartUnionParam) MarshalJSON() ([]byte, error) {
850-
return param.MarshalUnion[ChatCompletionContentPartUnionParam](u.OfText, u.OfImageURL, u.OfInputAudio, u.OfFile)
850+
return param.MarshalUnion(u, u.OfText, u.OfImageURL, u.OfInputAudio, u.OfFile)
851851
}
852852
func (u *ChatCompletionContentPartUnionParam) UnmarshalJSON(data []byte) error {
853853
return apijson.UnmarshalRoot(data, u)
@@ -1153,7 +1153,7 @@ type ChatCompletionDeveloperMessageParamContentUnion struct {
11531153
}
11541154

11551155
func (u ChatCompletionDeveloperMessageParamContentUnion) MarshalJSON() ([]byte, error) {
1156-
return param.MarshalUnion[ChatCompletionDeveloperMessageParamContentUnion](u.OfString, u.OfArrayOfContentParts)
1156+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
11571157
}
11581158
func (u *ChatCompletionDeveloperMessageParamContentUnion) UnmarshalJSON(data []byte) error {
11591159
return apijson.UnmarshalRoot(data, u)
@@ -1439,7 +1439,7 @@ type ChatCompletionMessageParamUnion struct {
14391439
}
14401440

14411441
func (u ChatCompletionMessageParamUnion) MarshalJSON() ([]byte, error) {
1442-
return param.MarshalUnion[ChatCompletionMessageParamUnion](u.OfDeveloper,
1442+
return param.MarshalUnion(u, u.OfDeveloper,
14431443
u.OfSystem,
14441444
u.OfUser,
14451445
u.OfAssistant,
@@ -1761,7 +1761,7 @@ type ChatCompletionPredictionContentContentUnionParam struct {
17611761
}
17621762

17631763
func (u ChatCompletionPredictionContentContentUnionParam) MarshalJSON() ([]byte, error) {
1764-
return param.MarshalUnion[ChatCompletionPredictionContentContentUnionParam](u.OfString, u.OfArrayOfContentParts)
1764+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
17651765
}
17661766
func (u *ChatCompletionPredictionContentContentUnionParam) UnmarshalJSON(data []byte) error {
17671767
return apijson.UnmarshalRoot(data, u)
@@ -1852,7 +1852,7 @@ type ChatCompletionSystemMessageParamContentUnion struct {
18521852
}
18531853

18541854
func (u ChatCompletionSystemMessageParamContentUnion) MarshalJSON() ([]byte, error) {
1855-
return param.MarshalUnion[ChatCompletionSystemMessageParamContentUnion](u.OfString, u.OfArrayOfContentParts)
1855+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
18561856
}
18571857
func (u *ChatCompletionSystemMessageParamContentUnion) UnmarshalJSON(data []byte) error {
18581858
return apijson.UnmarshalRoot(data, u)
@@ -1963,7 +1963,7 @@ type ChatCompletionToolChoiceOptionUnionParam struct {
19631963
}
19641964

19651965
func (u ChatCompletionToolChoiceOptionUnionParam) MarshalJSON() ([]byte, error) {
1966-
return param.MarshalUnion[ChatCompletionToolChoiceOptionUnionParam](u.OfAuto, u.OfChatCompletionNamedToolChoice)
1966+
return param.MarshalUnion(u, u.OfAuto, u.OfChatCompletionNamedToolChoice)
19671967
}
19681968
func (u *ChatCompletionToolChoiceOptionUnionParam) UnmarshalJSON(data []byte) error {
19691969
return apijson.UnmarshalRoot(data, u)
@@ -2020,7 +2020,7 @@ type ChatCompletionToolMessageParamContentUnion struct {
20202020
}
20212021

20222022
func (u ChatCompletionToolMessageParamContentUnion) MarshalJSON() ([]byte, error) {
2023-
return param.MarshalUnion[ChatCompletionToolMessageParamContentUnion](u.OfString, u.OfArrayOfContentParts)
2023+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
20242024
}
20252025
func (u *ChatCompletionToolMessageParamContentUnion) UnmarshalJSON(data []byte) error {
20262026
return apijson.UnmarshalRoot(data, u)
@@ -2070,7 +2070,7 @@ type ChatCompletionUserMessageParamContentUnion struct {
20702070
}
20712071

20722072
func (u ChatCompletionUserMessageParamContentUnion) MarshalJSON() ([]byte, error) {
2073-
return param.MarshalUnion[ChatCompletionUserMessageParamContentUnion](u.OfString, u.OfArrayOfContentParts)
2073+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfContentParts)
20742074
}
20752075
func (u *ChatCompletionUserMessageParamContentUnion) UnmarshalJSON(data []byte) error {
20762076
return apijson.UnmarshalRoot(data, u)
@@ -2302,7 +2302,7 @@ type ChatCompletionNewParamsFunctionCallUnion struct {
23022302
}
23032303

23042304
func (u ChatCompletionNewParamsFunctionCallUnion) MarshalJSON() ([]byte, error) {
2305-
return param.MarshalUnion[ChatCompletionNewParamsFunctionCallUnion](u.OfFunctionCallMode, u.OfFunctionCallOption)
2305+
return param.MarshalUnion(u, u.OfFunctionCallMode, u.OfFunctionCallOption)
23062306
}
23072307
func (u *ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON(data []byte) error {
23082308
return apijson.UnmarshalRoot(data, u)
@@ -2367,7 +2367,7 @@ type ChatCompletionNewParamsResponseFormatUnion struct {
23672367
}
23682368

23692369
func (u ChatCompletionNewParamsResponseFormatUnion) MarshalJSON() ([]byte, error) {
2370-
return param.MarshalUnion[ChatCompletionNewParamsResponseFormatUnion](u.OfText, u.OfJSONSchema, u.OfJSONObject)
2370+
return param.MarshalUnion(u, u.OfText, u.OfJSONSchema, u.OfJSONObject)
23712371
}
23722372
func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error {
23732373
return apijson.UnmarshalRoot(data, u)
@@ -2439,7 +2439,7 @@ type ChatCompletionNewParamsStopUnion struct {
24392439
}
24402440

24412441
func (u ChatCompletionNewParamsStopUnion) MarshalJSON() ([]byte, error) {
2442-
return param.MarshalUnion[ChatCompletionNewParamsStopUnion](u.OfString, u.OfStringArray)
2442+
return param.MarshalUnion(u, u.OfString, u.OfStringArray)
24432443
}
24442444
func (u *ChatCompletionNewParamsStopUnion) UnmarshalJSON(data []byte) error {
24452445
return apijson.UnmarshalRoot(data, u)

completion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ type CompletionNewParamsPromptUnion struct {
381381
}
382382

383383
func (u CompletionNewParamsPromptUnion) MarshalJSON() ([]byte, error) {
384-
return param.MarshalUnion[CompletionNewParamsPromptUnion](u.OfString, u.OfArrayOfStrings, u.OfArrayOfTokens, u.OfArrayOfTokenArrays)
384+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfStrings, u.OfArrayOfTokens, u.OfArrayOfTokenArrays)
385385
}
386386
func (u *CompletionNewParamsPromptUnion) UnmarshalJSON(data []byte) error {
387387
return apijson.UnmarshalRoot(data, u)
@@ -410,7 +410,7 @@ type CompletionNewParamsStopUnion struct {
410410
}
411411

412412
func (u CompletionNewParamsStopUnion) MarshalJSON() ([]byte, error) {
413-
return param.MarshalUnion[CompletionNewParamsStopUnion](u.OfString, u.OfStringArray)
413+
return param.MarshalUnion(u, u.OfString, u.OfStringArray)
414414
}
415415
func (u *CompletionNewParamsStopUnion) UnmarshalJSON(data []byte) error {
416416
return apijson.UnmarshalRoot(data, u)

embedding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ type EmbeddingNewParamsInputUnion struct {
174174
}
175175

176176
func (u EmbeddingNewParamsInputUnion) MarshalJSON() ([]byte, error) {
177-
return param.MarshalUnion[EmbeddingNewParamsInputUnion](u.OfString, u.OfArrayOfStrings, u.OfArrayOfTokens, u.OfArrayOfTokenArrays)
177+
return param.MarshalUnion(u, u.OfString, u.OfArrayOfStrings, u.OfArrayOfTokens, u.OfArrayOfTokenArrays)
178178
}
179179
func (u *EmbeddingNewParamsInputUnion) UnmarshalJSON(data []byte) error {
180180
return apijson.UnmarshalRoot(data, u)

finetuningalphagrader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ type FineTuningAlphaGraderRunParamsGraderUnion struct {
301301
}
302302

303303
func (u FineTuningAlphaGraderRunParamsGraderUnion) MarshalJSON() ([]byte, error) {
304-
return param.MarshalUnion[FineTuningAlphaGraderRunParamsGraderUnion](u.OfStringCheck,
304+
return param.MarshalUnion(u, u.OfStringCheck,
305305
u.OfTextSimilarity,
306306
u.OfPython,
307307
u.OfScoreModel,
@@ -505,7 +505,7 @@ type FineTuningAlphaGraderValidateParamsGraderUnion struct {
505505
}
506506

507507
func (u FineTuningAlphaGraderValidateParamsGraderUnion) MarshalJSON() ([]byte, error) {
508-
return param.MarshalUnion[FineTuningAlphaGraderValidateParamsGraderUnion](u.OfStringCheckGrader,
508+
return param.MarshalUnion(u, u.OfStringCheckGrader,
509509
u.OfTextSimilarityGrader,
510510
u.OfPythonGrader,
511511
u.OfScoreModelGrader,

finetuningjob.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ type FineTuningJobNewParamsHyperparametersBatchSizeUnion struct {
688688
}
689689

690690
func (u FineTuningJobNewParamsHyperparametersBatchSizeUnion) MarshalJSON() ([]byte, error) {
691-
return param.MarshalUnion[FineTuningJobNewParamsHyperparametersBatchSizeUnion](u.OfAuto, u.OfInt)
691+
return param.MarshalUnion(u, u.OfAuto, u.OfInt)
692692
}
693693
func (u *FineTuningJobNewParamsHyperparametersBatchSizeUnion) UnmarshalJSON(data []byte) error {
694694
return apijson.UnmarshalRoot(data, u)
@@ -714,7 +714,7 @@ type FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion struct {
714714
}
715715

716716
func (u FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion) MarshalJSON() ([]byte, error) {
717-
return param.MarshalUnion[FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion](u.OfAuto, u.OfFloat)
717+
return param.MarshalUnion(u, u.OfAuto, u.OfFloat)
718718
}
719719
func (u *FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion) UnmarshalJSON(data []byte) error {
720720
return apijson.UnmarshalRoot(data, u)
@@ -740,7 +740,7 @@ type FineTuningJobNewParamsHyperparametersNEpochsUnion struct {
740740
}
741741

742742
func (u FineTuningJobNewParamsHyperparametersNEpochsUnion) MarshalJSON() ([]byte, error) {
743-
return param.MarshalUnion[FineTuningJobNewParamsHyperparametersNEpochsUnion](u.OfAuto, u.OfInt)
743+
return param.MarshalUnion(u, u.OfAuto, u.OfInt)
744744
}
745745
func (u *FineTuningJobNewParamsHyperparametersNEpochsUnion) UnmarshalJSON(data []byte) error {
746746
return apijson.UnmarshalRoot(data, u)

0 commit comments

Comments
 (0)