mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 15:04:13 +00:00
community[patch]: Add missing annotations (#24890)
This PR adds annotations in comunity package. Annotations are only strictly needed in subclasses of BaseModel for pydantic 2 compatibility. This PR adds some unnecessary annotations, but they're not bad to have regardless for documentation pages.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# LLM Lingua Document Compressor
|
||||
|
||||
import re
|
||||
from typing import Any, Dict, List, Optional, Sequence, Tuple
|
||||
from typing import Any, Dict, List, Optional, Pattern, Sequence, Tuple
|
||||
|
||||
from langchain_core.callbacks import Callbacks
|
||||
from langchain_core.documents import Document
|
||||
@@ -24,8 +24,8 @@ class LLMLinguaCompressor(BaseDocumentCompressor):
|
||||
|
||||
# Pattern to match ref tags at the beginning or end of the string,
|
||||
# allowing for malformed tags
|
||||
_pattern_beginning = re.compile(r"\A(?:<#)?(?:ref)?(\d+)(?:#>?)?")
|
||||
_pattern_ending = re.compile(r"(?:<#)?(?:ref)?(\d+)(?:#>?)?\Z")
|
||||
_pattern_beginning: Pattern = re.compile(r"\A(?:<#)?(?:ref)?(\d+)(?:#>?)?")
|
||||
_pattern_ending: Pattern = re.compile(r"(?:<#)?(?:ref)?(\d+)(?:#>?)?\Z")
|
||||
|
||||
model_name: str = "NousResearch/Llama-2-7b-hf"
|
||||
"""The hugging face model to use"""
|
||||
|
Reference in New Issue
Block a user