Rensat onödiga metoder och attribut
This commit is contained in:
@@ -25,7 +25,7 @@ class GlobalState:
|
||||
cls._instance.logger.setLevel(getattr(logging, cls._instance.log_level)) # Initialize root logger level
|
||||
cls._instance.logger.info(" __new__(cls): Logger in GlobalState created: %s", cls._instance.logger)
|
||||
cls._instance.llm = "phi3:mini" # Default LLM for queries. TODO: Check with ollama server that it actually exists
|
||||
cls._instance.backend_api_ep = "http://localhost:5005/api/chat" # Default backend API endpoint
|
||||
# cls._instance.backend_api_ep = "http://localhost:5005/api/chat" # Default backend API endpoint
|
||||
# Try making things more aligned with the outline of the yaml file
|
||||
cls._instance.backend = dict() # Holds info on which server the clients connect to
|
||||
cls._instance.models = [] # A list that holds info on which models are available for use (server url, model name, provider et cetera)
|
||||
@@ -70,14 +70,6 @@ class GlobalState:
|
||||
"""Getter for which LLM is used for queries"""
|
||||
return self.llm
|
||||
|
||||
def set_backend_api_ep(self, be_api_ep=None):
|
||||
"""Set backend API endpoint"""
|
||||
self.backend_api_ep = be_api_ep
|
||||
|
||||
def get_backend_api_ep(self):
|
||||
"""Getter for backend API endpoint"""
|
||||
return self.backend_api_ep
|
||||
|
||||
def set_backend(self, backend=None):
|
||||
"""Set backend that web clients connect to"""
|
||||
self.backend = backend
|
||||
@@ -86,11 +78,16 @@ class GlobalState:
|
||||
"""Getter for backend that web clients connect to"""
|
||||
return self.backend
|
||||
|
||||
def get_backend_api_ep(self):
|
||||
"""Getter for backend API endpoint"""
|
||||
return self.backend["url"]+self.backend["api"]
|
||||
|
||||
def set_models(self, models=None):
|
||||
"""Set the list of models."""
|
||||
self.models = models
|
||||
if models is not None:
|
||||
if not isinstance(models, list):
|
||||
raise ValueError("Models must be a list")
|
||||
raise ValueError("Models must be a list, even if there is just one model")
|
||||
self.models = models
|
||||
|
||||
def get_models(self):
|
||||
"""Return the list of models"""
|
||||
|
||||
Reference in New Issue
Block a user