@@ -78,8 +78,7 @@ export class LLM extends llm.LLM {
7878 // Per-call overrides win over instance defaults
7979 const resolvedParallelToolCalls =
8080 parallelToolCalls !== undefined ? parallelToolCalls : this . #opts. parallelToolCalls ;
81- const resolvedToolChoice =
82- toolChoice !== undefined ? toolChoice : this . #opts. toolChoice ;
81+ const resolvedToolChoice = toolChoice !== undefined ? toolChoice : this . #opts. toolChoice ;
8382
8483 return new LLMStream ( this , {
8584 client : this . #client,
@@ -135,13 +134,13 @@ export class LLMStream extends llm.LLMStream {
135134 const tools : any [ ] | undefined =
136135 this . toolCtx && Object . keys ( this . toolCtx ) . length > 0
137136 ? Object . entries ( this . toolCtx ) . map ( ( [ name , func ] ) => ( {
138- type : 'function' as const ,
139- function : {
140- name,
141- description : func . description ,
142- parameters : llm . toJsonSchema ( func . parameters , true , false ) ,
143- } ,
144- } ) )
137+ type : 'function' as const ,
138+ function : {
139+ name,
140+ description : func . description ,
141+ parameters : llm . toJsonSchema ( func . parameters , true , false ) ,
142+ } ,
143+ } ) )
145144 : undefined ;
146145
147146 // Apply connection timeout only to the initial chat.stream() call so long
@@ -179,10 +178,7 @@ export class LLMStream extends llm.LLMStream {
179178 } ,
180179 {
181180 fetchOptions : {
182- signal : AbortSignal . any ( [
183- this . abortController . signal ,
184- connAbortController . signal ,
185- ] ) ,
181+ signal : AbortSignal . any ( [ this . abortController . signal , connAbortController . signal ] ) ,
186182 } ,
187183 } ,
188184 ) ;
@@ -252,7 +248,6 @@ export class LLMStream extends llm.LLMStream {
252248 inProgressCalls . clear ( ) ;
253249 }
254250
255-
256251 // Regular streamed text
257252 if ( typeof delta . content === 'string' && delta . content ) {
258253 this . queue . put ( {
@@ -325,10 +320,12 @@ export class LLMStream extends llm.LLMStream {
325320 *
326321 * Mistral supports: 'auto' | 'none' | 'any'
327322 * LiveKit adds: 'required' (force at least one call) → maps to 'any'
328- * { type: 'function', function: { name } } (named tool) → not supported, falls back to 'any'
323+ * \ { type: 'function', function: \ { name \} \ } (named tool) → not supported, falls back to 'any'
329324 */
330325// eslint-disable-next-line @typescript-eslint/no-explicit-any
331- function toMistralToolChoice ( choice : llm . ToolChoice | undefined ) : 'auto' | 'none' | 'any' | undefined {
326+ function toMistralToolChoice (
327+ choice : llm . ToolChoice | undefined ,
328+ ) : 'auto' | 'none' | 'any' | undefined {
332329 if ( choice === undefined ) return undefined ;
333330 if ( choice === 'auto' ) return 'auto' ;
334331 if ( choice === 'none' ) return 'none' ;
@@ -348,7 +345,10 @@ function toMistralToolChoice(choice: llm.ToolChoice | undefined): 'auto' | 'none
348345 * FunctionCallOutput's name (defaults to '').
349346 */
350347// eslint-disable-next-line @typescript-eslint/no-explicit-any
351- function buildMessages ( chatCtx : llm . ChatContext , logger ?: { warn : ( ...args : any [ ] ) => void } ) : object [ ] {
348+ function buildMessages (
349+ chatCtx : llm . ChatContext ,
350+ logger ?: { warn : ( msg : string ) => void } ,
351+ ) : object [ ] {
352352 // eslint-disable-next-line @typescript-eslint/no-explicit-any
353353 const messages : any [ ] = [ ] ;
354354
0 commit comments