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

This commit is contained in:
Nariman Jelveh 2024-08-21 20:59:42 -07:00
parent 3bface8c66
commit 6135054b3b

View File

@ -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,