1
0
Эх сурвалжийг харах

add stream flag to the `chat()` method of `puter.ai`

Nariman Jelveh 9 сар өмнө
parent
commit
6135054b3b

+ 5 - 0
src/puter-js/src/modules/AI.js

@@ -236,6 +236,11 @@ class AI{
             driver = 'together-ai';
         }
 
+        // stream flag from settings
+        if(settings.stream !== undefined && typeof settings.stream === 'boolean'){
+            options.stream = settings.stream;
+        }
+
         // Call the original chat.complete method
         return await utils.make_driver_method(['messages'], 'puter-chat-completion', driver, 'complete', {
             test_mode: testMode ?? false,