125 |
125 |
126 self.__defaults = { |
126 self.__defaults = { |
127 "OllamaScheme": "http", |
127 "OllamaScheme": "http", |
128 "OllamaHost": "localhost", |
128 "OllamaHost": "localhost", |
129 "OllamaPort": 11434, |
129 "OllamaPort": 11434, |
|
130 "OllamaLocalPort": 11435, # port for locally started ollama server |
130 "OllamaHeartbeatInterval": 5, # 5 seconds heartbeat time; 0 = disabled |
131 "OllamaHeartbeatInterval": 5, # 5 seconds heartbeat time; 0 = disabled |
131 "StreamingChatResponse": True, |
132 "StreamingChatResponse": True, |
132 } |
133 } |
133 |
134 |
134 self.__translator = None |
135 self.__translator = None |
266 @param key the key of the value to get |
267 @param key the key of the value to get |
267 @type str |
268 @type str |
268 @return the requested setting value |
269 @return the requested setting value |
269 @rtype Any |
270 @rtype Any |
270 """ |
271 """ |
271 if key in ("OllamaPort", "OllamaHeartbeatInterval"): |
272 if key in ("OllamaPort", "OllamaLocalPort", "OllamaHeartbeatInterval"): |
272 return int( |
273 return int( |
273 Preferences.Prefs.settings.value( |
274 Preferences.Prefs.settings.value( |
274 self.PreferencesKey + "/" + key, self.__defaults[key] |
275 self.PreferencesKey + "/" + key, self.__defaults[key] |
275 ) |
276 ) |
276 ) |
277 ) |