From 17c20a4ce8045c0b63fc4f8da9ee244fe31a7349 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Mon, 5 Aug 2024 14:19:47 +0200 Subject: [PATCH] Bytt namn: get_endpoints_with_key_values() > get_endpoints_with_key_value() --- smartassist/src/startservices.py | 2 +- smartassist/src/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smartassist/src/startservices.py b/smartassist/src/startservices.py index 18aeb4c..638709f 100644 --- a/smartassist/src/startservices.py +++ b/smartassist/src/startservices.py @@ -85,7 +85,7 @@ def configure(): endpoint["default_llm"] = llm if preferred_ep: # If preferred_ep is specified, set it as the default endpoint - list_of_eps = global_state.get_endpoints_with_key_values("title", preferred_ep) # Should only be one element in the list... + list_of_eps = global_state.get_endpoints_with_key_value("title", preferred_ep) # Should only be one element in the list... default_endpoint = next(iter(list_of_eps),None) # Same as default_endpoint = list_of_eps[0] if list_of_eps else None else: default_endpoint = next(iter(endpoints),None) # Set default_endpoint to first endpoint from list of all endpoints diff --git a/smartassist/src/utils.py b/smartassist/src/utils.py index af86f7f..2f0c12c 100644 --- a/smartassist/src/utils.py +++ b/smartassist/src/utils.py @@ -216,7 +216,7 @@ class GlobalState: """ return [ep for ep in self.endpoints if key in ep] - def get_endpoints_with_key_values(self, key: str, value: any) -> list[dict]: + def get_endpoints_with_key_value(self, key: str, value: any) -> list[dict]: """ Returns a list of endpoint dictionaries that contain the specified key-value pair.