mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +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."""
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_types_allowed = True
|
||||
extra = Extra.forbid
|
||||
|
||||
@staticmethod
|
||||
def _example_to_text(
|
||||
|
@ -236,8 +236,6 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
return values
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
# --- Runnable methods ---
|
||||
|
@ -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)
|
||||
|
@ -48,8 +48,6 @@ class BaseMemory(Serializable, ABC):
|
||||
""" # noqa: E501
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@property
|
||||
|
@ -100,8 +100,6 @@ class BasePromptTemplate(
|
||||
return True
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@property
|
||||
|
@ -33,10 +33,8 @@ class _FewShotPromptTemplateMixin(BaseModel):
|
||||
Either this or examples should be provided."""
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_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 values
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_types_allowed = True
|
||||
extra = Extra.forbid
|
||||
|
||||
def format(self, **kwargs: Any) -> str:
|
||||
"""Format the prompt with inputs generating a string.
|
||||
@ -370,10 +366,8 @@ class FewShotChatMessagePromptTemplate(
|
||||
return False
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_types_allowed = True
|
||||
extra = Extra.forbid
|
||||
|
||||
def format_messages(self, **kwargs: Any) -> List[BaseMessage]:
|
||||
"""Format kwargs into a list of messages.
|
||||
|
@ -86,10 +86,8 @@ class FewShotPromptWithTemplates(StringPromptTemplate):
|
||||
return values
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_types_allowed = True
|
||||
extra = Extra.forbid
|
||||
|
||||
def _get_examples(self, **kwargs: Any) -> List[dict]:
|
||||
if self.examples is not None:
|
||||
|
@ -112,8 +112,6 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
||||
""" # noqa: E501
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
_new_arg_supported: bool = False
|
||||
|
@ -374,8 +374,6 @@ class ChildTool(BaseTool):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
class Config(Serializable.Config):
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@property
|
||||
|
@ -1208,8 +1208,6 @@ class VectorStoreRetriever(BaseRetriever):
|
||||
)
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@root_validator(pre=True)
|
||||
|
Loading…
Reference in New Issue
Block a user