Skip to content

Commit 4324521

Browse files
committed
hotfix -version
2 parents b74bec5 + d092769 commit 4324521

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ make check-safety
4242

4343
The SDK has a minimal structure centered on the `Client` class:
4444

45-
- **`qualifire/client.py`**: Main `Client` class with two public methods:
45+
- **`qualifire/client.py`**: Main `Client` class with three public methods:
4646
- `evaluate()` - Run ad-hoc evaluations with various checks (hallucinations, grounding, PII, content moderation, etc.)
4747
- `invoke_evaluation()` - Run pre-configured evaluations from the Qualifire dashboard
48+
- `compile_prompt()` - Compile a prompt with topic scoping and policy targets
4849

4950
- **`qualifire/types.py`**: All data classes and enums:
5051
- `EvaluationRequest`/`EvaluationResponse` - API request/response structures
5152
- `LLMMessage`, `LLMToolCall`, `LLMToolDefinition` - Message and tool types for conversation-based evaluation
5253
- `ModelMode` (SPEED/BALANCED/QUALITY) - Quality vs speed trade-off for checks
5354
- `SyntaxCheckArgs` - Configuration for syntax validation
55+
- `PolicyTarget`, `CompilePromptResponse` - Types for prompt compilation with topic scoping
5456

5557
- **`qualifire/utils.py`**: Helper functions for API key and base URL resolution from environment variables
5658

qualifire/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def evaluate(
6565
policy_target: PolicyTarget = PolicyTarget.BOTH,
6666
topic_scoping_mode: Optional[ModelMode] = None,
6767
topic_scoping_multi_turn_mode: bool = False,
68-
topic_scoping_target: Optional[str] = None,
68+
topic_scoping_target: PolicyTarget = PolicyTarget.BOTH,
69+
allowed_topics: Optional[List[str]] = None,
6970
) -> Union[EvaluationResponse, None]:
7071
"""
7172
Evaluates the given input and output pairs.
@@ -111,6 +112,7 @@ def evaluate(
111112
:param topic_scoping_mode: Model mode for topic scoping check (speed/balanced/quality).
112113
:param topic_scoping_multi_turn_mode: Enable multi-turn mode for topic scoping check.
113114
:param topic_scoping_target: Target topic for topic scoping check.
115+
:param allowed_topics: List of allowed topics for topic scoping check.
114116
115117
:return: An EvaluationResponse object containing the evaluation results.
116118
:raises Exception: If an error occurs during the evaluation.
@@ -233,6 +235,7 @@ def evaluate(
233235
topic_scoping_mode=topic_scoping_mode,
234236
topic_scoping_multi_turn_mode=topic_scoping_multi_turn_mode,
235237
topic_scoping_target=topic_scoping_target,
238+
allowed_topics=allowed_topics,
236239
)
237240

238241
response = requests.post(

qualifire/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ class EvaluationRequest(BaseModel):
6868
policy_target: PolicyTarget = PolicyTarget.BOTH
6969
topic_scoping_mode: Optional[ModelMode] = None
7070
topic_scoping_multi_turn_mode: bool = False
71-
topic_scoping_target: Optional[str] = None
71+
topic_scoping_target: PolicyTarget = PolicyTarget.BOTH
72+
allowed_topics: Optional[List[str]] = None
7273

7374
@model_validator(mode="after")
7475
def validate_model(self) -> "EvaluationRequest":

0 commit comments

Comments
 (0)