File size: 920 Bytes
5a7dfae 34ac6dd fc3e1ac 6cf9cd1 666e576 5a7dfae 34ac6dd e7386ba 8c76a3a e468ed7 666e576 53b0d18 e468ed7 53b0d18 6cf9cd1 bb926e9 5a7dfae bb926e9 61aec1f 5a7dfae bb926e9 5a7dfae 2ae9d25 666e576 41810a3 89e8116 f964ec6 5040744 89e8116 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# Flask API
from flask import Flask, jsonify
import threading
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
@app.route('/api', methods=['POST'])
def api_endpoint():
#json_data = request.get_json()
#return json_data
prompt = request.form.get('variable')
print(prompt)
#result = selenium(prompt)
# Das Ergebnis an PHP zurückgeben
#import streamlit as st
#st.write(prompt)
#prompting(prompt)
#return prompt
def run_flask():
app.run(port=5000)
# Starte den Flask-Server in einem separaten Thread
flask_thread = threading.Thread(target=run_flask)
flask_thread.start()
# Streamlit Frontend
import streamlit as st
import requests
st.title("huhu")
#response = requests.get('https://huggingface.co/spaces/mgokg/PandasAI:5000/api?data=huhu')
#data = response.json()
#st.write(response) # Zeigt die Daten in der Streamlit-Oberfläche an
|