diff --git a/smartassist/src/backend.py b/smartassist/src/backend.py index 9a217f8..8ab7b6b 100644 --- a/smartassist/src/backend.py +++ b/smartassist/src/backend.py @@ -181,13 +181,20 @@ def chat(): @app.route('/api/endpoints', methods=['GET']) def get_endpoints(): # Replace this with your actual logic to fetch endpoint data - endpoints = [ - {'endpoint': 'endpoint1', 'llm': 'llm1'}, - {'endpoint': 'endpoint2', 'llm': 'llm2'}, - {'endpoint': 'endpoint3', 'llm': 'llm3'}, - {'endpoint': 'endpoint4', 'llm': 'llm4'}, - ] - + # endpoints = [ + # {'endpoint': 'endpoint1', 'llm': 'llm1'}, + # {'endpoint': 'endpoint1', 'llm': 'llm2'}, + # {'endpoint': 'endpoint2', 'llm': 'llm1'}, + # {'endpoint': 'endpoint2', 'llm': 'llm3'}, + # {'endpoint': 'endpoint2', 'llm': 'llm4'}, + # {'endpoint': 'endpoint3', 'llm': 'llm4'}, + # ] + endpoints = [] # List of dictionaries, each of which contains {'endpoint': 'endpoint1', 'llm': 'llm1'} + eps = global_state.get_endpoints() + for ep in eps: + llms = global_state.get_list_of_available_llms(ep) + for llm in llms: + endpoints.append({'endpoint': ep.get('title'), 'llm': llm}) return jsonify(endpoints)