{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using model: gpt-3.5-turbo\n", "Loading path from disk...\n" ] } ], "source": [ "from qnabot import QnABot\n", "from dotenv import load_dotenv\n", "\n", "load_dotenv()\n", "\n", "bot = QnABot(directory=\"./examples/files\", index=\"./index.pkl\", verbose=True)\n", "# bot.save_index(\"./index.pkl\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The first roster of Avengers in comics included Iron Man, Thor, Hulk, Ant-Man, and the Wasp.\n", "SOURCES: examples/files/facts.txt\n", "Vision is an android superhero who was created by Ultron but ultimately joined the Avengers and became an important member of the team.\n", "SOURCES: examples/files/facts.txt\n" ] } ], "source": [ "bot.print_answer(\"what was the first roster of avengers in comics?\")\n", "bot.print_answer(\"Who is Vision?\")" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }