diff --git a/src/connection_handler.py b/src/connection_handler.py index f711c19..3c28c79 100644 --- a/src/connection_handler.py +++ b/src/connection_handler.py @@ -115,8 +115,9 @@ class instance(): else: self.remote = True if not self.remote_url: - self.remote_url = 'http://0.0.0.0:11434' - window.connection_error() + window.remote_connection_entry.set_text('http://0.0.0.0:11434') + window.remote_connection_switch.set_sensitive(True) + window.remote_connection_switch.set_active(True) def stop(self): if self.idle_timer: diff --git a/src/dialogs.py b/src/dialogs.py index 369727a..c469e13 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -3,7 +3,7 @@ Handles UI dialogs """ import os -import logging, requests, threading +import logging, requests, threading, shutil from pytube import YouTube from html2text import html2text from gi.repository import Adw, Gtk @@ -223,7 +223,8 @@ def reconnect_remote(self): extra_child=container ) dialog.add_response("close", _("Close Alpaca")) - dialog.add_response("local", _("Use local instance")) + if shutil.which('ollama'): + dialog.add_response("local", _("Use local instance")) dialog.add_response("remote", _("Connect")) dialog.set_response_appearance("remote", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("remote")