docs: Standardize MiniMaxEmbeddings (#24983)

- **Description:** Standardize MiniMaxEmbeddings
  - docs, the issue #24856 
  - model init arg names, the issue #20085
This commit is contained in:
maang-h
2024-08-04 02:01:23 +08:00
committed by GitHub
parent 2c3e3dc6b1
commit f5da0d6d87
2 changed files with 76 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
from typing import cast
from langchain_core.pydantic_v1 import SecretStr
from langchain_community.embeddings import MiniMaxEmbeddings
def test_initialization_with_alias() -> None:
"""Test minimax embedding model initialization with alias."""
api_key = "your-api-key"
group_id = "your-group-id"
embeddings = MiniMaxEmbeddings( # type: ignore[arg-type, call-arg]
api_key=api_key, # type: ignore[arg-type]
group_id=group_id, # type: ignore[arg-type]
)
assert cast(SecretStr, embeddings.minimax_api_key).get_secret_value() == api_key
assert embeddings.minimax_group_id == group_id