@@ -91,32 +91,32 @@ export class ChatOpenAIResponses<
9191 include : options ?. include ,
9292 tools : options ?. tools ?. length
9393 ? this . _reduceChatOpenAITools ( options . tools , {
94- stream : this . streaming ,
95- strict,
96- } )
94+ stream : this . streaming ,
95+ strict,
96+ } )
9797 : undefined ,
9898 tool_choice : isBuiltInToolChoice ( options ?. tool_choice )
9999 ? options ?. tool_choice
100100 : ( ( ) => {
101- const formatted = formatToOpenAIToolChoice ( options ?. tool_choice ) ;
102- if ( typeof formatted === "object" && "type" in formatted ) {
103- if ( formatted . type === "function" ) {
104- return { type : "function" , name : formatted . function . name } ;
105- } else if ( formatted . type === "allowed_tools" ) {
106- return {
107- type : "allowed_tools" ,
108- mode : formatted . allowed_tools . mode ,
109- tools : formatted . allowed_tools . tools ,
110- } ;
111- } else if ( formatted . type === "custom" ) {
112- return {
113- type : "custom" ,
114- name : formatted . custom . name ,
115- } ;
101+ const formatted = formatToOpenAIToolChoice ( options ?. tool_choice ) ;
102+ if ( typeof formatted === "object" && "type" in formatted ) {
103+ if ( formatted . type === "function" ) {
104+ return { type : "function" , name : formatted . function . name } ;
105+ } else if ( formatted . type === "allowed_tools" ) {
106+ return {
107+ type : "allowed_tools" ,
108+ mode : formatted . allowed_tools . mode ,
109+ tools : formatted . allowed_tools . tools ,
110+ } ;
111+ } else if ( formatted . type === "custom" ) {
112+ return {
113+ type : "custom" ,
114+ name : formatted . custom . name ,
115+ } ;
116+ }
116117 }
117- }
118- return undefined ;
119- } ) ( ) ,
118+ return undefined ;
119+ } ) ( ) ,
120120 text : ( ( ) => {
121121 if ( options ?. text ) return options . text ;
122122 const format = this . _getResponseFormat ( options ?. response_format ) ;
@@ -201,10 +201,10 @@ export class ChatOpenAIResponses<
201201 id : data . id ,
202202 estimatedTokenUsage : data . usage
203203 ? {
204- promptTokens : data . usage . input_tokens ,
205- completionTokens : data . usage . output_tokens ,
206- totalTokens : data . usage . total_tokens ,
207- }
204+ promptTokens : data . usage . input_tokens ,
205+ completionTokens : data . usage . output_tokens ,
206+ totalTokens : data . usage . total_tokens ,
207+ }
208208 : undefined ,
209209 } ,
210210 } ;
0 commit comments