diff --git a/docs/docs/how_to/HTML_section_aware_splitter.ipynb b/docs/docs/how_to/HTML_section_aware_splitter.ipynb index 217172d78c..be4da3f215 100644 --- a/docs/docs/how_to/HTML_section_aware_splitter.ipynb +++ b/docs/docs/how_to/HTML_section_aware_splitter.ipynb @@ -132,7 +132,7 @@ } ], "source": [ - "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", + "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", "\n", "html_string = \"\"\"\n", " \n", diff --git a/docs/docs/how_to/callbacks_async.ipynb b/docs/docs/how_to/callbacks_async.ipynb index 2892e897ed..c9b9cb406d 100644 --- a/docs/docs/how_to/callbacks_async.ipynb +++ b/docs/docs/how_to/callbacks_async.ipynb @@ -93,8 +93,8 @@ "import asyncio\n", "from typing import Any, Dict, List\n", "\n", - "from langchain.callbacks.base import AsyncCallbackHandler, BaseCallbackHandler\n", "from langchain_anthropic import ChatAnthropic\n", + "from langchain_core.callbacks import AsyncCallbackHandler, BaseCallbackHandler\n", "from langchain_core.messages import HumanMessage\n", "from langchain_core.outputs import LLMResult\n", "\n", diff --git a/docs/docs/how_to/chat_model_caching.ipynb b/docs/docs/how_to/chat_model_caching.ipynb index 1d1839c3fa..215960d553 100644 --- a/docs/docs/how_to/chat_model_caching.ipynb +++ b/docs/docs/how_to/chat_model_caching.ipynb @@ -170,7 +170,7 @@ "outputs": [], "source": [ "# We can do the same thing with a SQLite cache\n", - "from langchain.cache import SQLiteCache\n", + "from langchain_community.cache import SQLiteCache\n", "\n", "set_llm_cache(SQLiteCache(database_path=\".langchain.db\"))" ] diff --git a/docs/docs/how_to/chatbots_memory.ipynb b/docs/docs/how_to/chatbots_memory.ipynb index 2d5f35d17c..1436f350b2 100644 --- a/docs/docs/how_to/chatbots_memory.ipynb +++ b/docs/docs/how_to/chatbots_memory.ipynb @@ -165,7 +165,7 @@ } ], "source": [ - "from langchain.memory import ChatMessageHistory\n", + "from langchain_community.chat_message_histories import ChatMessageHistory\n", "\n", "demo_ephemeral_chat_history = ChatMessageHistory()\n", "\n", diff --git a/docs/docs/how_to/chatbots_tools.ipynb b/docs/docs/how_to/chatbots_tools.ipynb index 4879debe34..5ea0c54bbc 100644 --- a/docs/docs/how_to/chatbots_tools.ipynb +++ b/docs/docs/how_to/chatbots_tools.ipynb @@ -336,7 +336,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.memory import ChatMessageHistory\n", + "from langchain_community.chat_message_histories import ChatMessageHistory\n", "from langchain_core.runnables.history import RunnableWithMessageHistory\n", "\n", "demo_ephemeral_chat_history_for_chain = ChatMessageHistory()\n", diff --git a/docs/docs/how_to/configure.ipynb b/docs/docs/how_to/configure.ipynb index 19aaf7fcc0..3f4605d4d0 100644 --- a/docs/docs/how_to/configure.ipynb +++ b/docs/docs/how_to/configure.ipynb @@ -89,7 +89,7 @@ } ], "source": [ - "from langchain.prompts import PromptTemplate\n", + "from langchain_core.prompts import PromptTemplate\n", "from langchain_core.runnables import ConfigurableField\n", "from langchain_openai import ChatOpenAI\n", "\n", @@ -312,8 +312,8 @@ } ], "source": [ - "from langchain.prompts import PromptTemplate\n", "from langchain_anthropic import ChatAnthropic\n", + "from langchain_core.prompts import PromptTemplate\n", "from langchain_core.runnables import ConfigurableField\n", "from langchain_openai import ChatOpenAI\n", "\n", diff --git a/docs/docs/how_to/custom_tools.ipynb b/docs/docs/how_to/custom_tools.ipynb index ea71e204dc..e678ded1d0 100644 --- a/docs/docs/how_to/custom_tools.ipynb +++ b/docs/docs/how_to/custom_tools.ipynb @@ -258,11 +258,11 @@ "source": [ "from typing import Optional, Type\n", "\n", - "from langchain.callbacks.manager import (\n", + "from langchain.pydantic_v1 import BaseModel\n", + "from langchain_core.callbacks import (\n", " AsyncCallbackManagerForToolRun,\n", " CallbackManagerForToolRun,\n", ")\n", - "from langchain.pydantic_v1 import BaseModel\n", "from langchain_core.tools import BaseTool\n", "\n", "\n", diff --git a/docs/docs/how_to/document_loader_pdf.ipynb b/docs/docs/how_to/document_loader_pdf.ipynb index 8ca24a5ea1..a27f9383cf 100644 --- a/docs/docs/how_to/document_loader_pdf.ipynb +++ b/docs/docs/how_to/document_loader_pdf.ipynb @@ -463,7 +463,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.docstore.document import Document\n", + "from langchain_core.documents import Document\n", "\n", "cur_idx = -1\n", "semantic_snippets = []\n", diff --git a/docs/docs/how_to/example_selectors_length_based.ipynb b/docs/docs/how_to/example_selectors_length_based.ipynb index 420f581833..1074b3148e 100644 --- a/docs/docs/how_to/example_selectors_length_based.ipynb +++ b/docs/docs/how_to/example_selectors_length_based.ipynb @@ -17,8 +17,8 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts import FewShotPromptTemplate, PromptTemplate\n", - "from langchain.prompts.example_selector import LengthBasedExampleSelector\n", + "from langchain_core.example_selectors import LengthBasedExampleSelector\n", + "from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate\n", "\n", "# Examples of a pretend task of creating antonyms.\n", "examples = [\n", diff --git a/docs/docs/how_to/example_selectors_mmr.ipynb b/docs/docs/how_to/example_selectors_mmr.ipynb index 702623241c..b965a7dec7 100644 --- a/docs/docs/how_to/example_selectors_mmr.ipynb +++ b/docs/docs/how_to/example_selectors_mmr.ipynb @@ -17,12 +17,12 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts import FewShotPromptTemplate, PromptTemplate\n", - "from langchain.prompts.example_selector import (\n", + "from langchain_community.vectorstores import FAISS\n", + "from langchain_core.example_selectors import (\n", " MaxMarginalRelevanceExampleSelector,\n", " SemanticSimilarityExampleSelector,\n", ")\n", - "from langchain_community.vectorstores import FAISS\n", + "from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate\n", "from langchain_openai import OpenAIEmbeddings\n", "\n", "example_prompt = PromptTemplate(\n", diff --git a/docs/docs/how_to/example_selectors_ngram.ipynb b/docs/docs/how_to/example_selectors_ngram.ipynb index e50e5254fa..fb464ef8e3 100644 --- a/docs/docs/how_to/example_selectors_ngram.ipynb +++ b/docs/docs/how_to/example_selectors_ngram.ipynb @@ -19,8 +19,8 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts import FewShotPromptTemplate, PromptTemplate\n", - "from langchain.prompts.example_selector.ngram_overlap import NGramOverlapExampleSelector\n", + "from langchain_community.example_selectors import NGramOverlapExampleSelector\n", + "from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate\n", "\n", "example_prompt = PromptTemplate(\n", " input_variables=[\"input\", \"output\"],\n", diff --git a/docs/docs/how_to/example_selectors_similarity.ipynb b/docs/docs/how_to/example_selectors_similarity.ipynb index 701f9bfc97..d6e692cfac 100644 --- a/docs/docs/how_to/example_selectors_similarity.ipynb +++ b/docs/docs/how_to/example_selectors_similarity.ipynb @@ -17,9 +17,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts import FewShotPromptTemplate, PromptTemplate\n", - "from langchain.prompts.example_selector import SemanticSimilarityExampleSelector\n", "from langchain_chroma import Chroma\n", + "from langchain_core.example_selectors import SemanticSimilarityExampleSelector\n", + "from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate\n", "from langchain_openai import OpenAIEmbeddings\n", "\n", "example_prompt = PromptTemplate(\n", diff --git a/docs/docs/how_to/extraction_parse.ipynb b/docs/docs/how_to/extraction_parse.ipynb index 7fdc5e6120..84a8bdad95 100644 --- a/docs/docs/how_to/extraction_parse.ipynb +++ b/docs/docs/how_to/extraction_parse.ipynb @@ -69,7 +69,7 @@ "source": [ "from typing import List, Optional\n", "\n", - "from langchain.output_parsers import PydanticOutputParser\n", + "from langchain_core.output_parsers import PydanticOutputParser\n", "from langchain_core.prompts import ChatPromptTemplate\n", "from langchain_core.pydantic_v1 import BaseModel, Field, validator\n", "\n", diff --git a/docs/docs/how_to/fallbacks.ipynb b/docs/docs/how_to/fallbacks.ipynb index 6156bad0d3..8f8117d76c 100644 --- a/docs/docs/how_to/fallbacks.ipynb +++ b/docs/docs/how_to/fallbacks.ipynb @@ -53,7 +53,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain_community.chat_models import ChatAnthropic\n", + "from langchain_anthropic import ChatAnthropic\n", "from langchain_openai import ChatOpenAI" ] }, diff --git a/docs/docs/how_to/few_shot_examples.ipynb b/docs/docs/how_to/few_shot_examples.ipynb index 41025d03fd..625e0afe5e 100644 --- a/docs/docs/how_to/few_shot_examples.ipynb +++ b/docs/docs/how_to/few_shot_examples.ipynb @@ -45,7 +45,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts.prompt import PromptTemplate\n", + "from langchain_core.prompts import PromptTemplate\n", "\n", "example_prompt = PromptTemplate.from_template(\"Question: {question}\\n{answer}\")" ] @@ -222,7 +222,7 @@ } ], "source": [ - "from langchain.prompts.few_shot import FewShotPromptTemplate\n", + "from langchain_core.prompts import FewShotPromptTemplate\n", "\n", "prompt = FewShotPromptTemplate(\n", " examples=examples,\n", @@ -282,8 +282,8 @@ } ], "source": [ - "from langchain.prompts.example_selector import SemanticSimilarityExampleSelector\n", "from langchain_chroma import Chroma\n", + "from langchain_core.example_selectors import SemanticSimilarityExampleSelector\n", "from langchain_openai import OpenAIEmbeddings\n", "\n", "example_selector = SemanticSimilarityExampleSelector.from_examples(\n", diff --git a/docs/docs/how_to/few_shot_examples_chat.ipynb b/docs/docs/how_to/few_shot_examples_chat.ipynb index cf003eb7a9..cee98c0411 100644 --- a/docs/docs/how_to/few_shot_examples_chat.ipynb +++ b/docs/docs/how_to/few_shot_examples_chat.ipynb @@ -88,10 +88,7 @@ }, "outputs": [], "source": [ - "from langchain.prompts import (\n", - " ChatPromptTemplate,\n", - " FewShotChatMessagePromptTemplate,\n", - ")\n", + "from langchain_core.prompts import ChatPromptTemplate, FewShotChatMessagePromptTemplate\n", "\n", "examples = [\n", " {\"input\": \"2+2\", \"output\": \"4\"},\n", @@ -218,8 +215,8 @@ }, "outputs": [], "source": [ - "from langchain.prompts import SemanticSimilarityExampleSelector\n", "from langchain_chroma import Chroma\n", + "from langchain_core.example_selectors import SemanticSimilarityExampleSelector\n", "from langchain_openai import OpenAIEmbeddings\n", "\n", "examples = [\n", @@ -305,10 +302,7 @@ } ], "source": [ - "from langchain.prompts import (\n", - " ChatPromptTemplate,\n", - " FewShotChatMessagePromptTemplate,\n", - ")\n", + "from langchain_core.prompts import ChatPromptTemplate, FewShotChatMessagePromptTemplate\n", "\n", "# Define the few-shot prompt.\n", "few_shot_prompt = FewShotChatMessagePromptTemplate(\n", diff --git a/docs/docs/how_to/graph_semantic.ipynb b/docs/docs/how_to/graph_semantic.ipynb index 97b823fc1e..42367e3d33 100644 --- a/docs/docs/how_to/graph_semantic.ipynb +++ b/docs/docs/how_to/graph_semantic.ipynb @@ -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", diff --git a/docs/docs/how_to/indexing.ipynb b/docs/docs/how_to/indexing.ipynb index 1a17d51645..a80dbd1281 100644 --- a/docs/docs/how_to/indexing.ipynb +++ b/docs/docs/how_to/indexing.ipynb @@ -786,7 +786,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain_community.document_loaders.base import BaseLoader\n", + "from langchain_core.document_loaders import BaseLoader\n", "\n", "\n", "class MyCustomLoader(BaseLoader):\n", diff --git a/docs/docs/how_to/inspect.ipynb b/docs/docs/how_to/inspect.ipynb index 41b446f649..e3f82cbcc9 100644 --- a/docs/docs/how_to/inspect.ipynb +++ b/docs/docs/how_to/inspect.ipynb @@ -39,9 +39,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.prompts import ChatPromptTemplate\n", "from langchain_community.vectorstores import FAISS\n", "from langchain_core.output_parsers import StrOutputParser\n", + "from langchain_core.prompts import ChatPromptTemplate\n", "from langchain_core.runnables import RunnablePassthrough\n", "from langchain_openai import ChatOpenAI, OpenAIEmbeddings\n", "\n", diff --git a/docs/docs/how_to/llm_caching.ipynb b/docs/docs/how_to/llm_caching.ipynb index 074d1ee2d0..fbe747ac29 100644 --- a/docs/docs/how_to/llm_caching.ipynb +++ b/docs/docs/how_to/llm_caching.ipynb @@ -119,7 +119,7 @@ "outputs": [], "source": [ "# We can do the same thing with a SQLite cache\n", - "from langchain.cache import SQLiteCache\n", + "from langchain_community.cache import SQLiteCache\n", "\n", "set_llm_cache(SQLiteCache(database_path=\".langchain.db\"))" ] diff --git a/docs/docs/how_to/local_llms.ipynb b/docs/docs/how_to/local_llms.ipynb index f5eafd003a..795e8832a3 100644 --- a/docs/docs/how_to/local_llms.ipynb +++ b/docs/docs/how_to/local_llms.ipynb @@ -134,8 +134,7 @@ } ], "source": [ - "from langchain.callbacks.manager import CallbackManager\n", - "from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler\n", + "from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler\n", "\n", "llm = Ollama(\n", " model=\"llama2\", callback_manager=CallbackManager([StreamingStdOutCallbackHandler()])\n", @@ -288,9 +287,8 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.callbacks.manager import CallbackManager\n", - "from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler\n", "from langchain_community.llms import LlamaCpp\n", + "from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler\n", "\n", "llm = LlamaCpp(\n", " model_path=\"/Users/rlm/Desktop/Code/llama.cpp/models/openorca-platypus2-13b.gguf.q4_0.bin\",\n", diff --git a/docs/docs/how_to/long_context_reorder.ipynb b/docs/docs/how_to/long_context_reorder.ipynb index 56911166ec..f84fad93df 100644 --- a/docs/docs/how_to/long_context_reorder.ipynb +++ b/docs/docs/how_to/long_context_reorder.ipynb @@ -52,11 +52,11 @@ ], "source": [ "from langchain.chains import LLMChain, StuffDocumentsChain\n", - "from langchain.prompts import PromptTemplate\n", "from langchain_chroma import Chroma\n", "from langchain_community.document_transformers import (\n", " LongContextReorder,\n", ")\n", + "from langchain_core.prompts import PromptTemplate\n", "from langchain_huggingface import HuggingFaceEmbeddings\n", "from langchain_openai import OpenAI\n", "\n", diff --git a/docs/docs/how_to/migrate_agent.ipynb b/docs/docs/how_to/migrate_agent.ipynb index e1ed3b0d08..3ca7441db6 100644 --- a/docs/docs/how_to/migrate_agent.ipynb +++ b/docs/docs/how_to/migrate_agent.ipynb @@ -344,7 +344,7 @@ ], "source": [ "from langchain.agents import AgentExecutor, create_tool_calling_agent\n", - "from langchain.memory import ChatMessageHistory\n", + "from langchain_community.chat_message_histories import ChatMessageHistory\n", "from langchain_core.prompts import ChatPromptTemplate\n", "from langchain_core.runnables.history import RunnableWithMessageHistory\n", "from langchain_core.tools import tool\n", diff --git a/docs/docs/how_to/multi_vector.ipynb b/docs/docs/how_to/multi_vector.ipynb index 9a2948215c..34952b3074 100644 --- a/docs/docs/how_to/multi_vector.ipynb +++ b/docs/docs/how_to/multi_vector.ipynb @@ -423,7 +423,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.output_parsers.openai_functions import JsonKeyOutputFunctionsParser\n", + "from langchain_core.output_parsers.openai_functions import JsonKeyOutputFunctionsParser\n", "\n", "chain = (\n", " {\"doc\": lambda x: x.page_content}\n", diff --git a/docs/docs/how_to/output_parser_fixing.ipynb b/docs/docs/how_to/output_parser_fixing.ipynb index ce6c75bd7d..2aaa3e425b 100644 --- a/docs/docs/how_to/output_parser_fixing.ipynb +++ b/docs/docs/how_to/output_parser_fixing.ipynb @@ -23,7 +23,7 @@ "source": [ "from typing import List\n", "\n", - "from langchain.output_parsers import PydanticOutputParser\n", + "from langchain_core.output_parsers import PydanticOutputParser\n", "from langchain_core.pydantic_v1 import BaseModel, Field\n", "from langchain_openai import ChatOpenAI" ] diff --git a/docs/docs/how_to/output_parser_retry.ipynb b/docs/docs/how_to/output_parser_retry.ipynb index 86f39e02e9..0a29800e53 100644 --- a/docs/docs/how_to/output_parser_retry.ipynb +++ b/docs/docs/how_to/output_parser_retry.ipynb @@ -17,13 +17,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.output_parsers import (\n", - " OutputFixingParser,\n", - " PydanticOutputParser,\n", - ")\n", - "from langchain.prompts import (\n", - " PromptTemplate,\n", - ")\n", + "from langchain.output_parsers import OutputFixingParser\n", + "from langchain_core.output_parsers import PydanticOutputParser\n", + "from langchain_core.prompts import PromptTemplate\n", "from langchain_core.pydantic_v1 import BaseModel, Field\n", "from langchain_openai import ChatOpenAI, OpenAI" ] diff --git a/docs/docs/how_to/query_multiple_queries.ipynb b/docs/docs/how_to/query_multiple_queries.ipynb index 0dcaa5bfbe..242d28a4d3 100644 --- a/docs/docs/how_to/query_multiple_queries.ipynb +++ b/docs/docs/how_to/query_multiple_queries.ipynb @@ -83,9 +83,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", "from langchain_chroma import Chroma\n", "from langchain_openai import OpenAIEmbeddings\n", + "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", "\n", "texts = [\"Harrison worked at Kensho\", \"Ankush worked at Facebook\"]\n", "embeddings = OpenAIEmbeddings(model=\"text-embedding-3-small\")\n", diff --git a/docs/docs/how_to/query_multiple_retrievers.ipynb b/docs/docs/how_to/query_multiple_retrievers.ipynb index f653d328b8..c5ed5d80eb 100644 --- a/docs/docs/how_to/query_multiple_retrievers.ipynb +++ b/docs/docs/how_to/query_multiple_retrievers.ipynb @@ -83,9 +83,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", "from langchain_chroma import Chroma\n", "from langchain_openai import OpenAIEmbeddings\n", + "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", "\n", "texts = [\"Harrison worked at Kensho\"]\n", "embeddings = OpenAIEmbeddings(model=\"text-embedding-3-small\")\n", diff --git a/docs/docs/how_to/query_no_queries.ipynb b/docs/docs/how_to/query_no_queries.ipynb index 4aee699c94..5d3b93ccff 100644 --- a/docs/docs/how_to/query_no_queries.ipynb +++ b/docs/docs/how_to/query_no_queries.ipynb @@ -85,9 +85,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", "from langchain_chroma import Chroma\n", "from langchain_openai import OpenAIEmbeddings\n", + "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", "\n", "texts = [\"Harrison worked at Kensho\"]\n", "embeddings = OpenAIEmbeddings(model=\"text-embedding-3-small\")\n", diff --git a/docs/docs/how_to/routing.ipynb b/docs/docs/how_to/routing.ipynb index 6fd2e24258..7c95e12230 100644 --- a/docs/docs/how_to/routing.ipynb +++ b/docs/docs/how_to/routing.ipynb @@ -335,7 +335,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain.utils.math import cosine_similarity\n", + "from langchain_community.utils.math import cosine_similarity\n", "from langchain_core.output_parsers import StrOutputParser\n", "from langchain_core.prompts import PromptTemplate\n", "from langchain_core.runnables import RunnableLambda, RunnablePassthrough\n", diff --git a/docs/docs/how_to/sql_csv.ipynb b/docs/docs/how_to/sql_csv.ipynb index 9d3c55a49d..3e3ed1ce51 100644 --- a/docs/docs/how_to/sql_csv.ipynb +++ b/docs/docs/how_to/sql_csv.ipynb @@ -428,7 +428,7 @@ } ], "source": [ - "from langchain.output_parsers.openai_tools import JsonOutputKeyToolsParser\n", + "from langchain_core.output_parsers.openai_tools import JsonOutputKeyToolsParser\n", "\n", "parser = JsonOutputKeyToolsParser(key_name=tool.name, first_tool_only=True)\n", "(llm_with_tools | parser).invoke(\n", diff --git a/docs/docs/how_to/time_weighted_vectorstore.ipynb b/docs/docs/how_to/time_weighted_vectorstore.ipynb index a1c61fa1ab..83d5d6b93c 100644 --- a/docs/docs/how_to/time_weighted_vectorstore.ipynb +++ b/docs/docs/how_to/time_weighted_vectorstore.ipynb @@ -205,7 +205,7 @@ "source": [ "import datetime\n", "\n", - "from langchain.utils import mock_now" + "from langchain_core.utils import mock_now" ] }, {