docs: docstrings langchain_community update (#14889)

Addded missed docstrings. Fixed inconsistency in docstrings.

**Note** CC @efriis 
There were PR errors on
`langchain_experimental/prompt_injection_identifier/hugging_face_identifier.py`
But, I didn't touch this file in this PR! Can it be some cache problems?
I fixed this error.
This commit is contained in:
Leonid Ganeline
2023-12-19 05:58:24 -08:00
committed by GitHub
parent 583696732c
commit b2fd41331e
35 changed files with 156 additions and 25 deletions

View File

@@ -11,7 +11,9 @@ if TYPE_CHECKING:
class PromptInjectionException(ValueError):
def __init__(self, message="Prompt injection attack detected", score: float = 1.0):
def __init__(
self, message: str = "Prompt injection attack detected", score: float = 1.0
):
self.message = message
self.score = score
@@ -83,7 +85,7 @@ class HuggingFaceInjectionIdentifier(BaseTool):
def _run(self, query: str) -> str:
"""Use the tool."""
result = self.model(query)
result = self.model(query) # type: ignore
score = (
result[0]["score"]
if result[0]["label"] == self.injection_label