Skip to content

Commit 32513d5

Browse files
Remove quality_preset arg and cleanup validate docstring (#93)
* Remove quality_preset arg and cleanup validate docstring * bump version 1.022
1 parent e33123f commit 32513d5

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.22] 2025-06-23
11+
12+
- Remove quality_preset arg
13+
1014
## [1.0.21] 2025-06-22
1115

1216
- Support adding remediations to a project
@@ -104,7 +108,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
104108

105109
- Initial release of the `cleanlab-codex` client library.
106110

107-
[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.21...HEAD
111+
[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.22...HEAD
112+
[1.0.22]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.21...v1.0.22
108113
[1.0.21]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.20...v1.0.21
109114
[1.0.20]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.19...v1.0.20
110115
[1.0.19]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.18...v1.0.19

src/cleanlab_codex/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SPDX-License-Identifier: MIT
2-
__version__ = "1.0.21"
2+
__version__ = "1.0.22"

src/cleanlab_codex/project.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from datetime import datetime
66
from typing import TYPE_CHECKING as _TYPE_CHECKING
7-
from typing import Dict, Literal, Optional
7+
from typing import Dict, Optional
88

99
from codex import AuthenticationError
1010

@@ -153,7 +153,6 @@ def validate(
153153
custom_metadata: Optional[object] = None,
154154
eval_scores: Optional[Dict[str, float]] = None,
155155
eval_thresholds: Optional[Dict[str, float]] = None,
156-
quality_preset: Literal["best", "high", "medium", "low", "base"] = "medium",
157156
) -> ProjectValidateResponse:
158157
"""Run validation on a query to an AI system.
159158
@@ -165,7 +164,6 @@ def validate(
165164
custom_metadata (object, optional): Custom metadata to log in Codex for the query.
166165
eval_scores (Dict[str, float], optional): Optional scores to use for the query. When provided, Codex will skip running TrustworthyRAG evaluations on the query and use the provided scores instead.
167166
eval_thresholds (Dict[str, float], optional): Optional thresholds to use for evaluating the query. We recommend configuring thresholds on the Project instead and using the same thresholds for all queries.
168-
quality_preset (Literal["best", "high", "medium", "low", "base"], optional): The quality preset to use for the query.
169167
170168
Returns:
171169
ProjectValidateResponse: The response from the validation.
@@ -179,7 +177,6 @@ def validate(
179177
custom_eval_thresholds=eval_thresholds,
180178
custom_metadata=custom_metadata,
181179
eval_scores=eval_scores,
182-
quality_preset=quality_preset,
183180
)
184181

185182
def add_remediation(self, question: str, answer: str | None = None) -> None:

src/cleanlab_codex/validator.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from __future__ import annotations
66

77
from typing import TYPE_CHECKING as _TYPE_CHECKING
8-
from typing import Any, Callable, Literal, Optional
8+
from typing import Any, Callable, Optional
99

1010
from cleanlab_tlm import TrustworthyRAG
1111

@@ -59,7 +59,6 @@ def validate(
5959
form_prompt: Optional[Callable[[str, str], str]] = None,
6060
metadata: Optional[dict[str, Any]] = None,
6161
eval_scores: Optional[dict[str, float]] = None,
62-
quality_preset: Literal["best", "high", "medium", "low", "base"] = "medium",
6362
) -> ProjectValidateResponse:
6463
"""Evaluate whether the AI-generated response is bad, and if so, request an alternate expert answer.
6564
If no expert answer is available, this query is still logged for SMEs to answer.
@@ -72,8 +71,6 @@ def validate(
7271
form_prompt (Callable[[str, str], str], optional): Optional function to format the prompt based on query and context. Cannot be provided together with prompt, provide one or the other. This function should take query and context as parameters and return a formatted prompt string. If not provided, a default prompt formatter will be used. To include a system prompt or any other special instructions for your LLM, incorporate them directly in your custom form_prompt() function definition.
7372
metadata (dict, optional): Additional custom metadata to associate with the query logged in the Codex Project.
7473
eval_scores (dict[str, float], optional): Scores assessing different aspects of the RAG system. If provided, TLM Trustworthy RAG will not be used to generate scores.
75-
options (ProjectValidateOptions, optional): Typed dict of advanced TLM configuration options. See [TLMOptions](/tlm/api/python/tlm/#class-tlmoptions)
76-
quality_preset (Literal["best", "high", "medium", "low", "base"], optional): The quality preset to use for the TLM or Trustworthy RAG API.
7774
7875
Returns:
7976
ProjectValidateResponse: A response object containing:
@@ -103,5 +100,4 @@ def validate(
103100
custom_metadata=metadata,
104101
eval_scores=eval_scores,
105102
eval_thresholds=self._eval_thresholds,
106-
quality_preset=quality_preset,
107103
)

0 commit comments

Comments
 (0)