OllamaInterface/OllamaClient.py

changeset 17
43b1396fe72f
parent 15
c55270946c9a
child 21
22245a10b118
equal deleted inserted replaced
16:cb6af351310b 17:43b1396fe72f
570 """ 570 """
571 Private slot to do a periodic check of the 'ollama' server responsiveness. 571 Private slot to do a periodic check of the 'ollama' server responsiveness.
572 """ 572 """
573 responding = self.heartbeat() 573 responding = self.heartbeat()
574 if responding != self.__serverResponding: 574 if responding != self.__serverResponding:
575 msg = ( 575 msg = "" if responding else self.__serverNotRespondingMessage()
576 ""
577 if responding
578 else self.__serverNotRespondingMessage()
579 )
580 self.serverStateChanged.emit(responding, msg) 576 self.serverStateChanged.emit(responding, msg)
581 self.__serverResponding = responding 577 self.__serverResponding = responding
582 578
583 def __serverNotRespondingMessage(self): 579 def __serverNotRespondingMessage(self):
584 """ 580 """
585 Private method to assemble and return a message for a non-responsive server. 581 Private method to assemble and return a message for a non-responsive server.
586 582
587 @return error message 583 @return error message
588 @rtype str 584 @rtype str
589 """ 585 """
590 return ( 586 return (
591 self.tr( 587 self.tr(
592 "<p>Error: The local server at <b>{0}</b> is not responding." 588 "<p>Error: The local server at <b>{0}</b> is not responding.</p>"
593 "</p>"
594 ) 589 )
595 if self.__localServer 590 if self.__localServer
596 else self.tr( 591 else self.tr(
597 "<p>Error: The configured server at <b>{0}</b> is not" 592 "<p>Error: The configured server at <b>{0}</b> is not"
598 " responding.</p>" 593 " responding.</p>"

eric ide

mercurial