mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-06-24 06:09:55 +02:00
fix(spec):
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
import httpx
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user