Skip to content

Commit ffcdab3

Browse files
authored
feature - policy tools (#471)
* policy tools * hotfix - polic tools
1 parent 9e3a68b commit ffcdab3

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "qualifire"
7-
version = "0.16.0"
7+
version = "0.17.0"
88
description = "Qualifire Python SDK"
99
authors = [{ name = "qualifire-dev", email = "dror@qualifire.ai" }]
1010
requires-python = ">=3.8,<4"
@@ -97,7 +97,7 @@ color_output = true
9797

9898
[tool.mypy]
9999
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
100-
python_version = 3.8
100+
python_version = "3.8"
101101
pretty = true
102102
show_traceback = true
103103
color_output = true

qualifire/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def evaluate(
6262
hallucinations_mode: ModelMode = ModelMode.BALANCED,
6363
grounding_multi_turn_mode: bool = False,
6464
policy_multi_turn_mode: bool = False,
65+
policy_include_tools: bool = False,
6566
policy_target: PolicyTarget = PolicyTarget.BOTH,
6667
topic_scoping_mode: Optional[ModelMode] = None,
6768
topic_scoping_multi_turn_mode: bool = False,
@@ -109,6 +110,7 @@ def evaluate(
109110
:param hallucinations_mode: Model mode for hallucinations check (speed/balanced/quality).
110111
:param grounding_multi_turn_mode: Enable multi-turn mode for grounding check.
111112
:param policy_multi_turn_mode: Enable multi-turn mode for policy check.
113+
:param policy_include_tools: Include tool definitions and tool calls in policy assertion context.
112114
:param policy_target: Target for policy checks (input/output/both).
113115
:param topic_scoping_mode: Model mode for topic scoping check (speed/balanced/quality).
114116
:param topic_scoping_multi_turn_mode: Enable multi-turn mode for topic scoping check.
@@ -233,6 +235,7 @@ def evaluate(
233235
hallucinations_mode=hallucinations_mode,
234236
grounding_multi_turn_mode=grounding_multi_turn_mode,
235237
policy_multi_turn_mode=policy_multi_turn_mode,
238+
policy_include_tools=policy_include_tools,
236239
policy_target=policy_target,
237240
topic_scoping_mode=topic_scoping_mode,
238241
topic_scoping_multi_turn_mode=topic_scoping_multi_turn_mode,

qualifire/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class EvaluationRequest(BaseModel):
6565
hallucinations_mode: ModelMode = ModelMode.BALANCED
6666
grounding_multi_turn_mode: bool = False
6767
policy_multi_turn_mode: bool = False
68+
policy_include_tools: bool = False
6869
policy_target: PolicyTarget = PolicyTarget.BOTH
6970
topic_scoping_mode: Optional[ModelMode] = None
7071
topic_scoping_multi_turn_mode: bool = False

tests/test_types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,11 @@ def test_validate_tsq_requirements(
111111
available_tools=available_tools,
112112
tool_use_quality_check=tsq_check,
113113
)
114+
115+
def test_policy_include_tools_defaults_false(self):
116+
req = EvaluationRequest(input="test")
117+
assert req.policy_include_tools is False
118+
119+
def test_policy_include_tools_can_be_set(self):
120+
req = EvaluationRequest(input="test", policy_include_tools=True)
121+
assert req.policy_include_tools is True

0 commit comments

Comments
 (0)