mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
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:
parent
d0ad713937
commit
f4196f1fb8
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user