The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
core[patch]: Sort Config attributes (#25127)
Eugene Yurtsev4d28c70000e3
diff --git a/libs/core/langchain_core/example_selectors/semantic_similarity.py b/libs/core/langchain_core/example_selectors/semantic_similarity.pyindex b4d8d0cc1c..c14428a0c1 100644--- a/libs/core/langchain_core/example_selectors/semantic_similarity.py+++ b/libs/core/langchain_core/example_selectors/semantic_similarity.py@@ -43,10 +43,8 @@ class _VectorStoreExampleSelector(BaseExampleSelector, BaseModel, ABC):"""Extra arguments passed to similarity_search function of the vectorstore."""class Config:- """Configuration for this pydantic object."""-- extra = Extra.forbidarbitrary_types_allowed = True+ extra = Extra.forbid@staticmethoddef _example_to_text(diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.pyindex bc6630858a..b4d367572a 100644--- a/libs/core/langchain_core/language_models/chat_models.py+++ b/libs/core/langchain_core/language_models/chat_models.py@@ -236,8 +236,6 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):return valuesclass Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True# --- Runnable methods ---diff --git a/libs/core/langchain_core/language_models/llms.py b/libs/core/langchain_core/language_models/llms.pyindex 1b1e014a8e..03ae2be5e2 100644--- a/libs/core/langchain_core/language_models/llms.py+++ b/libs/core/langchain_core/language_models/llms.py@@ -298,8 +298,6 @@ class BaseLLM(BaseLanguageModel[str], ABC):"""[DEPRECATED]"""class Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True@root_validator(pre=True)diff --git a/libs/core/langchain_core/memory.py b/libs/core/langchain_core/memory.pyindex 34a90d879e..743c68b68b 100644--- a/libs/core/langchain_core/memory.py+++ b/libs/core/langchain_core/memory.py@@ -48,8 +48,6 @@ class BaseMemory(Serializable, ABC):""" # noqa: E501class Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True@propertydiff --git a/libs/core/langchain_core/prompts/base.py b/libs/core/langchain_core/prompts/base.pyindex a58f916d4a..8ba8e56071 100644--- a/libs/core/langchain_core/prompts/base.py+++ b/libs/core/langchain_core/prompts/base.py@@ -100,8 +100,6 @@ class BasePromptTemplate(return Trueclass Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True@propertydiff --git a/libs/core/langchain_core/prompts/few_shot.py b/libs/core/langchain_core/prompts/few_shot.pyindex d750851f46..934ac88a81 100644--- a/libs/core/langchain_core/prompts/few_shot.py+++ b/libs/core/langchain_core/prompts/few_shot.py@@ -33,10 +33,8 @@ class _FewShotPromptTemplateMixin(BaseModel):Either this or examples should be provided."""class Config:- """Configuration for this pydantic object."""-- extra = Extra.forbidarbitrary_types_allowed = True+ extra = Extra.forbid@root_validator(pre=True)def check_examples_and_selector(cls, values: Dict) -> Dict:@@ -161,10 +159,8 @@ class FewShotPromptTemplate(_FewShotPromptTemplateMixin, StringPromptTemplate):return valuesclass Config:- """Configuration for this pydantic object."""-- extra = Extra.forbidarbitrary_types_allowed = True+ extra = Extra.forbiddef format(self, **kwargs: Any) -> str:"""Format the prompt with inputs generating a string.@@ -370,10 +366,8 @@ class FewShotChatMessagePromptTemplate(return Falseclass Config:- """Configuration for this pydantic object."""-- extra = Extra.forbidarbitrary_types_allowed = True+ extra = Extra.forbiddef format_messages(self, **kwargs: Any) -> List[BaseMessage]:"""Format kwargs into a list of messages.diff --git a/libs/core/langchain_core/prompts/few_shot_with_templates.py b/libs/core/langchain_core/prompts/few_shot_with_templates.pyindex 8e5db1a81f..6b98694d44 100644--- a/libs/core/langchain_core/prompts/few_shot_with_templates.py+++ b/libs/core/langchain_core/prompts/few_shot_with_templates.py@@ -86,10 +86,8 @@ class FewShotPromptWithTemplates(StringPromptTemplate):return valuesclass Config:- """Configuration for this pydantic object."""-- extra = Extra.forbidarbitrary_types_allowed = True+ extra = Extra.forbiddef _get_examples(self, **kwargs: Any) -> List[dict]:if self.examples is not None:diff --git a/libs/core/langchain_core/retrievers.py b/libs/core/langchain_core/retrievers.pyindex efce96bdad..6bbf34072b 100644--- a/libs/core/langchain_core/retrievers.py+++ b/libs/core/langchain_core/retrievers.py@@ -112,8 +112,6 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):""" # noqa: E501class Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True_new_arg_supported: bool = Falsediff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.pyindex 729d68ffc3..98a86b0aaf 100644--- a/libs/core/langchain_core/tools.py+++ b/libs/core/langchain_core/tools.py@@ -374,8 +374,6 @@ class ChildTool(BaseTool):super().__init__(**kwargs)class Config(Serializable.Config):- """Configuration for this pydantic object."""-arbitrary_types_allowed = True@propertydiff --git a/libs/core/langchain_core/vectorstores/base.py b/libs/core/langchain_core/vectorstores/base.pyindex 8868889496..f6f3f37772 100644--- a/libs/core/langchain_core/vectorstores/base.py+++ b/libs/core/langchain_core/vectorstores/base.py@@ -1208,8 +1208,6 @@ class VectorStoreRetriever(BaseRetriever):)class Config:- """Configuration for this pydantic object."""-arbitrary_types_allowed = True@root_validator(pre=True)