Update app.py
Browse files1234568 unmodified lines15161718192021import osimport google.generativeai as genaifrom flask import Flask, request, jsonifyfrom flask_cors import CORSapp = Flask(__name__)8 unmodified linesmodel = genai.GenerativeModel('gemini-1.5-pro')chat = model.start_chat(history=[])# --- API-Endpunkt ---@app.route('/chat', methods=['POST'])def handle_chat():try:1234568 unmodified lines151617181920212223242526272829import osimport google.generativeai as genaifrom flask import Flask, request, jsonify, Responsefrom flask_cors import CORSapp = Flask(__name__)8 unmodified linesmodel = genai.GenerativeModel('gemini-1.5-pro')chat = model.start_chat(history=[])# --- Info-Startseite für GET /@app.route('/', methods=['GET'])def index():return Response("<h2>Moejra Chat API</h2><p>Die API ist erreichbar. Sende POST-Anfragen an <code>/chat</code>.</p>",mimetype='text/html')# --- API-Endpunkt für POST /chat ---@app.route('/chat', methods=['POST'])def handle_chat():try:
app.py+10-2