@effect/ai-openai 0.16.5 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -283,13 +283,17 @@ export class DeleteAssistantResponse extends /*#__PURE__*/S.Class("DeleteAssista
283
283
  "deleted": S.Boolean,
284
284
  "object": DeleteAssistantResponseObject
285
285
  }) {}
286
- export class CreateSpeechRequestModelEnum extends /*#__PURE__*/S.Literal("tts-1", "tts-1-hd") {}
287
- export class CreateSpeechRequestVoice extends /*#__PURE__*/S.Literal("alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer") {}
286
+ export class CreateSpeechRequestModelEnum extends /*#__PURE__*/S.Literal("tts-1", "tts-1-hd", "gpt-4o-mini-tts") {}
287
+ export class VoiceIdsSharedEnum extends /*#__PURE__*/S.Literal("alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse") {}
288
+ export class VoiceIdsShared extends /*#__PURE__*/S.Union(S.String, VoiceIdsSharedEnum) {}
288
289
  export class CreateSpeechRequestResponseFormat extends /*#__PURE__*/S.Literal("mp3", "opus", "aac", "flac", "wav", "pcm") {}
289
290
  export class CreateSpeechRequest extends /*#__PURE__*/S.Class("CreateSpeechRequest")({
290
291
  "model": /*#__PURE__*/S.Union(S.String, CreateSpeechRequestModelEnum),
291
292
  "input": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(4096)),
292
- "voice": CreateSpeechRequestVoice,
293
+ "instructions": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(4096)), {
294
+ nullable: true
295
+ }),
296
+ "voice": VoiceIdsShared,
293
297
  "response_format": /*#__PURE__*/S.optionalWith(CreateSpeechRequestResponseFormat, {
294
298
  nullable: true,
295
299
  default: () => "mp3"
@@ -299,8 +303,16 @@ export class CreateSpeechRequest extends /*#__PURE__*/S.Class("CreateSpeechReque
299
303
  default: () => 1
300
304
  })
301
305
  }) {}
306
+ export class LogProbProperties extends /*#__PURE__*/S.Struct({
307
+ "token": S.String,
308
+ "logprob": S.Number,
309
+ "bytes": /*#__PURE__*/S.Array(S.Int)
310
+ }) {}
302
311
  export class CreateTranscriptionResponseJson extends /*#__PURE__*/S.Struct({
303
- "text": S.String
312
+ "text": S.String,
313
+ "logprobs": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(LogProbProperties), {
314
+ nullable: true
315
+ })
304
316
  }) {}
305
317
  export class TranscriptionWord extends /*#__PURE__*/S.Struct({
306
318
  "word": S.String,
@@ -438,7 +450,7 @@ export class ListBatchesResponse extends /*#__PURE__*/S.Class("ListBatchesRespon
438
450
  "has_more": S.Boolean,
439
451
  "object": ListBatchesResponseObject
440
452
  }) {}
441
- export class CreateBatchRequestEndpoint extends /*#__PURE__*/S.Literal("/v1/chat/completions", "/v1/embeddings", "/v1/completions") {}
453
+ export class CreateBatchRequestEndpoint extends /*#__PURE__*/S.Literal("/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions") {}
442
454
  export class CreateBatchRequestCompletionWindow extends /*#__PURE__*/S.Literal("24h") {}
443
455
  export class CreateBatchRequest extends /*#__PURE__*/S.Class("CreateBatchRequest")({
444
456
  "input_file_id": S.String,
@@ -568,10 +580,14 @@ export class CreateChatCompletionResponse extends /*#__PURE__*/S.Struct({
568
580
  "finish_reason": /*#__PURE__*/S.Literal("stop", "length", "tool_calls", "content_filter", "function_call"),
569
581
  "index": S.Int,
570
582
  "message": ChatCompletionResponseMessage,
571
- "logprobs": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
583
+ // TODO: change this once the following upstream issue has been closed
584
+ // https://github.com/openai/openai-openapi/issues/433
585
+ "logprobs": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
572
586
  "content": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(ChatCompletionTokenLogprob)),
573
587
  "refusal": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(ChatCompletionTokenLogprob))
574
- }))
588
+ }), {
589
+ nullable: true
590
+ })
575
591
  })),
576
592
  "created": S.Int,
577
593
  "model": S.String,
