LLM methods#
This module provides basic methods to support LLM conditions. These methods return bool values based on LLM result.
- class BaseMethod(**data)[source]#
Bases:
BaseModel,ABCBase class to evaluate models response as condition.
- class Contains(**data)[source]#
Bases:
BaseMethodSimple method to check if a string contains a pattern.
-
pattern:
str# Pattern that will be searched in model_result.
-
pattern:
- class LogProb(**data)[source]#
Bases:
BaseMethodMethod to check whether a target token’s log probability is higher than a threshold.
-
target_token:
str# Token to check (e.g. “TRUE”)
-
threshold:
float# Threshold to bypass. by default -0.5
-
target_token: