|
|
|
@ -177,14 +177,13 @@
|
|
|
|
|
"source": [
|
|
|
|
|
"from typing import Optional, Type\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"from langchain.callbacks.manager import (\n",
|
|
|
|
|
"# Import things that are needed generically\n",
|
|
|
|
|
"from langchain.pydantic_v1 import BaseModel, Field\n",
|
|
|
|
|
"from langchain_core.callbacks import (\n",
|
|
|
|
|
" AsyncCallbackManagerForToolRun,\n",
|
|
|
|
|
" CallbackManagerForToolRun,\n",
|
|
|
|
|
")\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Import things that are needed generically\n",
|
|
|
|
|
"from langchain.pydantic_v1 import BaseModel, Field\n",
|
|
|
|
|
"from langchain.tools import BaseTool\n",
|
|
|
|
|
"from langchain_core.tools import BaseTool\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"description_query = \"\"\"\n",
|
|
|
|
|
"MATCH (m:Movie|Person)\n",
|
|
|
|
@ -227,14 +226,13 @@
|
|
|
|
|
"source": [
|
|
|
|
|
"from typing import Optional, Type\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"from langchain.callbacks.manager import (\n",
|
|
|
|
|
"# Import things that are needed generically\n",
|
|
|
|
|
"from langchain.pydantic_v1 import BaseModel, Field\n",
|
|
|
|
|
"from langchain_core.callbacks import (\n",
|
|
|
|
|
" AsyncCallbackManagerForToolRun,\n",
|
|
|
|
|
" CallbackManagerForToolRun,\n",
|
|
|
|
|
")\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Import things that are needed generically\n",
|
|
|
|
|
"from langchain.pydantic_v1 import BaseModel, Field\n",
|
|
|
|
|
"from langchain.tools import BaseTool\n",
|
|
|
|
|
"from langchain_core.tools import BaseTool\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"class InformationInput(BaseModel):\n",
|
|
|
|
@ -287,8 +285,8 @@
|
|
|
|
|
"from langchain.agents import AgentExecutor\n",
|
|
|
|
|
"from langchain.agents.format_scratchpad import format_to_openai_function_messages\n",
|
|
|
|
|
"from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser\n",
|
|
|
|
|
"from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder\n",
|
|
|
|
|
"from langchain_core.messages import AIMessage, HumanMessage\n",
|
|
|
|
|
"from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\n",
|
|
|
|
|
"from langchain_core.utils.function_calling import convert_to_openai_function\n",
|
|
|
|
|
"from langchain_openai import ChatOpenAI\n",
|
|
|
|
|
"\n",
|
|
|
|
|