@@ -640,7 +656,7 @@ export class ChatCompletionRequestMessageContentPartFileType extends /*#__PURE__
640
656
  export class ChatCompletionRequestMessageContentPartFile extends /*#__PURE__*/S.Struct({
641
657
  "type": ChatCompletionRequestMessageContentPartFileType,
642
658
  "file": /*#__PURE__*/S.Struct({
643
- "file_name": /*#__PURE__*/S.optionalWith(S.String, {
659
+ "filename": /*#__PURE__*/S.optionalWith(S.String, {
644
660
  nullable: true
645
661
  }),
646
662
  "file_data": /*#__PURE__*/S.optionalWith(S.String, {
@@ -707,6 +723,8 @@ export class ChatCompletionRequestFunctionMessage extends /*#__PURE__*/S.Struct(
707
723
  "name": S.String
708
724
  }) {}
709
725
  export class ChatCompletionRequestMessage extends /*#__PURE__*/S.Union(ChatCompletionRequestDeveloperMessage, ChatCompletionRequestSystemMessage, ChatCompletionRequestUserMessage, ChatCompletionRequestAssistantMessage, ChatCompletionRequestToolMessage, ChatCompletionRequestFunctionMessage) {}
726
+ export class ModelIdsSharedEnum extends /*#__PURE__*/S.Literal("o3-mini", "o3-mini-2025-01-31", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "gpt-4o", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-mini-audio-preview", "gpt-4o-mini-audio-preview-2024-12-17", "gpt-4o-search-preview", "gpt-4o-mini-search-preview", "gpt-4o-search-preview-2025-03-11", "gpt-4o-mini-search-preview-2025-03-11", "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613") {}
727
+ export class ModelIdsShared extends /*#__PURE__*/S.Union(S.String, ModelIdsSharedEnum) {}
710
728
  export class ResponseModalities extends /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "audio")) {}
711
729
  export class CreateChatCompletionRequestWebSearchOptionsUserLocationType extends /*#__PURE__*/S.Literal("approximate") {}
712
730
  export class WebSearchLocation extends /*#__PURE__*/S.Struct({
@@ -725,7 +743,6 @@ export class WebSearchLocation extends /*#__PURE__*/S.Struct({
725
743
  }) {}
726
744
  export class WebSearchContextSize extends /*#__PURE__*/S.Literal("low", "medium", "high") {}
727
745
  export class CreateChatCompletionRequestServiceTier extends /*#__PURE__*/S.Literal("auto", "default") {}
728
- export class CreateChatCompletionRequestAudioVoice extends /*#__PURE__*/S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse") {}
729
746
  export class CreateChatCompletionRequestAudioFormat extends /*#__PURE__*/S.Literal("wav", "mp3", "flac", "opus", "pcm16") {}
730
747
  export class StopConfiguration extends /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(4))) {}
731
748
  export class PredictionContentType extends /*#__PURE__*/S.Literal("content") {}
@@ -766,9 +783,9 @@ export class ChatCompletionFunctions extends /*#__PURE__*/S.Struct({
766
783
  nullable: true
767
784
  })
768
785
  }) {}
769
- export class CreateChatCompletionRequestModelEnum extends /*#__PURE__*/S.Literal("o3-mini", "o3-mini-2025-01-31", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "computer-use-preview", "computer-use-preview-2025-02-04", "computer-use-preview-2025-03-11", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-4o", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-mini-audio-preview", "gpt-4o-mini-audio-preview-2024-12-17", "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613") {}
770
786
  export class CreateChatCompletionRequest extends /*#__PURE__*/S.Class("CreateChatCompletionRequest")({
771
787
  "messages": /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestMessage),
788
+ "model": ModelIdsShared,
772
789
  "modalities": /*#__PURE__*/S.optionalWith(ResponseModalities, {
773
790
  nullable: true
774
791
  }),
@@ -812,7 +829,7 @@ export class CreateChatCompletionRequest extends /*#__PURE__*/S.Class("CreateCha
812
829
  default: () => "auto"
813
830
  }),
814
831
  "audio": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
815
- "voice": CreateChatCompletionRequestAudioVoice,
832
+ "voice": VoiceIdsShared,
816
833
  "format": CreateChatCompletionRequestAudioFormat
817
834
  }), {
818
835
  nullable: true
@@ -848,7 +865,7 @@ export class CreateChatCompletionRequest extends /*#__PURE__*/S.Class("CreateCha
848
865
  "prediction": /*#__PURE__*/S.optionalWith(PredictionContent, {
849
866
  nullable: true
850
867
  }),
851
- "seed": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-9223372036854776000), /*#__PURE__*/S.lessThanOrEqualTo(9223372036854776000)), {
868
+ "seed": /*#__PURE__*/S.optionalWith(S.Int, {
852
869
  nullable: true
853
870
  }),
854
871
  "stream_options": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr(ChatCompletionStreamOptions), {
@@ -870,7 +887,6 @@ export class CreateChatCompletionRequest extends /*#__PURE__*/S.Class("CreateCha
870
887
  "functions": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(ChatCompletionFunctions).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(128)), {
871
888
  nullable: true
872
889
  }),
873
- "model": /*#__PURE__*/S.Union(S.String, CreateChatCompletionRequestModelEnum),
874
890
  "metadata": /*#__PURE__*/S.optionalWith(Metadata, {
875
891
  nullable: true
876
892
  }),
@@ -1131,6 +1147,51 @@ export class DeleteFileResponse extends /*#__PURE__*/S.Class("DeleteFileResponse
1131
1147
  "deleted": S.Boolean
1132
1148
  }) {}
1133
1149
  export class DownloadFile200 extends S.String {}
1150
+ export class ListFineTuningCheckpointPermissionsParamsOrder extends /*#__PURE__*/S.Literal("ascending", "descending") {}
1151
+ export class ListFineTuningCheckpointPermissionsParams extends /*#__PURE__*/S.Struct({
1152
+ "project_id": /*#__PURE__*/S.optionalWith(S.String, {
1153
+ nullable: true
1154
+ }),
1155
+ "after": /*#__PURE__*/S.optionalWith(S.String, {
1156
+ nullable: true
1157
+ }),
1158
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1159
+ nullable: true,
1160
+ default: () => 10
1161
+ }),
1162
+ "order": /*#__PURE__*/S.optionalWith(ListFineTuningCheckpointPermissionsParamsOrder, {
1163
+ nullable: true,
1164
+ default: () => "descending"
1165
+ })
1166
+ }) {}
1167
+ export class FineTuningCheckpointPermissionObject extends /*#__PURE__*/S.Literal("checkpoint.permission") {}
1168
+ export class FineTuningCheckpointPermission extends /*#__PURE__*/S.Struct({
1169
+ "id": S.String,
1170
+ "created_at": S.Int,
1171
+ "project_id": S.String,
1172
+ "object": FineTuningCheckpointPermissionObject
1173
+ }) {}
1174
+ export class ListFineTuningCheckpointPermissionResponseObject extends /*#__PURE__*/S.Literal("list") {}
1175
+ export class ListFineTuningCheckpointPermissionResponse extends /*#__PURE__*/S.Class("ListFineTuningCheckpointPermissionResponse")({
1176
+ "data": /*#__PURE__*/S.Array(FineTuningCheckpointPermission),
1177
+ "object": ListFineTuningCheckpointPermissionResponseObject,
1178
+ "first_id": /*#__PURE__*/S.optionalWith(S.String, {
1179
+ nullable: true
1180
+ }),
1181
+ "last_id": /*#__PURE__*/S.optionalWith(S.String, {
1182
+ nullable: true
1183
+ }),
1184
+ "has_more": S.Boolean
1185
+ }) {}
1186
+ export class CreateFineTuningCheckpointPermissionRequest extends /*#__PURE__*/S.Class("CreateFineTuningCheckpointPermissionRequest")({
1187
+ "project_ids": /*#__PURE__*/S.Array(S.String)
1188
+ }) {}
1189
+ export class DeleteFineTuningCheckpointPermissionResponseObject extends /*#__PURE__*/S.Literal("checkpoint.permission") {}
1190
+ export class DeleteFineTuningCheckpointPermissionResponse extends /*#__PURE__*/S.Class("DeleteFineTuningCheckpointPermissionResponse")({
1191
+ "id": S.String,
1192
+ "object": DeleteFineTuningCheckpointPermissionResponseObject,
1193
+ "deleted": S.Boolean
1194
+ }) {}
1134
1195
  export class ListPaginatedFineTuningJobsParams extends /*#__PURE__*/S.Struct({
1135
1196
  "after": /*#__PURE__*/S.optionalWith(S.String, {
1136
1197
  nullable: true
@@ -2813,9 +2874,11 @@ export class UserDeleteResponse extends /*#__PURE__*/S.Class("UserDeleteResponse
2813
2874
  "deleted": S.Boolean
2814
2875
  }) {}
2815
2876
  export class RealtimeSessionCreateRequestModel extends /*#__PURE__*/S.Literal("gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-mini-realtime-preview", "gpt-4o-mini-realtime-preview-2024-12-17") {}
2816
- export class RealtimeSessionCreateRequestVoice extends /*#__PURE__*/S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse") {}
2817
2877
  export class RealtimeSessionCreateRequestInputAudioFormat extends /*#__PURE__*/S.Literal("pcm16", "g711_ulaw", "g711_alaw") {}
2818
2878
  export class RealtimeSessionCreateRequestOutputAudioFormat extends /*#__PURE__*/S.Literal("pcm16", "g711_ulaw", "g711_alaw") {}
2879
+ export class RealtimeSessionCreateRequestTurnDetectionType extends /*#__PURE__*/S.Literal("server_vad", "semantic_vad") {}
2880
+ export class RealtimeSessionCreateRequestTurnDetectionEagerness extends /*#__PURE__*/S.Literal("low", "medium", "high", "auto") {}
2881
+ export class RealtimeSessionCreateRequestInputAudioNoiseReductionType extends /*#__PURE__*/S.Literal("near_field", "far_field") {}
2819
2882
  export class RealtimeSessionCreateRequestMaxResponseOutputTokensEnum extends /*#__PURE__*/S.Literal("inf") {}
2820
2883
  export class RealtimeSessionCreateRequest extends /*#__PURE__*/S.Class("RealtimeSessionCreateRequest")({
2821
2884
  "model": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestModel, {
@@ -2824,14 +2887,16 @@ export class RealtimeSessionCreateRequest extends /*#__PURE__*/S.Class("Realtime
2824
2887
  "instructions": /*#__PURE__*/S.optionalWith(S.String, {
2825
2888
  nullable: true
2826
2889
  }),
2827
- "voice": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestVoice, {
2890
+ "voice": /*#__PURE__*/S.optionalWith(VoiceIdsShared, {
2828
2891
  nullable: true
2829
2892
  }),
2830
2893
  "input_audio_format": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestInputAudioFormat, {
2831
- nullable: true
2894
+ nullable: true,
2895
+ default: () => "pcm16"
2832
2896
  }),
2833
2897
  "output_audio_format": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestOutputAudioFormat, {
2834
- nullable: true
2898
+ nullable: true,
2899
+ default: () => "pcm16"
2835
2900
  }),
2836
2901
  "input_audio_transcription": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
2837
2902
  "model": /*#__PURE__*/S.optionalWith(S.String, {
@@ -2847,8 +2912,13 @@ export class RealtimeSessionCreateRequest extends /*#__PURE__*/S.Class("Realtime
2847
2912
  nullable: true
2848
2913
  }),
2849
2914
  "turn_detection": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
2850
- "type": /*#__PURE__*/S.optionalWith(S.String, {
2851
- nullable: true
2915
+ "type": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestTurnDetectionType, {
2916
+ nullable: true,
2917
+ default: () => "server_vad"
2918
+ }),
2919
+ "eagerness": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestTurnDetectionEagerness, {
2920
+ nullable: true,
2921
+ default: () => "auto"
2852
2922
  }),
2853
2923
  "threshold": /*#__PURE__*/S.optionalWith(S.Number, {
2854
2924
  nullable: true
@@ -2870,6 +2940,13 @@ export class RealtimeSessionCreateRequest extends /*#__PURE__*/S.Class("Realtime
2870
2940
  }), {
2871
2941
  nullable: true
2872
2942
  }),
2943
+ "input_audio_noise_reduction": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
2944
+ "type": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateRequestInputAudioNoiseReductionType, {
2945
+ nullable: true
2946
+ })
2947
+ })), {
2948
+ default: () => null
2949
+ }),
2873
2950
  "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
2874
2951
  "type": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("function"), {
2875
2952
  nullable: true
@@ -2890,16 +2967,17 @@ export class RealtimeSessionCreateRequest extends /*#__PURE__*/S.Class("Realtime
2890
2967
  nullable: true
2891
2968
  }),
2892
2969
  "tool_choice": /*#__PURE__*/S.optionalWith(S.String, {
2893
- nullable: true
2970
+ nullable: true,
2971
+ default: () => "auto"
2894
2972
  }),
2895
2973
  "temperature": /*#__PURE__*/S.optionalWith(S.Number, {
2896
- nullable: true
2974
+ nullable: true,
2975
+ default: () => 0.8
2897
2976
  }),
2898
2977
  "max_response_output_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.Int, RealtimeSessionCreateRequestMaxResponseOutputTokensEnum), {
2899
2978
  nullable: true
2900
2979
  })
