guardrails-ai / sensitive_topics

Apache License 2.0
0 stars 1 forks source link

Error while initializing SensitiveTopic class #4

Open bhatiama opened 2 months ago

bhatiama commented 2 months ago

There is a typo in the llm_threshold parameter that RestrictToTopic expects. The parameter is incorrectly spelled as llm_theshold.

ERROR:

File "/app/ai_guardrails/services/gd.py", line 16, in __init__
    SensitiveTopic(sensitive_topics=self.sensitive_topics, on_fail="fix")
File "/opt/venv/lib/python3.11/site-packages/guardrails/hub/guardrails/sensitive_topics/validator/main.py", line 101, in __init__
    super().__init__(
TypeError: RestrictToTopic.__init__() got an unexpected keyword argument 'llm_theshold'
wylansford commented 2 months ago

Ah it seems like this issue exists in sensitive topics. Good catch, I will make a PR for this. Sensitive topics inherits from RestrictToTopic, that is where the error comes from.

wylansford commented 2 months ago

https://github.com/guardrails-ai/sensitive_topics/pull/5 pr up, under review