mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
c6b7db6587
- **Support batch size** Baichuan updates the document, indicating that up to 16 documents can be imported at a time - **Standardized model init arg names** - baichuan_api_key -> api_key - model_name -> model
19 lines
588 B
Python
19 lines
588 B
Python
from typing import cast
|
|
|
|
from langchain_core.pydantic_v1 import SecretStr
|
|
|
|
from langchain_community.embeddings import BaichuanTextEmbeddings
|
|
|
|
|
|
def test_sparkllm_initialization_by_alias() -> None:
|
|
# Effective initialization
|
|
embeddings = BaichuanTextEmbeddings( # type: ignore[call-arg]
|
|
model="embedding_model", # type: ignore[arg-type]
|
|
api_key="your-api-key", # type: ignore[arg-type]
|
|
)
|
|
assert embeddings.model_name == "embedding_model"
|
|
assert (
|
|
cast(SecretStr, embeddings.baichuan_api_key).get_secret_value()
|
|
== "your-api-key"
|
|
)
|