More updates to preamble and code comments

pull/1077/head
joe-at-openai 1 year ago
parent f8a588dd6e
commit a38da6894b

@ -21,11 +21,11 @@
"\n", "\n",
"## Notebook Sections\n", "## Notebook Sections\n",
"\n", "\n",
"- **Setup:** Import packages, set any required variables and connect to a vector database.\n", "- **Setup:** Import packages and connect to a Pinecone vector database.\n",
"- **LLM Agent:** Build an agent that leverages a modified version of the [ReAct](https://react-lm.github.io/) framework to do chain-of-thought reasoning.\n", "- **LLM Agent:** Build an agent that leverages a modified version of the [ReAct](https://react-lm.github.io/) framework to do chain-of-thought reasoning.\n",
"- **LLM Agent with History:** Add the concept of memory so the LLM can draw on conversation context.\n", "- **LLM Agent with History:** Provide the LLM with access to previous steps in the conversation.\n",
"- **Knowledge Base:** Create a knowledge base of Stuff You Should Know podcast episodes that we can use as a tool.\n", "- **Knowledge Base:** Create a knowledge base of \"Stuff You Should Know\" podcast episodes, to be accessed through a tool.\n",
"- **LLM Agent with Tools:** Extend the agent with access to two tools and test that it uses both to answer questions." "- **LLM Agent with Tools:** Extend the agent with access to multiple tools and test that it uses both to answer questions."
] ]
}, },
{ {
@ -81,7 +81,6 @@
} }
], ],
"source": [ "source": [
"# Imports\n",
"import os\n", "import os\n",
"import pinecone\n", "import pinecone\n",
"import openai\n", "import openai\n",
@ -93,16 +92,15 @@
"from tqdm.auto import tqdm\n", "from tqdm.auto import tqdm\n",
"import datetime\n", "import datetime\n",
"\n", "\n",
"\n",
"# Langchain imports\n", "# Langchain imports\n",
"from langchain.agents import Tool, AgentExecutor, LLMSingleActionAgent, AgentOutputParser\n", "from langchain.agents import Tool, AgentExecutor, LLMSingleActionAgent, AgentOutputParser\n",
"from langchain.prompts import BaseChatPromptTemplate, ChatPromptTemplate\n", "from langchain.prompts import BaseChatPromptTemplate, ChatPromptTemplate\n",
"from langchain import SerpAPIWrapper, LLMChain\n", "from langchain import SerpAPIWrapper, LLMChain\n",
"from langchain.schema import AgentAction, AgentFinish, HumanMessage, SystemMessage\n", "from langchain.schema import AgentAction, AgentFinish, HumanMessage, SystemMessage\n",
"## LLM\n", "# LLM wrapper\n",
"from langchain.chat_models import ChatOpenAI\n", "from langchain.chat_models import ChatOpenAI\n",
"from langchain import OpenAI\n", "from langchain import OpenAI\n",
"## Langchain memory\n", "# Conversational memory\n",
"from langchain.memory import ConversationBufferWindowMemory\n", "from langchain.memory import ConversationBufferWindowMemory\n",
"# Embeddings and vectorstore\n", "# Embeddings and vectorstore\n",
"from langchain.embeddings.openai import OpenAIEmbeddings\n", "from langchain.embeddings.openai import OpenAIEmbeddings\n",

Loading…
Cancel
Save