ollama[patch]: Update extra in ollama package (#25383)

Backwards compatible change that converts pydantic extras to literals
which is consistent with pydantic 2 usage.
This commit is contained in:
Eugene Yurtsev 2024-08-14 10:30:01 -04:00 committed by GitHub
parent d0ad713937
commit f4196f1fb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@ from typing import (
)
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
from ollama import AsyncClient, Client
@ -139,7 +139,7 @@ class OllamaEmbeddings(BaseModel, Embeddings):
class Config:
"""Configuration for this pydantic object."""
extra = Extra.forbid
extra = "forbid"
@root_validator(pre=False, skip_on_failure=True)
def _set_clients(cls, values: dict) -> dict: