Spaces:
Build error
Build error
Update app.py
Browse files809 unmodified lines8108118128138148155 unmodified lines8218228238248258268278288 unmodified lines83783883984084184284384451 unmodified lines8968978988999009015 unmodified lines907908909910911912913809 unmodified linesif req.username:send_email_with_attachment_mailjet("lakshmivairamani@gmail.com","conversation history" + req.username, chatbot)# CSS for styling the buttons and other elementscss = """/* Example of custom button styling */5 unmodified linespadding: 10px 20px;font-size: 12px;cursor: pointer;user-select: text;cursor: text;}.gr-button:hover {8 unmodified linespadding: 10px 20px;font-size: 14px;cursor: pointer;user-select: text;cursor: text;}.gr-buttonbig:hover {51 unmodified lineswith gr.Row():with gr.Column(scale=2):message = gr.Textbox(show_label=False, container=False, placeholder="Please enter your question")with gr.Row():feedback_textbox = gr.Textbox(visible=False, show_label=False, container=False, placeholder="Please enter your feedback.")submit_feedback_button = gr.Button("Submit Feedback", visible=False,elem_classes="gr-buttonbig")5 unmodified lines#gr.ClearButton(message, elem_classes="gr-buttonbig")stop_button.click(stop_processing, [chatbot],[chatbot])button.click(handle_query, [message, chatbot], [chatbot])message.submit(handle_query, [message, chatbot], [chatbot])message.submit(lambda x: gr.update(value=""), None, [message], queue=False)809 unmodified lines8108118128138148158168178188198208218228238248258268278288298308318328335 unmodified lines8398408418428438448458 unmodified lines85485585685785885986051 unmodified lines9129139149159169179185 unmodified lines924925926927928929930931809 unmodified linesif req.username:send_email_with_attachment_mailjet("lakshmivairamani@gmail.com","conversation history" + req.username, chatbot)# List of sample autocomplete suggestionsautocomplete_suggestions = ["What is cross docking?","Can you create a bar chart with item name and quantity for warehouse WH1000001","What is GRN?","What are the active warehouses?","How can I learn Python?","Explain machine learning.","What is deep learning?","Give me some tips for learning AI."]# Function to suggest matching text based on user inputdef suggest_text(user_input):# Filter suggestions based on user inputmatches = [s for s in autocomplete_suggestions if user_input.lower() in s.lower()]return matches[:5] # Limit to top 5 suggestions# CSS for styling the buttons and other elementscss = """/* Example of custom button styling */5 unmodified linespadding: 10px 20px;font-size: 12px;cursor: pointer;}.gr-button:hover {8 unmodified linespadding: 10px 20px;font-size: 14px;cursor: pointer;}.gr-buttonbig:hover {51 unmodified lineswith gr.Row():with gr.Column(scale=2):message = gr.Textbox(show_label=False, container=False, placeholder="Please enter your question")suggestions_output = gr.HighlightedText() # Display matching suggestionswith gr.Row():feedback_textbox = gr.Textbox(visible=False, show_label=False, container=False, placeholder="Please enter your feedback.")submit_feedback_button = gr.Button("Submit Feedback", visible=False,elem_classes="gr-buttonbig")5 unmodified lines#gr.ClearButton(message, elem_classes="gr-buttonbig")stop_button.click(stop_processing, [chatbot],[chatbot])# Show suggestions as user typesmessage.change(suggest_text, inputs=textbox, outputs=suggestions_output)button.click(handle_query, [message, chatbot], [chatbot])message.submit(handle_query, [message, chatbot], [chatbot])message.submit(lambda x: gr.update(value=""), None, [message], queue=False)
app.py+23-5