File size: 2,435 Bytes
5f07f11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c75d56b
5f07f11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
67
68
69
import streamlit as st
import requests
from dotenv import load_dotenv
import os
import time
from helper.telemetry import collect_telemetry
from helper.upload_File import uploadFile
from helper.button_behaviour import hide_button, unhide_button
from helper.initialize_analyze_session import initialize_analyze_session
import pandas as pd

class PullThroughOffers:
    def __init__(self, model_url):
        self.model_url = model_url
        #self.analyst_name = analyst_name
        #self.data_src = data_src
        #self.analyst_description = analyst_description
        self.initialize()
        
        self.row1()

    def initialize(self):
        # FOR ENV
        load_dotenv()

        if 'pull_through_offers' not in st.session_state:
            st.session_state['pull_through_offers'] = ''
    
    def process(self):
                session = st.session_state.analyze
                if (self.pull_through_offers) and session == 'clicked':
                    pull_through_offers = ""
                    with st.spinner('Uploading Pull Through Offers...', show_time=True):
                        st.write('')
                        
                        try:
                            pull_through_offers += f"\nPull Through Offers: {self.pull_through_offers}"
                        except KeyError:
                            pass
                        

                        
                        debug_info_pull_through_offers = {'data_field' : 'Pull through offers', 'result': pull_through_offers}
                        

                        if self.pull_through_offers:
                            st.session_state['pull_through_offers'] = 'uploaded'
                            collect_telemetry(debug_info_pull_through_offers)
                       
                        
                            
                        #with st.expander("Debug information", icon="⚙"):
                        #    st.write(debug_info)


                        st.session_state['analyzing'] = False
                                             
    def row1(self):
            
            self.pull_through_offers = st.text_input("Pull through offers (Business Context)", placeholder='Enter Pull through offers')
            
            st.session_state['analyzing'] = False

            self.process()

if __name__ == "__main__":
    st.set_page_config(layout="wide")

upload = uploadFile()