community[patch]: Fix missing protected_namespaces(). (#27610)

- [x] **PR message**:
- **Description:** Fixes warning messages raised due to missing
`protected_namespaces` parameter in `ConfigDict`.
    - **Issue:** https://github.com/langchain-ai/langchain/issues/27609
    - **Dependencies:** No dependencies
    - **Twitter handle:** @gawbul
This commit is contained in:
Steve Moss
2024-10-25 03:16:26 +01:00
committed by GitHub
parent 7667ee126f
commit 24605bcdb6
15 changed files with 35 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, List, Optional
from langchain_core.embeddings import Embeddings
from langchain_core.utils import get_from_dict_or_env, pre_init
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from tenacity import (
before_sleep_log,
retry,
@@ -62,6 +62,8 @@ class GooglePalmEmbeddings(BaseModel, Embeddings):
show_progress_bar: bool = False
"""Whether to show a tqdm progress bar. Must have `tqdm` installed."""
model_config = ConfigDict(protected_namespaces=())
@pre_init
def validate_environment(cls, values: Dict) -> Dict:
"""Validate api key, python package exists."""