Skip to content

Commit 095a10e

Browse files
committed
fix: type on baseconfig
1 parent ac573e1 commit 095a10e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

clients/algoliasearch-client-python/algoliasearch/http/base_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Dict, Optional
33

44
from algoliasearch.http.hosts import HostsCollection
5+
from algoliasearch.http.user_agent import UserAgent
56

67

78
class BaseConfig:
@@ -27,6 +28,8 @@ def __init__(self, app_id: Optional[str] = None, api_key: Optional[str] = None):
2728
self.proxies: Optional[Dict[str, str]] = None
2829
self.hosts: Optional[HostsCollection] = None
2930

31+
self.user_agent: UserAgent = UserAgent()
32+
3033
def set_client_api_key(self, api_key: str) -> None:
3134
"""Sets a new API key to authenticate requests."""
3235
self.api_key = api_key

playground/python/app/search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def main():
1515
)
1616
client._config.user_agent.add("playground")
1717

18+
print("user_agent", client._config.user_agent.get())
1819
print("client initialized", client)
1920

2021
try:

0 commit comments

Comments
 (0)