Skip to content

Commit

Permalink
partners: add 'model' alias for consistency in embedding classes (#28374
Browse files Browse the repository at this point in the history
)

**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](https://github.com/langchain-ai/langchain/blob/65deeddd5dfec5d51f33ebc961f09c2e47a8f064/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>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent 3107d78 commit af2e0a7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -68,6 +68,7 @@ def __init__(self, **kwargs: Any):
model_config = ConfigDict(
extra="forbid",
protected_namespaces=(),
populate_by_name=True,
)

def _embed(
Expand Down

0 comments on commit af2e0a7

Please sign in to comment.