mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-18 18:53:10 +00:00
core[patch]: Sort Config attributes (#25127)
This PR does an aesthetic sort of the config object attributes. This will make it a bit easier to go back and forth between pydantic v1 and pydantic v2 on the 0.3.x branch
This commit is contained in:
parent
46a47710b0
commit
4d28c70000
@ -43,10 +43,8 @@ class _VectorStoreExampleSelector(BaseExampleSelector, BaseModel, ABC):
|
|||||||
"""Extra arguments passed to similarity_search function of the vectorstore."""
|
"""Extra arguments passed to similarity_search function of the vectorstore."""
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
extra = Extra.forbid
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
extra = Extra.forbid
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _example_to_text(
|
def _example_to_text(
|
||||||
|
@ -236,8 +236,6 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
# --- Runnable methods ---
|
# --- Runnable methods ---
|
||||||
|
@ -298,8 +298,6 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
|||||||
"""[DEPRECATED]"""
|
"""[DEPRECATED]"""
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
|
@ -48,8 +48,6 @@ class BaseMemory(Serializable, ABC):
|
|||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -100,8 +100,6 @@ class BasePromptTemplate(
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -33,10 +33,8 @@ class _FewShotPromptTemplateMixin(BaseModel):
|
|||||||
Either this or examples should be provided."""
|
Either this or examples should be provided."""
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
extra = Extra.forbid
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
extra = Extra.forbid
|
||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def check_examples_and_selector(cls, values: Dict) -> Dict:
|
def check_examples_and_selector(cls, values: Dict) -> Dict:
|
||||||
@ -161,10 +159,8 @@ class FewShotPromptTemplate(_FewShotPromptTemplateMixin, StringPromptTemplate):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
extra = Extra.forbid
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
extra = Extra.forbid
|
||||||
|
|
||||||
def format(self, **kwargs: Any) -> str:
|
def format(self, **kwargs: Any) -> str:
|
||||||
"""Format the prompt with inputs generating a string.
|
"""Format the prompt with inputs generating a string.
|
||||||
@ -370,10 +366,8 @@ class FewShotChatMessagePromptTemplate(
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
extra = Extra.forbid
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
extra = Extra.forbid
|
||||||
|
|
||||||
def format_messages(self, **kwargs: Any) -> List[BaseMessage]:
|
def format_messages(self, **kwargs: Any) -> List[BaseMessage]:
|
||||||
"""Format kwargs into a list of messages.
|
"""Format kwargs into a list of messages.
|
||||||
|
@ -86,10 +86,8 @@ class FewShotPromptWithTemplates(StringPromptTemplate):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
extra = Extra.forbid
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
extra = Extra.forbid
|
||||||
|
|
||||||
def _get_examples(self, **kwargs: Any) -> List[dict]:
|
def _get_examples(self, **kwargs: Any) -> List[dict]:
|
||||||
if self.examples is not None:
|
if self.examples is not None:
|
||||||
|
@ -112,8 +112,6 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
_new_arg_supported: bool = False
|
_new_arg_supported: bool = False
|
||||||
|
@ -374,8 +374,6 @@ class ChildTool(BaseTool):
|
|||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
class Config(Serializable.Config):
|
class Config(Serializable.Config):
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1208,8 +1208,6 @@ class VectorStoreRetriever(BaseRetriever):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
|
||||||
|
|
||||||
arbitrary_types_allowed = True
|
arbitrary_types_allowed = True
|
||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user