diff --git a/CHANGELOG.md b/CHANGELOG.md index 268a710..9c999e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.28] 2025-09-05 + +- Update metadata support for query logs, `project.update_metadata()` + ## [1.0.27] 2025-08-22 - Add user feedback support for query logs, `project.add_user_feedback()` @@ -128,7 +132,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release of the `cleanlab-codex` client library. -[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.27...HEAD +[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.28...HEAD +[1.0.28]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.27...v1.0.28 [1.0.27]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.26...v1.0.27 [1.0.26]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.25...v1.0.26 [1.0.25]: https://github.com/cleanlab/cleanlab-codex/compare/v1.0.24...v1.0.25 diff --git a/pyproject.toml b/pyproject.toml index eb3fb9a..ce1e063 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "cleanlab-tlm~=1.1,>=1.1.14", - "codex-sdk==0.1.0a25", + "codex-sdk==0.1.0a26", "pydantic>=2.0.0, <3", ] diff --git a/src/cleanlab_codex/__about__.py b/src/cleanlab_codex/__about__.py index 8969272..8613d0c 100644 --- a/src/cleanlab_codex/__about__.py +++ b/src/cleanlab_codex/__about__.py @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -__version__ = "1.0.27" +__version__ = "1.0.28" diff --git a/src/cleanlab_codex/project.py b/src/cleanlab_codex/project.py index 1b858f3..e370f9c 100644 --- a/src/cleanlab_codex/project.py +++ b/src/cleanlab_codex/project.py @@ -4,7 +4,7 @@ from datetime import datetime from typing import TYPE_CHECKING as _TYPE_CHECKING -from typing import Dict, Optional, Union, cast +from typing import Any, Dict, Optional, Union, cast from codex import AuthenticationError from codex.types.project_validate_params import Response, Tool @@ -230,3 +230,17 @@ def add_user_feedback(self, log_id: str, key: str) -> None: key=key, extra_headers=_AnalyticsMetadata().to_headers(), ) + + def update_metadata(self, log_id: str, metadata: dict[str, Any]) -> None: + """Update the metadata of a query logged in the project, preserving existing metadata. + + Args: + log_id (str): The ID of the query log to add feedback to. + metadata (dict[str, Any]): The metadata to update. + """ + self._sdk_client.projects.query_logs.update_metadata( + project_id=self.id, + query_log_id=log_id, + body=metadata, + extra_headers=_AnalyticsMetadata().to_headers(), + )