From 3659308675892629da80aeb5a01d321bd3581f50 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Fri, 2 Aug 2024 23:05:49 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84ndrat=20namn=20p=C3=A5=20metoder,=20*mode?= =?UTF-8?q?ls=20>=20*endpoints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smartassist/src/utils.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/smartassist/src/utils.py b/smartassist/src/utils.py index 5dd3d20..d0c5c6d 100644 --- a/smartassist/src/utils.py +++ b/smartassist/src/utils.py @@ -27,8 +27,8 @@ class GlobalState: 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 # 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) + cls._instance.backend = dict() # A dictionary that holds info on which server the clients connect to + cls._instance.endpoints = [] # A list that holds info on which endpoints are available for use (server url, model name, provider et cetera) # logging - already done in __new__, perhaps change layout later return cls._instance @@ -82,13 +82,13 @@ class GlobalState: """Getter for backend API endpoint""" return self.backend["url"]+self.backend["api"] - def set_models(self, models=None): - """Set the list of models.""" - if models is not None: - if not isinstance(models, list): - raise ValueError("Models must be a list, even if there is just one model") - self.models = models + def set_endpoints(self, endpoints=None): + """Set the list of endpoints.""" + if endpoints is not None: + if not isinstance(endpoints, list): + raise ValueError("Endpoints must be a list, even if there is just one model") + self.endpoints = endpoints - def get_models(self): - """Return the list of models""" - return self.models \ No newline at end of file + def get_endpoints(self): + """Return the list of endpoints""" + return self.endpoints \ No newline at end of file