Skip to content

Commit 91c0a75

Browse files
authored
[VPC ChatCompletions] Add explanations (#109)
1 parent d2677d3 commit 91c0a75

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10-
## [1.1.24] - 2025-04-17
10+
## [1.1.25] - 2025-08-12
11+
12+
### Added
13+
14+
- Add support for explanations for VPC ChatCompletion module
15+
16+
### Fixed
17+
18+
- Unittest logic for quality preset changes
19+
- Typing in `chat.py` for new `openai` versions
20+
21+
## [1.1.24] - 2025-08-07
1122

1223
### Added
1324

@@ -305,7 +316,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
305316
- Release of the Cleanlab TLM Python client.
306317

307318

308-
[Unreleased]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.24...HEAD
319+
[Unreleased]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.25...HEAD
320+
[1.1.25]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.24...v1.1.25
309321
[1.1.24]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.23...v1.1.24
310322
[1.1.23]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.22...v1.1.23
311323
[1.1.22]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.21...v1.1.22

src/cleanlab_tlm/__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.1.24"
2+
__version__ = "1.1.25"

src/cleanlab_tlm/utils/vpc/chat_completions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@ def score(
9999
)
100100

101101
res_json = res.json()
102+
tlm_result = {"trustworthiness_score": res_json["tlm_metadata"]["trustworthiness_score"]}
103+
if explanation := res_json["tlm_metadata"].get("log", {}).get("explanation"):
104+
tlm_result["log"] = {"explanation": explanation}
102105

103-
return {"trustworthiness_score": res_json["tlm_metadata"]["trustworthiness_score"]}
106+
return tlm_result

0 commit comments

Comments
 (0)