Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -43,7 +43,7 @@ class FlaskResponse(ResponseParser):
|
|
| 43 |
return str(result['value'])
|
| 44 |
|
| 45 |
gemini_api_key = os.getenv('Gemini')
|
| 46 |
-
llm = ChatGoogleGenerativeAI(api_key=gemini_api_key, model='gemini-
|
| 47 |
|
| 48 |
gemini_api_key = os.environ['Gemini']
|
| 49 |
|
|
@@ -85,7 +85,7 @@ def bot():
|
|
| 85 |
# Reports endpoint
|
| 86 |
@app.route("/report", methods=["POST"])
|
| 87 |
@cross_origin()
|
| 88 |
-
def
|
| 89 |
json_data = request.json.get("json_data")
|
| 90 |
|
| 91 |
prompt = """
|
|
@@ -100,6 +100,56 @@ data:
|
|
| 100 |
|
| 101 |
return jsonify(str(report))
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
if __name__ == "__main__":
|
|
|
|
| 43 |
return str(result['value'])
|
| 44 |
|
| 45 |
gemini_api_key = os.getenv('Gemini')
|
| 46 |
+
llm = ChatGoogleGenerativeAI(api_key=gemini_api_key, model='gemini-2.0-flash-thinking-exp', temperature=0.1)
|
| 47 |
|
| 48 |
gemini_api_key = os.environ['Gemini']
|
| 49 |
|
|
|
|
| 85 |
# Reports endpoint
|
| 86 |
@app.route("/report", methods=["POST"])
|
| 87 |
@cross_origin()
|
| 88 |
+
def busines_report():
|
| 89 |
json_data = request.json.get("json_data")
|
| 90 |
|
| 91 |
prompt = """
|
|
|
|
| 100 |
|
| 101 |
return jsonify(str(report))
|
| 102 |
|
| 103 |
+
# MArketing
|
| 104 |
+
@app.route("/marketing", methods=["POST"])
|
| 105 |
+
@cross_origin()
|
| 106 |
+
def marketing():
|
| 107 |
+
json_data = request.json.get("json_data")
|
| 108 |
+
|
| 109 |
+
prompt = """
|
| 110 |
+
You are an expert MArketing Strategist. Analyze the following data and generate a comprehensive marketing strategy, be very creative:
|
| 111 |
+
""" + str(json_data)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
response = model.generate_content(prompt)
|
| 115 |
+
report = response.text
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
return jsonify(str(report))
|
| 119 |
+
|
| 120 |
+
# Business Plan
|
| 121 |
+
@app.route("/bplan", methods=["POST"])
|
| 122 |
+
@cross_origin()
|
| 123 |
+
def business_plan():
|
| 124 |
+
json_data = request.json.get("json_data")
|
| 125 |
+
|
| 126 |
+
prompt = """
|
| 127 |
+
You are an expert business analyst. Analyze the following data and generate a comprehensive business plan to help the business look for funding and support:
|
| 128 |
+
""" + str(json_data)
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
response = model.generate_content(prompt)
|
| 132 |
+
report = response.text
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
return jsonify(str(report))
|
| 136 |
+
|
| 137 |
+
#Notificatiions
|
| 138 |
+
@app.route("/notify", methods=["POST"])
|
| 139 |
+
@cross_origin()
|
| 140 |
+
def notifications():
|
| 141 |
+
json_data = request.json.get("json_data")
|
| 142 |
+
|
| 143 |
+
prompt = """
|
| 144 |
+
You are a business analyst. Write a very brief analysis and marketing tips using this business data
|
| 145 |
+
""" + str(json_data)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
response = model.generate_content(prompt)
|
| 149 |
+
report = response.text
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
return jsonify(str(report))
|
| 153 |
|
| 154 |
|
| 155 |
if __name__ == "__main__":
|