This commit is contained in:
Timothy J. Baek 2024-09-19 17:05:49 +02:00
parent 7078af635c
commit 7b330d1490

View File

@ -474,7 +474,6 @@ from typing import Optional, Sequence
from langchain_core.callbacks import Callbacks from langchain_core.callbacks import Callbacks
from langchain_core.documents import BaseDocumentCompressor, Document from langchain_core.documents import BaseDocumentCompressor, Document
from langchain_core.pydantic_v1 import Extra
class RerankCompressor(BaseDocumentCompressor): class RerankCompressor(BaseDocumentCompressor):
@ -484,7 +483,7 @@ class RerankCompressor(BaseDocumentCompressor):
r_score: float r_score: float
class Config: class Config:
extra = Extra.forbid extra = "forbid"
arbitrary_types_allowed = True arbitrary_types_allowed = True
def compress_documents( def compress_documents(