Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,9 @@ import requests
|
|
| 6 |
from flask import Flask, request, jsonify, render_template
|
| 7 |
import torch
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
#Connect to index.html
|
| 10 |
app = Flask(__name__)
|
| 11 |
@app.route("/")
|
|
@@ -19,7 +22,7 @@ def ask():
|
|
| 19 |
if not question:
|
| 20 |
return jsonify({"error": "Please provide a question."}), 400
|
| 21 |
|
| 22 |
-
genai.configure(api_key=
|
| 23 |
|
| 24 |
try:
|
| 25 |
# use Google's Gemini-2.0-Flash nodle for generating content
|
|
|
|
| 6 |
from flask import Flask, request, jsonify, render_template
|
| 7 |
import torch
|
| 8 |
|
| 9 |
+
CHAT_API_KEY = os.getenv("CHAT_API_KEY")
|
| 10 |
+
|
| 11 |
+
|
| 12 |
#Connect to index.html
|
| 13 |
app = Flask(__name__)
|
| 14 |
@app.route("/")
|
|
|
|
| 22 |
if not question:
|
| 23 |
return jsonify({"error": "Please provide a question."}), 400
|
| 24 |
|
| 25 |
+
genai.configure(api_key=CHAT_API_KEY)
|
| 26 |
|
| 27 |
try:
|
| 28 |
# use Google's Gemini-2.0-Flash nodle for generating content
|