2901
2980
  }) {}
2902
- export class RealtimeSessionCreateResponseVoice extends /*#__PURE__*/S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse") {}
2903
2981
  export class RealtimeSessionCreateResponseMaxResponseOutputTokensEnum extends /*#__PURE__*/S.Literal("inf") {}
2904
2982
  export class RealtimeSessionCreateResponse extends /*#__PURE__*/S.Class("RealtimeSessionCreateResponse")({
2905
2983
  "client_secret": /*#__PURE__*/S.Struct({
@@ -2909,7 +2987,7 @@ export class RealtimeSessionCreateResponse extends /*#__PURE__*/S.Class("Realtim
2909
2987
  "instructions": /*#__PURE__*/S.optionalWith(S.String, {
2910
2988
  nullable: true
2911
2989
  }),
2912
- "voice": /*#__PURE__*/S.optionalWith(RealtimeSessionCreateResponseVoice, {
2990
+ "voice": /*#__PURE__*/S.optionalWith(VoiceIdsShared, {
2913
2991
  nullable: true
2914
2992
  }),
2915
2993
  "input_audio_format": /*#__PURE__*/S.optionalWith(S.String, {
@@ -2970,6 +3048,108 @@ export class RealtimeSessionCreateResponse extends /*#__PURE__*/S.Class("Realtim
2970
3048
  nullable: true
2971
3049
  })
2972
3050
  }) {}
3051
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioFormat extends /*#__PURE__*/S.Literal("pcm16", "g711_ulaw", "g711_alaw") {}
3052
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionModel extends /*#__PURE__*/S.Literal("gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1") {}
3053
+ export class RealtimeTranscriptionSessionCreateRequestTurnDetectionType extends /*#__PURE__*/S.Literal("server_vad", "semantic_vad") {}
3054
+ export class RealtimeTranscriptionSessionCreateRequestTurnDetectionEagerness extends /*#__PURE__*/S.Literal("low", "medium", "high", "auto") {}
3055
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionType extends /*#__PURE__*/S.Literal("near_field", "far_field") {}
3056
+ export class RealtimeTranscriptionSessionCreateRequest extends /*#__PURE__*/S.Class("RealtimeTranscriptionSessionCreateRequest")({
3057
+ "input_audio_format": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioFormat, {
3058
+ nullable: true,
3059
+ default: () => "pcm16"
3060
+ }),
3061
+ "input_audio_transcription": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
3062
+ "model": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionModel, {
3063
+ nullable: true
3064
+ }),
3065
+ "language": /*#__PURE__*/S.optionalWith(S.String, {
3066
+ nullable: true
3067
+ }),
3068
+ "prompt": /*#__PURE__*/S.optionalWith(S.String, {
3069
+ nullable: true
3070
+ })
3071
+ }), {
3072
+ nullable: true
3073
+ }),
3074
+ "turn_detection": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
3075
+ "type": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateRequestTurnDetectionType, {
3076
+ nullable: true,
3077
+ default: () => "server_vad"
3078
+ }),
3079
+ "eagerness": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateRequestTurnDetectionEagerness, {
3080
+ nullable: true,
3081
+ default: () => "auto"
3082
+ }),
3083
+ "threshold": /*#__PURE__*/S.optionalWith(S.Number, {
3084
+ nullable: true
3085
+ }),
3086
+ "prefix_padding_ms": /*#__PURE__*/S.optionalWith(S.Int, {
3087
+ nullable: true
3088
+ }),
3089
+ "silence_duration_ms": /*#__PURE__*/S.optionalWith(S.Int, {
3090
+ nullable: true
3091
+ }),
3092
+ "create_response": /*#__PURE__*/S.optionalWith(S.Boolean, {
3093
+ nullable: true,
3094
+ default: () => true
3095
+ }),
3096
+ "interrupt_response": /*#__PURE__*/S.optionalWith(S.Boolean, {
3097
+ nullable: true,
3098
+ default: () => true
3099
+ })
3100
+ }), {
3101
+ nullable: true
3102
+ }),
3103
+ "input_audio_noise_reduction": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
3104
+ "type": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionType, {
3105
+ nullable: true
3106
+ })
3107
+ })), {
3108
+ default: () => null
3109
+ }),
3110
+ "include": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String), {
3111
+ nullable: true
3112
+ })
3113
+ }) {}
3114
+ export class RealtimeTranscriptionSessionCreateResponseInputAudioTranscriptionModel extends /*#__PURE__*/S.Literal("gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1") {}
3115
+ export class RealtimeTranscriptionSessionCreateResponse extends /*#__PURE__*/S.Class("RealtimeTranscriptionSessionCreateResponse")({
3116
+ "client_secret": /*#__PURE__*/S.Struct({
3117
+ "value": S.String,
3118
+ "expires_at": S.Int
3119
+ }),
3120
+ "input_audio_format": /*#__PURE__*/S.optionalWith(S.String, {
3121
+ nullable: true
3122
+ }),
3123
+ "input_audio_transcription": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
3124
+ "model": /*#__PURE__*/S.optionalWith(RealtimeTranscriptionSessionCreateResponseInputAudioTranscriptionModel, {
3125
+ nullable: true
3126
+ }),
3127
+ "language": /*#__PURE__*/S.optionalWith(S.String, {
3128
+ nullable: true
3129
+ }),
3130
+ "prompt": /*#__PURE__*/S.optionalWith(S.String, {
3131
+ nullable: true
3132
+ })
3133
+ }), {
3134
+ nullable: true
3135
+ }),
3136
+ "turn_detection": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
3137
+ "type": /*#__PURE__*/S.optionalWith(S.String, {
3138
+ nullable: true
3139
+ }),
3140
+ "threshold": /*#__PURE__*/S.optionalWith(S.Number, {
3141
+ nullable: true
3142
+ }),
3143
+ "prefix_padding_ms": /*#__PURE__*/S.optionalWith(S.Int, {
3144
+ nullable: true
3145
+ }),
3146
+ "silence_duration_ms": /*#__PURE__*/S.optionalWith(S.Int, {
3147
+ nullable: true
3148
+ })
3149
+ }), {
3150
+ nullable: true
3151
+ })
3152
+ }) {}
2973
3153
  export class EasyInputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant", "system", "developer") {}
