mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-07-16 09:27:25 +02:00
implement singular guidelines calls in main service
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import pytest
|
||||
from src.text_generation.domain.guardrails_processed_completion import GuardrailsProcessedCompletion
|
||||
from src.text_generation.domain.guardrails_result import GuardrailsResult
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_guardrail_analyzed_response():
|
||||
response = GuardrailsProcessedCompletion(
|
||||
score=0.72839,
|
||||
response = GuardrailsResult(
|
||||
cosine_similarity_score=0.72839,
|
||||
cosine_similarity_risk_threshold=0.5,
|
||||
original_completion="compromised response",
|
||||
final="I can't answer that"
|
||||
guardrails_processed_completion_text="I can't answer that"
|
||||
)
|
||||
assert response.is_original_completion_malicious == True
|
||||
Reference in New Issue
Block a user