From 14b06be87dac28e52b1bf95e80fa0d323732213e Mon Sep 17 00:00:00 2001 From: Dainius Kirsnauskas Date: Tue, 28 May 2024 23:19:24 +0300 Subject: [PATCH] key --- GUI/back-end/key | 0 GUI/back-end/main.py | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 GUI/back-end/key diff --git a/GUI/back-end/key b/GUI/back-end/key new file mode 100644 index 0000000..e69de29 diff --git a/GUI/back-end/main.py b/GUI/back-end/main.py index 75ae803..c4c8bf9 100644 --- a/GUI/back-end/main.py +++ b/GUI/back-end/main.py @@ -1,3 +1,5 @@ +import logging + from flask import Flask, request from flask_cors import CORS from dotenv import load_dotenv @@ -33,10 +35,14 @@ @app.route('/api/v1/request', methods=['POST']) def process(): request_data = request.get_json() + print("Got data") + logging.info(request_data) if not request_data: return '' - openai.api_key = "sk-proj-eWH61LkiWI5jdiRVrxRhT3BlbkFJAjtKQGoYXwzt2JXaWZMz" + with open("key") as f: + openai.api_key = f.readline() + discussions = [{"role": "system", "content": "I guessed number 5"}] discussions.append({"role": "user", "content": request_data})