diff --git a/CHANGELOG.md b/CHANGELOG.md index c17b727..fe7d325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.1a8] - 2025-02-18 + +### Changed + +- Added and edited docstrings to make the auto-generated API reference more clear. + ## [0.0.1a7] - 2025-02-18 ### Changed @@ -56,7 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Pre-release of the Cleanlab Codex Python client. -[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a6...HEAD +[Unreleased]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a8...HEAD +[0.0.1a8]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a7...v0.0.1a8 +[0.0.1a7]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a6...v0.0.1a7 [0.0.1a6]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a5...v0.0.1a6 [0.0.1a5]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a4...v0.0.1a5 [0.0.1a4]: https://github.com/cleanlab/cleanlab-codex/compare/v0.0.1a3...v0.0.1a4 diff --git a/src/cleanlab_codex/codex_tool.py b/src/cleanlab_codex/codex_tool.py index 1e4e87c..442b8ff 100644 --- a/src/cleanlab_codex/codex_tool.py +++ b/src/cleanlab_codex/codex_tool.py @@ -27,6 +27,12 @@ def __init__( *, fallback_answer: Optional[str] = DEFAULT_FALLBACK_ANSWER, ): + """Initialize a CodexTool. + + Args: + project (Project): The Codex project to use for this tool. + fallback_answer (str, optional): The fallback answer to use if the Codex project cannot answer the question. A default will be used if not provided. + """ self._project = project self._fallback_answer = fallback_answer self._tool_function_schema = pydantic_model_from_function(self._tool_name, self.query) @@ -40,7 +46,7 @@ def from_access_key( *, fallback_answer: Optional[str] = DEFAULT_FALLBACK_ANSWER, ) -> CodexTool: - """Creates a CodexTool from an access key. The CodexTool will use the project ID associated with the access key provided. + """Creates a CodexTool from an access key. The CodexTool will use the project associated with the access key provided. Args: access_key (str): The access key for the Codex project. diff --git a/src/cleanlab_codex/project.py b/src/cleanlab_codex/project.py index 686c7ce..3c3354a 100644 --- a/src/cleanlab_codex/project.py +++ b/src/cleanlab_codex/project.py @@ -33,7 +33,7 @@ class MissingProjectError(Exception): - """Raised when the project ID does not match any existing project.""" + """Raised when the project ID or access key does not match any existing project.""" def __str__(self) -> str: return "valid project ID or access key is required to authenticate access" @@ -52,7 +52,7 @@ def __init__(self, sdk_client: _Codex, project_id: str, *, verify_existence: boo [`Client.create_project()`](/codex/api/python/client#method-create_project), or [`Project.from_access_key()`](/codex/api/python/project#classmethod-from_access_key) methods. Args: - sdk_client (_Codex): The Codex SDK client to use to interact with the project. + sdk_client (Codex): The Codex SDK client to use to interact with the project. project_id (str): The ID of the project. verify_existence (bool, optional): Whether to verify that the project exists. """ @@ -92,10 +92,10 @@ def create(cls, sdk_client: _Codex, organization_id: str, name: str, description """Create a new Codex project. This method is not meant to be used directly. Instead, use the [`create_project`](/codex/api/python/client#method-create_project) method on the `Client` class. Args: - sdk_client (_Codex): The Codex SDK client to use to create the project. This client must be authenticated with a user-level API key. + sdk_client (Codex): The Codex SDK client to use to create the project. This client must be authenticated with a user-level API key. organization_id (str): The ID of the organization to create the project in. name (str): The name of the project. - description (:obj:`str`, optional): The description of the project. + description (str, optional): The description of the project. Returns: Project: The created project. @@ -118,8 +118,8 @@ def create_access_key(self, name: str, description: str | None = None, expiratio Args: name (str): The name of the access key. - description (:obj:`str`, optional): The description of the access key. - expiration (:obj:`datetime`, optional): The expiration date of the access key. If not provided, the access key will not expire. + description (str, optional): The description of the access key. + expiration (datetime, optional): The expiration date of the access key. If not provided, the access key will not expire. Returns: str: The access key token.