Bytt namn: get_endpoints_with_key_values() > get_endpoints_with_key_value()

This commit is contained in:
Joakim Persson
2024-08-05 14:19:47 +02:00
parent 210a75e8bf
commit 17c20a4ce8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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.