partners: add 'model' alias for consistency in embedding classes (#28374)

**Description:** This PR introduces a `model` alias for the embedding
classes that contain the attribute `model_name`, to ensure consistency
across the codebase, as suggested by a moderator in a previous PR. The
change aligns the usage of attribute names across the project (see for
example
[here](65deeddd5d/libs/partners/groq/langchain_groq/chat_models.py (L304))).
**Issue:** This PR addresses the suggestion from the review of issue
#28269.
**Dependencies:**  None

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
Manuel 2024-12-13 17:30:00 -05:00 committed by GitHub
parent 3107d78517
commit af2e0a7ede
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):
)
"""
model_name: str = DEFAULT_MODEL_NAME
model_name: str = Field(default=DEFAULT_MODEL_NAME, alias="model")
"""Model name to use."""
cache_folder: Optional[str] = None
"""Path to store models.
@ -68,6 +68,7 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):
model_config = ConfigDict(
extra="forbid",
protected_namespaces=(),
populate_by_name=True,
)
def _embed(