Bytt namn: get_endpoints_with_key_values() > get_endpoints_with_key_value()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user