@@ -382,6 +382,42 @@ If you were importing these classes at runtime, you'll need to switch to importi
382
382
The deprecated ` client.beta.chat.completions.runFunctions() ` method and all of it's surrounding types have been removed, instead you should use
383
383
` client.beta.chat.completions.runTools() ` .
384
384
385
+ ### ` .runTools() ` event / method names
386
+
387
+ To better align with the tool-based API, several event names in the ChatCompletionRunner have been renamed:
388
+
389
+ ``` ts
390
+ // Before
391
+ openai .beta .chat .completions
392
+ .runTools ({
393
+ // ..
394
+ })
395
+ .on (' functionCall' , (functionCall ) => console .log (' functionCall' , functionCall ))
396
+ .on (' functionCallResult' , (functionCallResult ) => console .log (' functionCallResult' , functionCallResult ))
397
+ .on (' finalFunctionCall' , (functionCall ) => console .log (' finalFunctionCall' , functionCall ))
398
+ .on (' finalFunctionCallResult' , (result ) => console .log (' finalFunctionCallResult' , result ));
399
+
400
+ // After
401
+ openai .beta .chat .completions
402
+ .runTools ({
403
+ // ..
404
+ })
405
+ .on (' functionToolCall' , (functionCall ) => console .log (' functionCall' , functionCall ))
406
+ .on (' functionToolCallResult' , (functionCallResult ) => console .log (' functionCallResult' , functionCallResult ))
407
+ .on (' finalFunctionToolCall' , (functionCall ) => console .log (' finalFunctionCall' , functionCall ))
408
+ .on (' finalFunctionToolCallResult' , (result ) => console .log (' finalFunctionCallResult' , result ));
409
+ ```
410
+
411
+ The following event names have been changed:
412
+ - ` functionCall ` → ` functionToolCall `
413
+ - ` functionCallResult ` → ` functionToolCallResult `
414
+ - ` finalFunctionCall ` → ` finalFunctionToolCall `
415
+ - ` finalFunctionCallResult ` → ` finalFunctionToolCallResult `
416
+
417
+ Additionally, the following methods have been renamed:
418
+ - ` runner.finalFunctionCall() ` → ` runner.finalFunctionToolCall() `
419
+ - ` runner.finalFunctionCallResult() ` → ` runner.finalFunctionToolCallResult() `
420
+
385
421
### ` openai/src ` directory removed
386
422
387
423
Previously IDEs may have auto-completed imports from the ` openai/src ` directory, however this
0 commit comments