mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 14:31:55 +00:00
pinecone[patch]: Upgrade @root_validators to be consistent with pydantic 2 (#25453)
Upgrade root validators for pydantic 2 migration
This commit is contained in:
@@ -7,10 +7,22 @@ MODEL_NAME = "multilingual-e5-large"
|
||||
|
||||
|
||||
def test_default_config() -> None:
|
||||
e = PineconeEmbeddings(pinecone_api_key=API_KEY, model=MODEL_NAME)
|
||||
e = PineconeEmbeddings(
|
||||
pinecone_api_key=API_KEY, # type: ignore[call-arg]
|
||||
model=MODEL_NAME,
|
||||
)
|
||||
assert e.batch_size == 96
|
||||
|
||||
|
||||
def test_default_config_with_api_key() -> None:
|
||||
e = PineconeEmbeddings(api_key=API_KEY, model=MODEL_NAME)
|
||||
assert e.batch_size == 96
|
||||
|
||||
|
||||
def test_custom_config() -> None:
|
||||
e = PineconeEmbeddings(pinecone_api_key=API_KEY, model=MODEL_NAME, batch_size=128)
|
||||
e = PineconeEmbeddings(
|
||||
pinecone_api_key=API_KEY, # type: ignore[call-arg]
|
||||
model=MODEL_NAME,
|
||||
batch_size=128,
|
||||
)
|
||||
assert e.batch_size == 128
|
||||
|
Reference in New Issue
Block a user