File size: 1,479 Bytes
f67181d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st

# Streamlit App Title
st.title("Query Processing App")

# Query Input Section
st.subheader("Enter your Query")
query = st.text_area("Query:", height=100, key="query_input")

# Buttons in a row
col1, col2 = st.columns([1, 1])

with col1:
    if st.button("Submit"):
        st.session_state.response = "Sample Response: Processed Query"
        st.session_state.retrieved_docs = "Sample Retrieved Documents"
        st.session_state.metrics = "Sample Metrics: Accuracy 95%"

with col2:
    if st.button("Clear"):
        st.session_state.query_input = ""
        st.session_state.response = ""
        st.session_state.retrieved_docs = ""
        st.session_state.metrics = ""

# Response Text Box
st.subheader("Response")
st.text_area("Response:", value=st.session_state.get("response", ""), height=100, key="response_box", disabled=True)

# Retrieved Documents Section
if st.button("Show Retrieved Documents"):
    st.session_state.retrieved_docs = "Sample Retrieved Documents"

st.subheader("Retrieved Documents")
st.text_area("Retrieved Documents:", value=st.session_state.get("retrieved_docs", ""), height=100, key="docs_box", disabled=True)

# Metrics Calculation Section
if st.button("Calculate Metrics"):
    st.session_state.metrics = "Sample Metrics: Accuracy 95%"

st.subheader("Metrics")
st.text_area("Metrics:", value=st.session_state.get("metrics", ""), height=100, key="metrics_box", disabled=True)