Update app.py
Browse files78 unmodified lines798081828384858613 unmodified lines10010110210310410510610710810911011111211311411511611778 unmodified linesreturn "Hello!"gift_ideas = get_top_chunks(message)messages = [{'role': 'system', 'content': f'You give really good gift ideas and are super helpful! You also tell me the price of each item. Give me 5 gift ideas if I ask. Use the following database for gift ideas: {gift_ideas}'}]if history:messages.extend(history)messages.append({"role": "user", "content": message})13 unmodified lines#print(response["choices"][0]["message"]["content"].strip())#yield response["choices"][0]["message"]["content"].strip()with gr.Row():btn1 = gr.Button("Help")btn2 = gr.Button("Pricing")btn3 = gr.Button("Contact")# Submit typed messagetxt.submit(respond, [txt, chatbot], [txt, chatbot])# Buttons act like sending a messagebtn1.click(respond, [btn1.value, chatbot], [txt, chatbot])btn2.click(respond, [btn2.value, chatbot], [txt, chatbot])btn3.click(respond, [btn3.value, chatbot], [txt, chatbot])chatbot = gr.ChatInterface(respond, type='messages', theme='hmb/amethyst')demo.launch()78 unmodified lines79808182838485868788899091929394959697989910010110210313 unmodified lines11711811912012112278 unmodified linesreturn "Hello!"gift_ideas = get_top_chunks(message)messages = [{'role': 'system', 'content': f'You give really good gift ideas and are super helpful! You also tell me the price of each item. Give me 5 gift ideas if I ask. Use the following database for gift ideas: {gift_ideas}'}]if history:messages.extend(history)with gr.Blocks() as demo:chatbot = gr.Chatbot()txt = gr.Textbox(placeholder="Type your message here...")with gr.Row():btn1 = gr.Button("Help")btn2 = gr.Button("Pricing")btn3 = gr.Button("Contact")# Submit typed messagetxt.submit(respond, [txt, chatbot], [txt, chatbot])# Buttons act like sending a messagebtn1.click(respond, [btn1.value, chatbot], [txt, chatbot])btn2.click(respond, [btn2.value, chatbot], [txt, chatbot])btn3.click(respond, [btn3.value, chatbot], [txt, chatbot])messages.append({"role": "user", "content": message})13 unmodified lines#print(response["choices"][0]["message"]["content"].strip())#yield response["choices"][0]["message"]["content"].strip()chatbot = gr.ChatInterface(respond, type='messages', theme='hmb/amethyst')demo.launch()
app.py+17-12