mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 00:29:57 +00:00
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:
parent
3107d78517
commit
af2e0a7ede
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user