2974
3154
  export class InputTextType extends /*#__PURE__*/S.Literal("input_text") {}
2975
3155
  export class InputText extends /*#__PURE__*/S.Struct({
@@ -3205,7 +3385,9 @@ export class WebSearchToolCall extends /*#__PURE__*/S.Struct({
3205
3385
  export class FunctionToolCallType extends /*#__PURE__*/S.Literal("function_call") {}
3206
3386
  export class FunctionToolCallStatus extends /*#__PURE__*/S.Literal("in_progress", "completed", "incomplete") {}
3207
3387
  export class FunctionToolCall extends /*#__PURE__*/S.Struct({
3208
- "id": S.String,
3388
+ "id": /*#__PURE__*/S.optionalWith(S.String, {
3389
+ nullable: true
3390
+ }),
3209
3391
  "type": FunctionToolCallType,
3210
3392
  "call_id": S.String,
3211
3393
  "name": S.String,
@@ -3232,8 +3414,8 @@ export class ReasoningItemStatus extends /*#__PURE__*/S.Literal("in_progress", "
3232
3414
  export class ReasoningItem extends /*#__PURE__*/S.Struct({
3233
3415
  "type": ReasoningItemType,
3234
3416
  "id": S.String,
3235
- "content": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
3236
- "type": /*#__PURE__*/S.Literal("reasoning_summary"),
3417
+ "summary": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
3418
+ "type": /*#__PURE__*/S.Literal("summary_text"),
3237
3419
  "text": S.String
3238
3420
  })),
3239
3421
  "status": /*#__PURE__*/S.optionalWith(ReasoningItemStatus, {
@@ -3254,9 +3436,14 @@ export class InputItem extends /*#__PURE__*/S.Union(EasyInputMessage, /*#__PURE_
3254
3436
  value: S.Unknown
3255
3437
  }), ItemReference) {}
3256
3438
  export class Includable extends /*#__PURE__*/S.Literal("file_search_call.results", "message.input_image.image_url", "computer_call_output.output.image_url") {}
3439
+ export class ModelIdsResponsesEnum extends /*#__PURE__*/S.Literal("o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11") {}
3440
+ export class ModelIdsResponses extends /*#__PURE__*/S.Union(ModelIdsShared, ModelIdsResponsesEnum) {}
3257
3441
  export class ReasoningGenerateSummary extends /*#__PURE__*/S.Literal("concise", "detailed") {}
3258
3442
  export class Reasoning extends /*#__PURE__*/S.Struct({
3259
- "effort": /*#__PURE__*/S.NullOr(ReasoningEffort).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "medium")),
3443
+ "effort": /*#__PURE__*/S.optionalWith(ReasoningEffort, {
3444
+ nullable: true,
3445
+ default: () => "medium"
3446
+ }),
3260
3447
  "generate_summary": /*#__PURE__*/S.optionalWith(ReasoningGenerateSummary, {
3261
3448
  nullable: true
3262
3449
  })
@@ -3287,7 +3474,10 @@ export class ComparisonFilter extends /*#__PURE__*/S.Struct({
3287
3474
  export class CompoundFilterType extends /*#__PURE__*/S.Literal("and", "or") {}
3288
3475
  export class CompoundFilter extends /*#__PURE__*/S.Struct({
3289
3476
  "type": CompoundFilterType,
3290
- "filters": /*#__PURE__*/S.Array(ComparisonFilter)
3477
+ "filters": /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(ComparisonFilter, /*#__PURE__*/S.Record({
3478
+ key: S.String,
3479
+ value: S.Unknown
3480
+ })))
3291
3481
  }) {}
3292
3482
  export class FileSearchToolRankingOptionsRanker extends /*#__PURE__*/S.Literal("auto", "default-2024-11-15") {}
3293
3483
  export class FileSearchTool extends /*#__PURE__*/S.Struct({
@@ -3325,7 +3515,7 @@ export class FunctionTool extends /*#__PURE__*/S.Struct({
3325
3515
  }),
3326
3516
  "strict": S.Boolean
3327
3517
  }) {}
3328
- export class ComputerToolType extends /*#__PURE__*/S.Literal("computer-preview") {}
3518
+ export class ComputerToolType extends /*#__PURE__*/S.Literal("computer_use_preview") {}
3329
3519
  export class ComputerToolEnvironment extends /*#__PURE__*/S.Literal("mac", "windows", "ubuntu", "browser") {}
3330
3520
  export class ComputerTool extends /*#__PURE__*/S.Struct({
3331
3521
  "type": ComputerToolType,
@@ -3372,7 +3562,6 @@ export class ToolChoiceFunction extends /*#__PURE__*/S.Struct({
3372
3562
  "name": S.String
3373
3563
  }) {}
3374
3564
  export class CreateResponseTruncation extends /*#__PURE__*/S.Literal("auto", "disabled") {}
3375
- export class CreateResponseModelEnum extends /*#__PURE__*/S.Literal("o3-mini", "o3-mini-2025-01-31", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "computer-use-preview", "computer-use-preview-2025-02-04", "computer-use-preview-2025-03-11", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-4o", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-mini-audio-preview", "gpt-4o-mini-audio-preview-2024-12-17", "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613") {}
3376
3565
  export class CreateResponse extends /*#__PURE__*/S.Class("CreateResponse")({
3377
3566
  "input": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(InputItem)),
3378
3567
  "include": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(Includable), {
@@ -3393,6 +3582,7 @@ export class CreateResponse extends /*#__PURE__*/S.Class("CreateResponse")({
3393
3582
  "previous_response_id": /*#__PURE__*/S.optionalWith(S.String, {
3394
3583
  nullable: true
3395
3584
  }),
3585
+ "model": ModelIdsResponses,
3396
3586
  "reasoning": /*#__PURE__*/S.optionalWith(Reasoning, {
3397
3587
  nullable: true
3398
3588
  }),
@@ -3419,7 +3609,6 @@ export class CreateResponse extends /*#__PURE__*/S.Class("CreateResponse")({
3419
3609
  nullable: true,
3420
3610
  default: () => "disabled"
3421
3611
  }),
3422
- "model": /*#__PURE__*/S.Union(S.String, CreateResponseModelEnum),
3423
3612
  "metadata": /*#__PURE__*/S.optionalWith(Metadata, {
3424
3613
  nullable: true
3425
3614
  }),
@@ -3446,6 +3635,9 @@ export class ResponseIncompleteDetailsReason extends /*#__PURE__*/S.Literal("max
3446
3635
  export class OutputItem extends /*#__PURE__*/S.Union(OutputMessage, FileSearchToolCall, FunctionToolCall, WebSearchToolCall, ComputerToolCall, ReasoningItem) {}
3447
3636
  export class ResponseUsage extends /*#__PURE__*/S.Struct({
3448
3637
  "input_tokens": S.Int,
3638
+ "input_tokens_details": /*#__PURE__*/S.Struct({
3639
+ "cached_tokens": S.Int
3640
+ }),
3449
3641
  "output_tokens": S.Int,
3450
3642
  "output_tokens_details": /*#__PURE__*/S.Struct({
3451
3643
  "reasoning_tokens": S.Int
@@ -3453,7 +3645,6 @@ export class ResponseUsage extends /*#__PURE__*/S.Struct({
3453
3645
  "total_tokens": S.Int
3454
3646
  }) {}
3455
3647
  export class ResponseTruncation extends /*#__PURE__*/S.Literal("auto", "disabled") {}
3456
- export class ResponseModelEnum extends /*#__PURE__*/S.Literal("o3-mini", "o3-mini-2025-01-31", "o1", "o1-2024-12-17", "o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "computer-use-preview", "computer-use-preview-2025-02-04", "computer-use-preview-2025-03-11", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-4o", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-mini-audio-preview", "gpt-4o-mini-audio-preview-2024-12-17", "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613") {}
3457
3648
  export class Response extends /*#__PURE__*/S.Class("Response")({
3458
3649
  "id": S.String,
3459
3650
  "object": ResponseObject,
@@ -3478,6 +3669,7 @@ export class Response extends /*#__PURE__*/S.Class("Response")({
3478
3669
  "previous_response_id": /*#__PURE__*/S.optionalWith(S.String, {
3479
3670
  nullable: true
3480
3671
  }),
3672
+ "model": ModelIdsResponses,
3481
3673
  "reasoning": /*#__PURE__*/S.optionalWith(Reasoning, {
3482
3674
  nullable: true
3483
3675
  }),
@@ -3498,7 +3690,6 @@ export class Response extends /*#__PURE__*/S.Class("Response")({
3498
3690
  nullable: true,
3499
3691
  default: () => "disabled"
3500
3692
  }),
3501
- "model": /*#__PURE__*/S.Union(S.String, ResponseModelEnum),
3502
3693
  "metadata": /*#__PURE__*/S.NullOr(Metadata),
3503
3694
  "temperature": /*#__PURE__*/S.NullOr(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(2))).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 1)),
3504
3695
  "top_p": /*#__PURE__*/S.NullOr(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1))).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 1)),
@@ -3556,6 +3747,18 @@ export class ComputerToolCallOutputResource extends /*#__PURE__*/S.Struct({
3556
3747
  nullable: true
3557
3748
  })
3558
3749
  }) {}
3750
+ export class FunctionToolCallResourceType extends /*#__PURE__*/S.Literal("function_call") {}
3751
+ export class FunctionToolCallResourceStatus extends /*#__PURE__*/S.Literal("in_progress", "completed", "incomplete") {}
3752
+ export class FunctionToolCallResource extends /*#__PURE__*/S.Struct({
3753
+ "id": S.String,
3754
+ "type": FunctionToolCallResourceType,
3755
+ "call_id": S.String,
3756
+ "name": S.String,
3757
+ "arguments": S.String,
3758
+ "status": /*#__PURE__*/S.optionalWith(FunctionToolCallResourceStatus, {
3759
+ nullable: true
3760
+ })
3761
+ }) {}
3559
3762
  export class FunctionToolCallOutputResourceType extends /*#__PURE__*/S.Literal("function_call_output") {}
3560
3763
  export class FunctionToolCallOutputResourceStatus extends /*#__PURE__*/S.Literal("in_progress", "completed", "incomplete") {}
3561
3764
  export class FunctionToolCallOutputResource extends /*#__PURE__*/S.Struct({
@@ -3567,7 +3770,7 @@ export class FunctionToolCallOutputResource extends /*#__PURE__*/S.Struct({
3567
3770
  nullable: true
3568
3771
  })
3569
3772
  }) {}
3570
- export class ItemResource extends /*#__PURE__*/S.Union(InputMessageResource, OutputMessage, FileSearchToolCall, ComputerToolCall, ComputerToolCallOutputResource, WebSearchToolCall, FunctionToolCall, FunctionToolCallOutputResource) {}
3773
+ export class ItemResource extends /*#__PURE__*/S.Union(InputMessageResource, OutputMessage, FileSearchToolCall, ComputerToolCall, ComputerToolCallOutputResource, WebSearchToolCall, FunctionToolCallResource, FunctionToolCallOutputResource) {}
3571
3774
  export class ResponseItemList extends /*#__PURE__*/S.Class("ResponseItemList")({
3572
3775
  "object": ResponseItemListObject,
3573
3776
  "data": /*#__PURE__*/S.Array(ItemResource),
@@ -4722,6 +4925,23 @@ export const make = (httpClient, options = {}) => {
4722
4925
  "200": r => HttpClientResponse.schemaBodyJson(DownloadFile200)(r),
4723
4926
  orElse: response => unexpectedStatus(request, response)
4724
4927
  }))))),
4928
+ "listFineTuningCheckpointPermissions": (permissionId, options) => HttpClientRequest.make("GET")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(HttpClientRequest.setUrlParams({
4929
+ "project_id": options["project_id"],
4930
+ "after": options["after"],
4931
+ "limit": options["limit"],
4932
+ "order": options["order"]
4933
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
4934
+ "200": r => HttpClientResponse.schemaBodyJson(ListFineTuningCheckpointPermissionResponse)(r),
4935
+ orElse: response => unexpectedStatus(request, response)
4936
+ }))))),
4937
+ "createFineTuningCheckpointPermission": (permissionId, options) => HttpClientRequest.make("POST")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
4938
+ "200": r => HttpClientResponse.schemaBodyJson(ListFineTuningCheckpointPermissionResponse)(r),
4939
+ orElse: response => unexpectedStatus(request, response)
4940
+ }))))),
4941
+ "deleteFineTuningCheckpointPermission": permissionId => HttpClientRequest.make("DELETE")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
4942
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteFineTuningCheckpointPermissionResponse)(r),
4943
+ orElse: response => unexpectedStatus(request, response)
4944
+ }))))),
4725
4945
  "listPaginatedFineTuningJobs": options => HttpClientRequest.make("GET")(`/fine_tuning/jobs`).pipe(HttpClientRequest.setUrlParams({
4726
4946
  "after": options["after"],
4727
4947
  "limit": options["limit"],
@@ -5095,6 +5315,10 @@ export const make = (httpClient, options = {}) => {
5095
5315
  "200": r => HttpClientResponse.schemaBodyJson(RealtimeSessionCreateResponse)(r),
5096
5316
  orElse: response => unexpectedStatus(request, response)
5097
5317
  }))))),
5318
+ "createRealtimeTranscriptionSession": options => HttpClientRequest.make("POST")(`/realtime/transcription_sessions`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
5319
+ "200": r => HttpClientResponse.schemaBodyJson(RealtimeTranscriptionSessionCreateResponse)(r),
5320
+ orElse: response => unexpectedStatus(request, response)
5321
+ }))))),
5098
5322
  "createResponse": options => HttpClientRequest.make("POST")(`/responses`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
5099
5323
  "200": r => HttpClientResponse.schemaBodyJson(Response)(r),
5100
5324
  orElse: response => unexpectedStatus(request, response)