Spaces:
Build error
Build error
File size: 2,825 Bytes
fc7ba35 540bd44 fc7ba35 62a8fa9 fc7ba35 87902a2 fc7ba35 87902a2 73d10db 87902a2 daa41ad 87902a2 bf062f3 87902a2 bf062f3 87902a2 daa41ad 87902a2 540bd44 87902a2 fc7ba35 73d10db fc7ba35 540bd44 | 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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | import streamlit as st
from dotenv import load_dotenv
from helper.telemetry import collect_telemetry
from helper.upload_File import uploadFile
from helper.button_behaviour import hide_button
from helper.initialize_analyze_session import initialize_analyze_session
class ClientSummary:
def __init__(self):
self.initialize()
self.row1()
def initialize(self):
# FOR ENV
load_dotenv()
if 'client_summary' not in st.session_state:
st.session_state['client_summary'] = ''
if 'client_name' not in st.session_state:
st.session_state['client_name'] = ''
if 'client_website' not in st.session_state:
st.session_state['client_website'] = ''
if 'target_market' not in st.session_state:
st.session_state['target_market'] = ''
def process (self):
with st.spinner('Uploading Client Details...', show_time=True):
st.write('')
client_summary = ""
client_name = ""
client_website = ""
#
client_summary = f"Client Summary: {self.client_summary}\n"
client_name = f"{self.name}\n"
client_website = f"{self.website}\n"
debug_client_summary = {'data_field' : 'Client Summary', 'result': client_summary}
debug_client_name = {'data_field' : 'Client Name', 'result': client_name}
debug_client_website = {'data_field' : 'Client Website', 'result': client_website}
if self.client_summary:
st.session_state['client_summary'] = 'uploaded'
st.session_state['target_market'] = 'uploaded'
collect_telemetry(debug_client_summary)
if self.name:
st.session_state['client_name'] = 'uploaded'
collect_telemetry(debug_client_name)
if self.website:
st.session_state['client_website'] = 'uploaded'
collect_telemetry(debug_client_website)
def row1(self):
self.client_summary = st.text_area("Client Summary:", help="Name of business, nature of business, location, products/services")
session = st.session_state.analyze
self.name = st.text_input("Client Name:")
self.website = st.text_input("Client Website:")
if (self.client_summary or self.name or self.website) and session == 'clicked':
self.process()
if __name__ == "__main__":
st.set_page_config(layout="wide")
upload = uploadFile()
|