Skip to content

Commit

Permalink
community[patch]: Fix validation error in SettingsConfigDict across m…
Browse files Browse the repository at this point in the history
…ultiple Langchain modules (langchain-ai#26852)

- **Description:** This pull request addresses the validation error in
`SettingsConfigDict` due to extra fields in the `.env` file. The issue
is prevalent across multiple Langchain modules. This fix ensures that
extra fields in the `.env` file are ignored, preventing validation
errors.
  **Changes include:**
    - Applied fixes to modules using `SettingsConfigDict`.

- **Issue:** NA, similar
langchain-ai#26850
- **Dependencies:** NA
  • Loading branch information
Raj725 authored Sep 25, 2024
1 parent d502858 commit 51c4393
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _OneNoteGraphSettings(BaseSettings):
populate_by_name=True,
env_file=".env",
env_prefix="MS_GRAPH_",
extra="ignore",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="apache_doris_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="apache_doris_",
extra="ignore",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="clickhouse_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="clickhouse_",
extra="ignore",
)


Expand Down
5 changes: 4 additions & 1 deletion libs/community/langchain_community/vectorstores/kinetica.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="kinetica_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="kinetica_",
extra="ignore",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="manticore_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="manticore_",
extra="ignore",
)


Expand Down
5 changes: 4 additions & 1 deletion libs/community/langchain_community/vectorstores/myscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="myscale_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="myscale_",
extra="ignore",
)


Expand Down
5 changes: 4 additions & 1 deletion libs/community/langchain_community/vectorstores/starrocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def __getitem__(self, item: str) -> Any:
return getattr(self, item)

model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", env_prefix="starrocks_"
env_file=".env",
env_file_encoding="utf-8",
env_prefix="starrocks_",
extra="ignore",
)


Expand Down

0 comments on commit 51c4393

Please sign in to comment.