From e54a409c8f4d955ddda3f3d04bb821743a995489 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Mon, 30 Jun 2025 21:16:47 +0800 Subject: new prompt --- backend/ai-vision.py | 48 --------------------------------------- backend/ai.py | 8 ------- backend/alvl.jpg | Bin 107082 -> 0 bytes backend/game_simpliCity_main.png | Bin 1522731 -> 0 bytes backend/main.py | 48 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 56 deletions(-) delete mode 100644 backend/ai-vision.py delete mode 100644 backend/ai.py delete mode 100644 backend/alvl.jpg delete mode 100644 backend/game_simpliCity_main.png create mode 100644 backend/main.py diff --git a/backend/ai-vision.py b/backend/ai-vision.py deleted file mode 100644 index 866bcb8..0000000 --- a/backend/ai-vision.py +++ /dev/null @@ -1,48 +0,0 @@ -from google import genai -from google.genai import types -import flask -import flask_cors - -app = flask.Flask(__name__) -flask_cors.CORS(app) - -UPLOAD_FOLDER = "uploads" -app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER - -client = genai.Client(api_key="AIzaSyA-mA7v4xlbEAz80uKf3Dywpbeh9ZfpLMs") - - -@app.route("/yeah", methods=["POST"]) -def yeah_flask(): - uploaded_files = flask.request.files.getlist("files") - - file_names = [] - - contents = [] - - for file in uploaded_files: - file_data = file.read() - print(file.filename) - file_names.append(file.filename) - contents.append( - types.Part.from_bytes( - data=file_data, - mime_type=file.mimetype - ) - ) - - contents.append("Please summarise the following content make it concise but detailed, organised into a mind map, structured with clear hierarchy, where each item is first prefixed and just prefixed with a > times depth, where depth starts at 1. For example, a sub item would be \">> subitem\". Do not start or end your message with an approval message, start immediately with the content requested. Absolutely do not add any blank lines, and do not add spaces after the '>' prefix. Do not add numbers after the '>' prefix.") - - response = client.models.generate_content( - model="gemini-2.0-flash", - contents=contents - ) - - print(response) - - print("hi") - return flask.jsonify({"status": "success", "map": response.text}) - - -if __name__ == '__main__': - app.run(debug=True, host='127.0.0.1', port=9000) diff --git a/backend/ai.py b/backend/ai.py deleted file mode 100644 index 1e63b94..0000000 --- a/backend/ai.py +++ /dev/null @@ -1,8 +0,0 @@ -from google import genai - -client = genai.Client(api_key="AIzaSyA-mA7v4xlbEAz80uKf3Dywpbeh9ZfpLMs") - -response = client.models.generate_content( - model="gemini-2.0-flash", contents="Explain how AI works in a few words" -) -print(response.text) diff --git a/backend/alvl.jpg b/backend/alvl.jpg deleted file mode 100644 index cd35987..0000000 Binary files a/backend/alvl.jpg and /dev/null differ diff --git a/backend/game_simpliCity_main.png b/backend/game_simpliCity_main.png deleted file mode 100644 index e31067c..0000000 Binary files a/backend/game_simpliCity_main.png and /dev/null differ diff --git a/backend/main.py b/backend/main.py new file mode 100644 index 0000000..128485f --- /dev/null +++ b/backend/main.py @@ -0,0 +1,48 @@ +from google import genai +from google.genai import types +import flask +import flask_cors + +app = flask.Flask(__name__) +flask_cors.CORS(app) + +UPLOAD_FOLDER = "uploads" +app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER + +client = genai.Client(api_key="AIzaSyA-mA7v4xlbEAz80uKf3Dywpbeh9ZfpLMs") + + +@app.route("/yeah", methods=["POST"]) +def yeah_flask(): + uploaded_files = flask.request.files.getlist("files") + + file_names = [] + + contents = [] + + for file in uploaded_files: + file_data = file.read() + print(file.filename) + file_names.append(file.filename) + contents.append( + types.Part.from_bytes( + data=file_data, + mime_type=file.mimetype + ) + ) + + contents.append("Please summarise the following content. Make it concise, but detailed (this is a priority), organised into a mind map, structured with clear hierarchy, where each item is first prefixed and just prefixed with a > times depth, where depth starts at 1. For example, a sub item would be \">> subitem\". Do not start or end your message with an approval message, start immediately with the content requested. Absolutely do not add any blank lines, and do not add spaces OR numbering after the '>' prefix.") + + response = client.models.generate_content( + model="gemini-2.0-flash", + contents=contents + ) + + print(response) + + print("hi") + return flask.jsonify({"status": "success", "map": response.text}) + + +if __name__ == '__main__': + app.run(debug=True, host='127.0.0.1', port=9000) -- cgit v1.2.3