Skip to content

Commit 83458a3

Browse files
authored
Adopt <product>/<version> convention for User-Agent header (#100)
Signed-off-by: Mattt Zmuda <[email protected]>
1 parent 44e10a4 commit 83458a3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

replicate/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _request(self, method: str, path: str, **kwargs) -> requests.Response:
8484
def _headers(self) -> Dict[str, str]:
8585
return {
8686
"Authorization": f"Token {self._api_token()}",
87-
"User-Agent": f"replicate-python@{__version__}",
87+
"User-Agent": f"replicate-python/{__version__}",
8888
}
8989

9090
def _api_token(self) -> str:

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_client_sets_authorization_token_and_user_agent_headers():
2525
"https://api.replicate.com/v1/models/test/model/versions",
2626
match=[
2727
matchers.header_matcher({"Authorization": "Token abc123"}),
28-
matchers.header_matcher({"User-Agent": f"replicate-python@{__version__}"}),
28+
matchers.header_matcher({"User-Agent": f"replicate-python/{__version__}"}),
2929
],
3030
json={"results": []},
3131
)

0 commit comments

Comments
 (0)