mirror of https://github.com/hwchase17/langchain
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
529 lines
18 KiB
Plaintext
529 lines
18 KiB
Plaintext
2 years ago
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "68b24990",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
1 year ago
|
"# Combine agents and vector stores\n",
|
||
2 years ago
|
"\n",
|
||
1 year ago
|
"This notebook covers how to combine agents and vector stores. The use case for this is that you've ingested your data into a vector store and want to interact with it in an agentic manner.\n",
|
||
2 years ago
|
"\n",
|
||
1 year ago
|
"The recommended method for doing so is to create a `RetrievalQA` and then use that as a tool in the overall agent. Let's take a look at doing this below. You can do this with multiple different vector DBs, and use the agent as a way to route between them. There are two different ways of doing this - you can either let the agent use the vector stores as normal tools, or you can set `return_direct=True` to really just use the agent as a router."
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9b22020a",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
1 year ago
|
"## Create the vector store"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 16,
|
||
2 years ago
|
"id": "2e87c10a",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
11 months ago
|
"from langchain.chains import RetrievalQA\n",
|
||
2 years ago
|
"from langchain.embeddings.openai import OpenAIEmbeddings\n",
|
||
2 years ago
|
"from langchain.llms import OpenAI\n",
|
||
11 months ago
|
"from langchain.text_splitter import CharacterTextSplitter\n",
|
||
|
"from langchain.vectorstores import Chroma\n",
|
||
1 year ago
|
"\n",
|
||
2 years ago
|
"llm = OpenAI(temperature=0)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 17,
|
||
|
"id": "0b7b772b",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from pathlib import Path\n",
|
||
1 year ago
|
"\n",
|
||
2 years ago
|
"relevant_parts = []\n",
|
||
|
"for p in Path(\".\").absolute().parts:\n",
|
||
|
" relevant_parts.append(p)\n",
|
||
|
" if relevant_parts[-3:] == [\"langchain\", \"docs\", \"modules\"]:\n",
|
||
|
" break\n",
|
||
|
"doc_path = str(Path(*relevant_parts) / \"state_of_the_union.txt\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 18,
|
||
2 years ago
|
"id": "f2675861",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Running Chroma using direct local API.\n",
|
||
|
"Using DuckDB in-memory for database. Data will be transient.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"from langchain.document_loaders import TextLoader\n",
|
||
1 year ago
|
"\n",
|
||
2 years ago
|
"loader = TextLoader(doc_path)\n",
|
||
2 years ago
|
"documents = loader.load()\n",
|
||
|
"text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)\n",
|
||
|
"texts = text_splitter.split_documents(documents)\n",
|
||
|
"\n",
|
||
|
"embeddings = OpenAIEmbeddings()\n",
|
||
|
"docsearch = Chroma.from_documents(texts, embeddings, collection_name=\"state-of-union\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 4,
|
||
2 years ago
|
"id": "bc5403d4",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
1 year ago
|
"state_of_union = RetrievalQA.from_chain_type(\n",
|
||
|
" llm=llm, chain_type=\"stuff\", retriever=docsearch.as_retriever()\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 5,
|
||
2 years ago
|
"id": "1431cded",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from langchain.document_loaders import WebBaseLoader"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 6,
|
||
2 years ago
|
"id": "915d3ff3",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"loader = WebBaseLoader(\"https://beta.ruff.rs/docs/faq/\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
2 years ago
|
"execution_count": 7,
|
||
2 years ago
|
"id": "96a2edf8",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Running Chroma using direct local API.\n",
|
||
|
"Using DuckDB in-memory for database. Data will be transient.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"docs = loader.load()\n",
|
||
|
"ruff_texts = text_splitter.split_documents(docs)\n",
|
||
|
"ruff_db = Chroma.from_documents(ruff_texts, embeddings, collection_name=\"ruff\")\n",
|
||
1 year ago
|
"ruff = RetrievalQA.from_chain_type(\n",
|
||
|
" llm=llm, chain_type=\"stuff\", retriever=ruff_db.as_retriever()\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"id": "71ecef90",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "c0a6c031",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Create the Agent"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 43,
|
||
|
"id": "eb142786",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# Import things that are needed generically\n",
|
||
11 months ago
|
"from langchain.agents import AgentType, Tool, initialize_agent\n",
|
||
11 months ago
|
"from langchain.llms import OpenAI"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 44,
|
||
|
"id": "850bc4e9",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"tools = [\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"State of Union QA System\",\n",
|
||
2 years ago
|
" func=state_of_union.run,\n",
|
||
1 year ago
|
" description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question.\",\n",
|
||
2 years ago
|
" ),\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"Ruff QA System\",\n",
|
||
2 years ago
|
" func=ruff.run,\n",
|
||
1 year ago
|
" description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question.\",\n",
|
||
2 years ago
|
" ),\n",
|
||
|
"]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 45,
|
||
|
"id": "fc47f230",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# Construct the agent. We will use the default agent type here.\n",
|
||
|
"# See documentation for a full list of options.\n",
|
||
1 year ago
|
"agent = initialize_agent(\n",
|
||
|
" tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 46,
|
||
|
"id": "10ca2db8",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m I need to find out what Biden said about Ketanji Brown Jackson in the State of the Union address.\n",
|
||
|
"Action: State of Union QA System\n",
|
||
|
"Action Input: What did Biden say about Ketanji Brown Jackson in the State of the Union address?\u001b[0m\n",
|
||
|
"Observation: \u001b[36;1m\u001b[1;3m Biden said that Jackson is one of the nation's top legal minds and that she will continue Justice Breyer's legacy of excellence.\u001b[0m\n",
|
||
|
"Thought:\u001b[32;1m\u001b[1;3m I now know the final answer\n",
|
||
|
"Final Answer: Biden said that Jackson is one of the nation's top legal minds and that she will continue Justice Breyer's legacy of excellence.\u001b[0m\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"\"Biden said that Jackson is one of the nation's top legal minds and that she will continue Justice Breyer's legacy of excellence.\""
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 46,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
1 year ago
|
"agent.run(\n",
|
||
|
" \"What did biden say about ketanji brown jackson in the state of the union address?\"\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 47,
|
||
|
"id": "4e91b811",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m I need to find out the advantages of using ruff over flake8\n",
|
||
|
"Action: Ruff QA System\n",
|
||
|
"Action Input: What are the advantages of using ruff over flake8?\u001b[0m\n",
|
||
|
"Observation: \u001b[33;1m\u001b[1;3m Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code. It also re-implements some of the most popular Flake8 plugins and related code quality tools natively, including isort, yesqa, eradicate, and most of the rules implemented in pyupgrade. Ruff also supports automatically fixing its own lint violations, which Flake8 does not.\u001b[0m\n",
|
||
|
"Thought:\u001b[32;1m\u001b[1;3m I now know the final answer\n",
|
||
|
"Final Answer: Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code. It also re-implements some of the most popular Flake8 plugins and related code quality tools natively, including isort, yesqa, eradicate, and most of the rules implemented in pyupgrade. Ruff also supports automatically fixing its own lint violations, which Flake8 does not.\u001b[0m\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"'Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code. It also re-implements some of the most popular Flake8 plugins and related code quality tools natively, including isort, yesqa, eradicate, and most of the rules implemented in pyupgrade. Ruff also supports automatically fixing its own lint violations, which Flake8 does not.'"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 47,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"agent.run(\"Why use ruff over flake8?\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "787a9b5e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Use the Agent solely as a router"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9161ba91",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
2 years ago
|
"You can also set `return_direct=True` if you intend to use the agent as a router and just want to directly return the result of the RetrievalQAChain.\n",
|
||
2 years ago
|
"\n",
|
||
2 years ago
|
"Notice that in the above examples the agent did some extra work after querying the RetrievalQAChain. You can avoid that and just return the result directly."
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 48,
|
||
|
"id": "f59b377e",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"tools = [\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"State of Union QA System\",\n",
|
||
2 years ago
|
" func=state_of_union.run,\n",
|
||
|
" description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question.\",\n",
|
||
1 year ago
|
" return_direct=True,\n",
|
||
2 years ago
|
" ),\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"Ruff QA System\",\n",
|
||
2 years ago
|
" func=ruff.run,\n",
|
||
|
" description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question.\",\n",
|
||
1 year ago
|
" return_direct=True,\n",
|
||
2 years ago
|
" ),\n",
|
||
|
"]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 49,
|
||
|
"id": "8615707a",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
1 year ago
|
"agent = initialize_agent(\n",
|
||
|
" tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 50,
|
||
|
"id": "36e718a9",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m I need to find out what Biden said about Ketanji Brown Jackson in the State of the Union address.\n",
|
||
|
"Action: State of Union QA System\n",
|
||
|
"Action Input: What did Biden say about Ketanji Brown Jackson in the State of the Union address?\u001b[0m\n",
|
||
|
"Observation: \u001b[36;1m\u001b[1;3m Biden said that Jackson is one of the nation's top legal minds and that she will continue Justice Breyer's legacy of excellence.\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m\u001b[0m\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"\" Biden said that Jackson is one of the nation's top legal minds and that she will continue Justice Breyer's legacy of excellence.\""
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 50,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
1 year ago
|
"agent.run(\n",
|
||
|
" \"What did biden say about ketanji brown jackson in the state of the union address?\"\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 51,
|
||
|
"id": "edfd0a1a",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m I need to find out the advantages of using ruff over flake8\n",
|
||
|
"Action: Ruff QA System\n",
|
||
|
"Action Input: What are the advantages of using ruff over flake8?\u001b[0m\n",
|
||
|
"Observation: \u001b[33;1m\u001b[1;3m Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code. It also re-implements some of the most popular Flake8 plugins and related code quality tools natively, including isort, yesqa, eradicate, and most of the rules implemented in pyupgrade. Ruff also supports automatically fixing its own lint violations, which Flake8 does not.\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m\u001b[0m\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"' Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code. It also re-implements some of the most popular Flake8 plugins and related code quality tools natively, including isort, yesqa, eradicate, and most of the rules implemented in pyupgrade. Ruff also supports automatically fixing its own lint violations, which Flake8 does not.'"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 51,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"agent.run(\"Why use ruff over flake8?\")"
|
||
|
]
|
||
|
},
|
||
2 years ago
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "49a0cbbe",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
1 year ago
|
"## Multi-Hop vector store reasoning\n",
|
||
2 years ago
|
"\n",
|
||
1 year ago
|
"Because vector stores are easily usable as tools in agents, it is easy to use answer multi-hop questions that depend on vector stores using the existing agent framework."
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 57,
|
||
|
"id": "d397a233",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"tools = [\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"State of Union QA System\",\n",
|
||
2 years ago
|
" func=state_of_union.run,\n",
|
||
1 year ago
|
" description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question, not referencing any obscure pronouns from the conversation before.\",\n",
|
||
2 years ago
|
" ),\n",
|
||
|
" Tool(\n",
|
||
1 year ago
|
" name=\"Ruff QA System\",\n",
|
||
2 years ago
|
" func=ruff.run,\n",
|
||
1 year ago
|
" description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question, not referencing any obscure pronouns from the conversation before.\",\n",
|
||
2 years ago
|
" ),\n",
|
||
|
"]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 58,
|
||
|
"id": "06157240",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# Construct the agent. We will use the default agent type here.\n",
|
||
|
"# See documentation for a full list of options.\n",
|
||
1 year ago
|
"agent = initialize_agent(\n",
|
||
|
" tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 59,
|
||
|
"id": "b492b520",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
||
|
"\u001b[32;1m\u001b[1;3m I need to find out what tool ruff uses to run over Jupyter Notebooks, and if the president mentioned it in the state of the union.\n",
|
||
|
"Action: Ruff QA System\n",
|
||
|
"Action Input: What tool does ruff use to run over Jupyter Notebooks?\u001b[0m\n",
|
||
1 year ago
|
"Observation: \u001b[33;1m\u001b[1;3m Ruff is integrated into nbQA, a tool for running linters and code formatters over Jupyter Notebooks. After installing ruff and nbqa, you can run Ruff over a notebook like so: > nbqa ruff Untitled.html\u001b[0m\n",
|
||
2 years ago
|
"Thought:\u001b[32;1m\u001b[1;3m I now need to find out if the president mentioned this tool in the state of the union.\n",
|
||
|
"Action: State of Union QA System\n",
|
||
|
"Action Input: Did the president mention nbQA in the state of the union?\u001b[0m\n",
|
||
|
"Observation: \u001b[36;1m\u001b[1;3m No, the president did not mention nbQA in the state of the union.\u001b[0m\n",
|
||
|
"Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n",
|
||
|
"Final Answer: No, the president did not mention nbQA in the state of the union.\u001b[0m\n",
|
||
|
"\n",
|
||
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"'No, the president did not mention nbQA in the state of the union.'"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 59,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
1 year ago
|
"agent.run(\n",
|
||
|
" \"What tool does ruff use to run over Jupyter Notebooks? Did the president mention that tool in the state of the union?\"\n",
|
||
|
")"
|
||
2 years ago
|
]
|
||
|
},
|
||
2 years ago
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
2 years ago
|
"id": "b3b857d6",
|
||
2 years ago
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3 (ipykernel)",
|
||
|
"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",
|
||
9 months ago
|
"version": "3.10.1"
|
||
2 years ago
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|