huggingface[patch], pinecone[patch], fireworks[patch], mistralai[patch], voyageai[patch], togetherai[path]: convert Pydantic extras to literals (#25384)

Backwards compatible change that converts pydantic extras to literals
which is consistent with pydantic 2 usage.

- fireworks
- voyage ai
- mistralai
- mistral ai
- together ai
- huggigng face
- pinecone
This commit is contained in:
Eugene Yurtsev
2024-08-14 09:55:30 -04:00
committed by GitHub
parent d00176e523
commit 5f5e8c9a60
10 changed files with 15 additions and 20 deletions

View File

@@ -7,7 +7,6 @@ import httpx
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import (
BaseModel,
Extra,
Field,
SecretStr,
root_validator,
@@ -122,7 +121,7 @@ class MistralAIEmbeddings(BaseModel, Embeddings):
model: str = "mistral-embed"
class Config:
extra = Extra.forbid
extra = "forbid"
arbitrary_types_allowed = True
allow_population_by_field_name = True