You may want to ask a follow-up question on top of the previous questions and answers. You can do so with chat() API. Ask in a chat will answer the question based on the contents related to the question and the previous questions and answers.
By default, chat will get answers from all relevant documents in the collection. If you want to chat with a single document, you could limit the document when ask.
There is no chat HTTP API. Please use the ask API with history_messages.
import chatbees as cb
# Configure API key
cb.init(api_key="my_api_key", account_id="my_account_id")
# start a new chat
chat = cb.collection('llm_research').chat()
# to chat with a single document, specify the doc_name
# chat = cb.collection('llm_research').chat(doc_name='file.pdf')
# ask the first question
answer, refs = chat.ask('what is a transformer?')
# ask the second question
answer, refs = chat.ask('how does transformer work?')