From 5855139d9c67e678c75b73aca3990abce8ad2de9 Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Thu, 25 Apr 2024 21:42:04 +0300 Subject: [PATCH] fix(spec): --- langalf/http_spec.py | 1 - langalf/probe_actor/refusal.py | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/langalf/http_spec.py b/langalf/http_spec.py index cbf12e8..ac95a83 100644 --- a/langalf/http_spec.py +++ b/langalf/http_spec.py @@ -1,4 +1,3 @@ - import httpx from pydantic import BaseModel diff --git a/langalf/probe_actor/refusal.py b/langalf/probe_actor/refusal.py index e845b6b..d7c67dc 100644 --- a/langalf/probe_actor/refusal.py +++ b/langalf/probe_actor/refusal.py @@ -30,11 +30,12 @@ REFUSAL_MARKS = [ ] -def check_refusal(response, refusal_phrases=REFUSAL_MARKS): - """Check if the LLM's response contains any of the refusal phrases. +def check_refusal(response: str, refusal_phrases: list = REFUSAL_MARKS) -> bool: + """ + Check if the response contains any phrases indicating refusal to answer. - Parameters: - - response (str): The LLM's response to a prompt. + Args: + - response (str): The response from the language model. - refusal_phrases (list): A list of phrases indicating refusal to answer. Returns: