Code for OrderBot not working?

I typed out the code from the chatbot section but the bot doesn’t work

My code:

39. inp = pn.widgets.TextInput(value='Hi', placeholder='Enter text here...')
40. button_conversation = pn.widgets.Button(name="Chat!")

42. interactive_conversation = pn.bind(collect_messages, button_conversation)

44. dashboard = pn.Column(
45.     inp,
46.     pn.Row(button_conversation),
47.     pn.panel(interactive_conversation, loading_indicator=True, height=300),
48. )

50. dashboard

Error message

AttributeError                            Traceback (most recent call last)
Cell In[30], line 47
     40 button_conversation = pn.widgets.Button(name="Chat!")
     42 interactive_conversation = pn.bind(collect_messages, button_conversation)
     44 dashboard = pn.Column(
     45     inp,
     46     pn.Row(button_conversation),
---> 47     pn.panel(interactive_conversation, loading_indicator=True, height=300),
     48 )
     50 dashboard
     52 # print(pn.__version__)

I fixed it but the error still persists