<jupyter_start><jupyter_code>from main import chat_with_pdf, print_stream_and_return_full_answer
from dotenv import load_dotenv

load_dotenv()

bert_paper_url = "https://arxiv.org/pdf/1810.04805.pdf"
questions = [
    "what is BERT?",
    "what NLP tasks does it perform well?",
    "is BERT suitable for NER?",
    "is it better than GPT",
    "when was GPT come up?",
    "when was BERT come up?",
    "so about same time?",
]

history = []
for q in questions:
    stream, context = chat_with_pdf(q, bert_paper_url, history)
    print("User: " + q, flush=True)
    print("Bot: ", end="", flush=True)
    answer = print_stream_and_return_full_answer(stream)
    history = history + [
        {"role": "user", "content": q},
        {"role": "assistant", "content": answer},
    ]<jupyter_output><empty_output>