@@ -83,6 +83,13 @@ import { isEmptyObj } from './internal/utils/values';
8383import { Audio , AudioModel , AudioResponseFormat } from './resources/audio/audio' ;
8484import { Beta } from './resources/beta/beta' ;
8585import { Chat , ChatModel } from './resources/chat/chat' ;
86+ import { FineTuning } from './resources/fine-tuning/fine-tuning' ;
87+ import {
88+ Upload ,
89+ UploadCompleteParams ,
90+ UploadCreateParams ,
91+ Uploads as UploadsAPIUploads ,
92+ } from './resources/uploads/uploads' ;
8693import {
8794 ChatCompletion ,
8895 ChatCompletionAssistantMessageParam ,
@@ -97,9 +104,11 @@ import {
97104 ChatCompletionCreateParams ,
98105 ChatCompletionCreateParamsNonStreaming ,
99106 ChatCompletionCreateParamsStreaming ,
107+ ChatCompletionDeleted ,
100108 ChatCompletionDeveloperMessageParam ,
101109 ChatCompletionFunctionCallOption ,
102110 ChatCompletionFunctionMessageParam ,
111+ ChatCompletionListParams ,
103112 ChatCompletionMessage ,
104113 ChatCompletionMessageParam ,
105114 ChatCompletionMessageToolCall ,
@@ -108,21 +117,17 @@ import {
108117 ChatCompletionPredictionContent ,
109118 ChatCompletionReasoningEffort ,
110119 ChatCompletionRole ,
120+ ChatCompletionStoreMessage ,
111121 ChatCompletionStreamOptions ,
112122 ChatCompletionSystemMessageParam ,
113123 ChatCompletionTokenLogprob ,
114124 ChatCompletionTool ,
115125 ChatCompletionToolChoiceOption ,
116126 ChatCompletionToolMessageParam ,
127+ ChatCompletionUpdateParams ,
117128 ChatCompletionUserMessageParam ,
118- } from './resources/chat/completions' ;
119- import { FineTuning } from './resources/fine-tuning/fine-tuning' ;
120- import {
121- Upload ,
122- UploadCompleteParams ,
123- UploadCreateParams ,
124- Uploads as UploadsAPIUploads ,
125- } from './resources/uploads/uploads' ;
129+ ChatCompletionsPage ,
130+ } from './resources/chat/completions/completions' ;
126131
127132const safeJSON = ( text : string ) => {
128133 try {
@@ -378,24 +383,6 @@ export class OpenAI {
378383 return url . toString ( ) ;
379384 }
380385
381- private calculateContentLength ( body : unknown ) : string | null {
382- if ( typeof body === 'string' ) {
383- if ( typeof ( globalThis as any ) . Buffer !== 'undefined' ) {
384- return ( globalThis as any ) . Buffer . byteLength ( body , 'utf8' ) . toString ( ) ;
385- }
386-
387- if ( typeof ( globalThis as any ) . TextEncoder !== 'undefined' ) {
388- const encoder = new ( globalThis as any ) . TextEncoder ( ) ;
389- const encoded = encoder . encode ( body ) ;
390- return encoded . length . toString ( ) ;
391- }
392- } else if ( ArrayBuffer . isView ( body ) ) {
393- return body . byteLength . toString ( ) ;
394- }
395-
396- return null ;
397- }
398-
399386 /**
400387 * Used as a callback for mutating the given `FinalRequestOptions` object.
401388 */
@@ -830,6 +817,7 @@ export declare namespace OpenAI {
830817 type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio ,
831818 type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal ,
832819 type ChatCompletionContentPartText as ChatCompletionContentPartText ,
820+ type ChatCompletionDeleted as ChatCompletionDeleted ,
833821 type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam ,
834822 type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption ,
835823 type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam ,
@@ -841,16 +829,20 @@ export declare namespace OpenAI {
841829 type ChatCompletionPredictionContent as ChatCompletionPredictionContent ,
842830 type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort ,
843831 type ChatCompletionRole as ChatCompletionRole ,
832+ type ChatCompletionStoreMessage as ChatCompletionStoreMessage ,
844833 type ChatCompletionStreamOptions as ChatCompletionStreamOptions ,
845834 type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam ,
846835 type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob ,
847836 type ChatCompletionTool as ChatCompletionTool ,
848837 type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption ,
849838 type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam ,
850839 type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam ,
840+ type ChatCompletionsPage as ChatCompletionsPage ,
851841 type ChatCompletionCreateParams as ChatCompletionCreateParams ,
852842 type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming ,
853843 type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming ,
844+ type ChatCompletionUpdateParams as ChatCompletionUpdateParams ,
845+ type ChatCompletionListParams as ChatCompletionListParams ,
854846 } ;
855847
856848 export {
0 commit comments