-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include cleanlab-codex version in headers for codex backend requests
- Loading branch information
1 parent
f67bde8
commit d63d789
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
from __future__ import annotations | ||
|
||
from cleanlab_codex.__about__ import __version__ as package_version | ||
|
||
|
||
class AnalyticsMetadata: | ||
def __init__(self, *, integration_type: str, source: str = "codex-python-sdk"): | ||
def __init__( | ||
self, *, integration_type: str, package_version: str = package_version, source: str = "cleanlab-codex-python" | ||
): | ||
self._integration_type = integration_type | ||
self._package_version = package_version | ||
self._source = source | ||
|
||
def to_headers(self) -> dict[str, str]: | ||
return { | ||
"X-Integration-Type": self._integration_type, | ||
"X-Client-Library-Version": self._package_version, | ||
"X-Source": self._source, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters