Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
|
@@ -6,7 +7,7 @@ session = requests.Session()
|
|
6 |
|
7 |
# Function to interact with the AI
|
8 |
def chat_with_ai(message):
|
9 |
-
api_url =
|
10 |
payload = {"message": message}
|
11 |
|
12 |
try:
|
@@ -20,7 +21,7 @@ def chat_with_ai(message):
|
|
20 |
|
21 |
# Function to perform web search
|
22 |
def web_search(query):
|
23 |
-
url =
|
24 |
payload = {"query": query}
|
25 |
response = requests.post(url, json=payload)
|
26 |
|
@@ -48,13 +49,6 @@ def main():
|
|
48 |
st.sidebar.markdown("---")
|
49 |
st.sidebar.markdown("Β© 2023 HelpingAI. All rights reserved.")
|
50 |
|
51 |
-
# New Feature: User Feedback
|
52 |
-
st.sidebar.markdown("---")
|
53 |
-
st.sidebar.header("π User Feedback")
|
54 |
-
feedback = st.sidebar.text_input("Enter your feedback here:")
|
55 |
-
if st.sidebar.button("Submit Feedback"):
|
56 |
-
st.sidebar.success("Thank you for your feedback!")
|
57 |
-
|
58 |
if generate_report:
|
59 |
if query:
|
60 |
with st.spinner('π Searching...'):
|
|
|
1 |
+
import os
|
2 |
import streamlit as st
|
3 |
import requests
|
4 |
|
|
|
7 |
|
8 |
# Function to interact with the AI
|
9 |
def chat_with_ai(message):
|
10 |
+
api_url = os.getenv("CHAT_API_URL")
|
11 |
payload = {"message": message}
|
12 |
|
13 |
try:
|
|
|
21 |
|
22 |
# Function to perform web search
|
23 |
def web_search(query):
|
24 |
+
url = os.getenv("SEARCH_API_URL")
|
25 |
payload = {"query": query}
|
26 |
response = requests.post(url, json=payload)
|
27 |
|
|
|
49 |
st.sidebar.markdown("---")
|
50 |
st.sidebar.markdown("Β© 2023 HelpingAI. All rights reserved.")
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
if generate_report:
|
53 |
if query:
|
54 |
with st.spinner('π Searching...'):
|