PluginAiOllama.py

changeset 5
6e8af43d537d
parent 4
7dd1b9cd3150
child 7
eb1dec15b2f0
diff -r 7dd1b9cd3150 -r 6e8af43d537d PluginAiOllama.py
--- a/PluginAiOllama.py	Mon Aug 05 18:37:16 2024 +0200
+++ b/PluginAiOllama.py	Tue Aug 06 18:18:39 2024 +0200
@@ -12,7 +12,7 @@
 from PyQt6.QtCore import QObject, Qt, QTranslator, pyqtSignal
 from PyQt6.QtGui import QKeySequence
 
-from eric7 import Preferences
+from eric7 import Globals, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricWidgets.EricApplication import ericApp
@@ -128,6 +128,7 @@
             "OllamaHost": "localhost",
             "OllamaPort": 11434,
             "OllamaHeartbeatInterval": 5,  # 5 seconds heartbeat time; 0 = disabled
+            "StreamingChatResponse": True,
         }
 
         self.__translator = None
@@ -273,6 +274,12 @@
                     self.PreferencesKey + "/" + key, self.__defaults[key]
                 )
             )
+        elif key in ("StreamingChatResponse",):
+            return Globals.toBool(
+                Preferences.Prefs.settings.value(
+                    self.PreferencesKey + "/" + key, self.__defaults[key]
+                )
+            )
         else:
             return Preferences.Prefs.settings.value(
                 self.PreferencesKey + "/" + key, self.__defaults[key]

eric ide

mercurial