From baad44965e67c580e87b2f9d66a1679e63693782 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:04:57 -0700 Subject: [PATCH] core[patch]: update docstrings (#26241) --- libs/core/langchain_core/language_models/chat_models.py | 6 +++--- libs/core/langchain_core/runnables/base.py | 2 +- libs/core/langchain_core/runnables/history.py | 2 +- libs/core/langchain_core/utils/function_calling.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index 1b382aec06e..9e403296142 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -1180,7 +1180,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): Example: Pydantic schema (include_raw=False): .. code-block:: python - from langchain_core.pydantic_v1 import BaseModel + from pydantic import BaseModel class AnswerWithJustification(BaseModel): '''An answer to the user question along with justification for the answer.''' @@ -1200,7 +1200,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): Example: Pydantic schema (include_raw=True): .. code-block:: python - from langchain_core.pydantic_v1 import BaseModel + from pydantic import BaseModel class AnswerWithJustification(BaseModel): '''An answer to the user question along with justification for the answer.''' @@ -1220,7 +1220,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): Example: Dict schema (include_raw=False): .. code-block:: python - from langchain_core.pydantic_v1 import BaseModel + from pydantic import BaseModel from langchain_core.utils.function_calling import convert_to_openai_tool class AnswerWithJustification(BaseModel): diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py index cc9656d5e75..739a9e9684d 100644 --- a/libs/core/langchain_core/runnables/base.py +++ b/libs/core/langchain_core/runnables/base.py @@ -2364,7 +2364,7 @@ class Runnable(Generic[Input, Output], ABC): .. code-block:: python from typing import Any, Dict, List - from langchain_core.pydantic_v1 import BaseModel, Field + from pydantic import BaseModel, Field from langchain_core.runnables import RunnableLambda def f(x: Dict[str, Any]) -> str: diff --git a/libs/core/langchain_core/runnables/history.py b/libs/core/langchain_core/runnables/history.py index 6df1a4bea58..8b9ad729206 100644 --- a/libs/core/langchain_core/runnables/history.py +++ b/libs/core/langchain_core/runnables/history.py @@ -97,7 +97,7 @@ class RunnableWithMessageHistory(RunnableBindingBase): from langchain_core.documents import Document from langchain_core.messages import BaseMessage, AIMessage from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder - from langchain_core.pydantic_v1 import BaseModel, Field + from pydantic import BaseModel, Field from langchain_core.runnables import ( RunnableLambda, ConfigurableFieldSpec, diff --git a/libs/core/langchain_core/utils/function_calling.py b/libs/core/langchain_core/utils/function_calling.py index 675725367b8..1d57541f63a 100644 --- a/libs/core/langchain_core/utils/function_calling.py +++ b/libs/core/langchain_core/utils/function_calling.py @@ -476,7 +476,7 @@ def tool_example_to_messages( .. code-block:: python from typing import List, Optional - from langchain_core.pydantic_v1 import BaseModel, Field + from pydantic import BaseModel, Field from langchain_openai import ChatOpenAI class Person(BaseModel):