code: from llama_index.core.callbacks.schema import CBEventType, EventPayload
  from llama_index.core.llms import ChatMessage, ChatResponse
  from llama_index.core.schema import NodeWithScore, TextNode
  
  import chainlit as cl
  
  
  @cl.on_chat_start
  async def start():
      await cl.Message(content="LlamaIndexCb").send()
  
      cb = cl.LlamaIndexCallbackHandler()
  
      cb.on_event_start(CBEventType.RETRIEVE, payload={})
  
      await cl.sleep(0.2)
  
      cb.on_event_end(
          CBEventType.RETRIEVE,
          payload={
              EventPayload.NODES: [
                  NodeWithScore(node=TextNode(text="This is text1"), score=1)
              ]
          },
      )
  
      cb.on_event_start(CBEventType.LLM)
  
      await cl.sleep(0.2)
  
      response = ChatResponse(message=ChatMessage(content="This is the LLM response"))
      cb.on_event_end(
          CBEventType.LLM,
          payload={
              EventPayload.RESPONSE: response,
              EventPayload.PROMPT: "This is the LLM prompt",
          },
      )
  
apis: llama_index.core.schema.TextNode llama_index.core.llms.ChatMessage
extract_api: [((316, 346), 'chainlit.LlamaIndexCallbackHandler', 'cl.LlamaIndexCallbackHandler', ([], {}), '()\n', (344, 346), True, 'import chainlit as cl\n'), ((415, 428), 'chainlit.sleep', 'cl.sleep', (['(0.2)'], {}), '(0.2)\n', (423, 428), True, 'import chainlit as cl\n'), ((691, 704), 'chainlit.sleep', 'cl.sleep', (['(0.2)'], {}), '(0.2)\n', (699, 704), True, 'import chainlit as cl\n'), ((742, 789), 'llama_index.core.llms.ChatMessage', 'ChatMessage', ([], {'content': '"""This is the LLM response"""'}), "(content='This is the LLM response')\n", (753, 789), False, 'from llama_index.core.llms import ChatMessage, ChatResponse\n'), ((264, 298), 'chainlit.Message', 'cl.Message', ([], {'content': '"""LlamaIndexCb"""'}), "(content='LlamaIndexCb')\n", (274, 298), True, 'import chainlit as cl\n'), ((568, 598), 'llama_index.core.schema.TextNode', 'TextNode', ([], {'text': '"""This is text1"""'}), "(text='This is text1')\n", (576, 598), False, 'from llama_index.core.schema import NodeWithScore, TextNode\n')]