From 9717202bb4dd5df255b2a4464d9422d3fae35db6 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Mon, 5 Aug 2024 17:10:15 +0200 Subject: [PATCH] =?UTF-8?q?Lade=20till=20ett=20skelett=20f=C3=B6r=20/api/e?= =?UTF-8?q?ndpoints=20f=C3=B6r=20att=20dynamiskt=20kunna=20fylla=20listan?= =?UTF-8?q?=20med=20m=C3=B6jliga=20val=20i=20client.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smartassist/src/backend.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/smartassist/src/backend.py b/smartassist/src/backend.py index 571cbf5..9a217f8 100644 --- a/smartassist/src/backend.py +++ b/smartassist/src/backend.py @@ -178,6 +178,18 @@ def chat(): return jsonify({'error': 'Invalid JSON response from server'}), 500 +@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'}, + ] + + return jsonify(endpoints) + @app.route('/smartassist', methods=["POST"]) def smartassist():