Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "qualifire"
version = "0.14.0"
version = "0.15.0"
description = "Qualifire Python SDK"
authors = [{ name = "qualifire-dev", email = "dror@qualifire.ai" }]
requires-python = ">=3.8,<4"
Expand Down
5 changes: 5 additions & 0 deletions qualifire/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def evaluate(
topic_scoping_multi_turn_mode: bool = False,
topic_scoping_target: PolicyTarget = PolicyTarget.BOTH,
allowed_topics: Optional[List[str]] = None,
metadata: Optional[Dict[str, str]] = None,
) -> Union[EvaluationResponse, None]:
"""
Evaluates the given input and output pairs.
Expand Down Expand Up @@ -113,6 +114,7 @@ def evaluate(
:param topic_scoping_multi_turn_mode: Enable multi-turn mode for topic scoping check.
:param topic_scoping_target: Target topic for topic scoping check.
:param allowed_topics: List of allowed topics for topic scoping check.
:param metadata: Optional dictionary of string key-value pairs to attach to the evaluation invocation.

:return: An EvaluationResponse object containing the evaluation results.
:raises Exception: If an error occurs during the evaluation.
Expand Down Expand Up @@ -236,6 +238,7 @@ def evaluate(
topic_scoping_multi_turn_mode=topic_scoping_multi_turn_mode,
topic_scoping_target=topic_scoping_target,
allowed_topics=allowed_topics,
metadata=metadata,
)

response = requests.post(
Expand Down Expand Up @@ -264,6 +267,7 @@ def invoke_evaluation(
Optional[List[Dict[str, Any]]],
] = None,
available_tools: Optional[List[LLMToolDefinition]] = None,
metadata: Optional[Dict[str, str]] = None,
) -> EvaluationResponse:
url = f"{self._base_url}/api/evaluation/invoke/"

Expand All @@ -279,6 +283,7 @@ def invoke_evaluation(
output=output,
messages=messages, # type: ignore
available_tools=available_tools,
metadata=metadata,
)

response = requests.request(
Expand Down
2 changes: 2 additions & 0 deletions qualifire/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class EvaluationRequest(BaseModel):
topic_scoping_multi_turn_mode: bool = False
topic_scoping_target: PolicyTarget = PolicyTarget.BOTH
allowed_topics: Optional[List[str]] = None
metadata: Optional[Dict[str, str]] = None

@model_validator(mode="after")
def validate_model(self) -> "EvaluationRequest":
Expand Down Expand Up @@ -118,6 +119,7 @@ class EvaluationInvokeRequest(BaseModel):
output: Optional[str] = None
messages: Optional[List[LLMMessage]] = None
available_tools: Optional[List[LLMToolDefinition]] = None
metadata: Optional[Dict[str, str]] = None

@model_validator(mode="after")
def validate_model(self) -> "EvaluationInvokeRequest":
Expand Down