File size: 747 Bytes
3827ea4
1224937
3827ea4
1224937
 
 
3827ea4
1224937
 
3827ea4
1224937
 
 
 
3827ea4
1224937
 
3827ea4
1224937
 
 
 
 
 
 
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
import streamlit as st
import requests

# Streamlit app title and description
st.title("AI Quote Explanation")
st.write("Enter a quote and get an explanation using AI.")

# User input for the quote
quote = st.text_input("Enter a quote")

# Check if the user has entered a quote
if quote:
    # API endpoint for AI explanation
    api_endpoint = "https://api.example.com/explain"

    # Send a POST request to the API
    response = requests.post(api_endpoint, json={"quote": quote})

    # Check if the request was successful
    if response.status_code == 200:
        explanation = response.json()["explanation"]
        st.write("Explanation:")
        st.write(explanation)
    else:
        st.write("Error occurred. Please try again later.")