{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from langchain import OpenAI\n", "from langchain.chat_models import ChatOpenAI\n", "from langchain.prompts import PromptTemplate\n", "from langchain.chains import LLMChain\n", "from langchain.document_loaders import TextLoader\n", "\n", "\n", "from pathlib import Path\n", "import os\n", "\n", "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", "\n", "path = Path().home() / \"Documents\" / \"csv1.csv\"\n", "loader = TextLoader(path)\n", "document = loader.load()\n", "\n", "\n", "path2 = Path().home() / \"Documents\" / \"csv2.csv\"\n", "loader2 = TextLoader(path2)\n", "document2 = loader2.load()\n", "\n", "prompt_template = \"\"\"Following are two lists of Event Titles, Dates and Descriptions in the format