Skip to content

Commit a7fa1f0

Browse files
authored
use to UPPER_CASE naming style (#164)
1 parent e0e7886 commit a7fa1f0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
from .types import BeforeRequestContext, BeforeRequestHook
77

8-
prefix = "mistral-client-python/"
8+
PREFIX = "mistral-client-python/"
99

1010
class CustomUserAgentHook(BeforeRequestHook):
1111
def before_request(
1212
self, hook_ctx: BeforeRequestContext, request: httpx.Request
1313
) -> Union[httpx.Request, Exception]:
1414
current = request.headers["user-agent"]
15-
if current.startswith(prefix):
15+
if current.startswith(PREFIX):
1616
return request
1717

1818
request.headers["user-agent"] = (
19-
prefix + current.split(" ")[1]
19+
PREFIX + current.split(" ")[1]
2020
)
2121

2222
return request

packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
from .types import BeforeRequestContext, BeforeRequestHook
77

8-
prefix = "mistral-client-python/"
8+
PREFIX = "mistral-client-python/"
99

1010
class CustomUserAgentHook(BeforeRequestHook):
1111
def before_request(
1212
self, hook_ctx: BeforeRequestContext, request: httpx.Request
1313
) -> Union[httpx.Request, Exception]:
1414
current = request.headers["user-agent"]
15-
if current.startswith(prefix):
15+
if current.startswith(PREFIX):
1616
return request
1717

1818
request.headers["user-agent"] = (
19-
prefix + current.split(" ")[1]
19+
PREFIX + current.split(" ")[1]
2020
)
2121

2222
return request

src/mistralai/_hooks/custom_user_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
from .types import BeforeRequestContext, BeforeRequestHook
77

8-
prefix = "mistral-client-python/"
8+
PREFIX = "mistral-client-python/"
99

1010
class CustomUserAgentHook(BeforeRequestHook):
1111
def before_request(
1212
self, hook_ctx: BeforeRequestContext, request: httpx.Request
1313
) -> Union[httpx.Request, Exception]:
1414
current = request.headers["user-agent"]
15-
if current.startswith(prefix):
15+
if current.startswith(PREFIX):
1616
return request
1717

1818
request.headers["user-agent"] = (
19-
prefix + current.split(" ")[1]
19+
PREFIX + current.split(" ")[1]
2020
)
2121

2222
return request

0 commit comments

Comments
 (0)