mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-20 01:49:51 +00:00
[chore]: Added Tests
This commit is contained in:
parent
979b81864e
commit
23ade9a1dc
@ -1078,7 +1078,14 @@ def get_all_basemodel_annotations(
|
|||||||
# cls has no subscript: cls = FooBar
|
# cls has no subscript: cls = FooBar
|
||||||
if isinstance(cls, type):
|
if isinstance(cls, type):
|
||||||
annotations: dict[str, type] = {}
|
annotations: dict[str, type] = {}
|
||||||
for name, param in cls.model_fields.items():
|
if hasattr(cls, "model_fields"):
|
||||||
|
for name, param in cls.model_fields.items():
|
||||||
|
if param.alias and param.alias != name:
|
||||||
|
warnings.warn(
|
||||||
|
f"Field '{name}' has alias '{param.alias}'. The alias will be used instead of the field name.",
|
||||||
|
stacklevel=2
|
||||||
|
)
|
||||||
|
for name, param in inspect.signature(cls).parameters.items():
|
||||||
# Exclude hidden init args added by pydantic Config. For example if
|
# Exclude hidden init args added by pydantic Config. For example if
|
||||||
# BaseModel(extra="allow") then "extra_data" will part of init sig.
|
# BaseModel(extra="allow") then "extra_data" will part of init sig.
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user