2828
2929import sys
3030
31+ from typing_extensions import deprecated
32+
3133from typesense .types .document import DocumentSchema
3234
3335if sys .version_info >= (3 , 11 ):
3638 import typing_extensions as typing
3739
3840from typesense .aliases import Aliases
39- from typesense .analytics_v1 import AnalyticsV1
4041from typesense .analytics import Analytics
42+ from typesense .analytics_v1 import AnalyticsV1
4143from typesense .api_call import ApiCall
4244from typesense .collection import Collection
4345from typesense .collections import Collections
4446from typesense .configuration import ConfigDict , Configuration
4547from typesense .conversations_models import ConversationsModels
48+ from typesense .curation_sets import CurationSets
4649from typesense .debug import Debug
4750from typesense .keys import Keys
4851from typesense .metrics import Metrics
@@ -73,7 +76,8 @@ class Client:
7376 keys (Keys): Instance for managing API keys.
7477 aliases (Aliases): Instance for managing collection aliases.
7578 analyticsV1 (AnalyticsV1): Instance for analytics operations (V1).
76- analytics (AnalyticsV30): Instance for analytics operations (v30).
79+ analytics (Analytics): Instance for analytics operations (v30).
80+ curation_sets (CurationSets): Instance for Curation Sets (v30+)
7781 stemming (Stemming): Instance for stemming dictionary operations.
7882 operations (Operations): Instance for various Typesense operations.
7983 debug (Debug): Instance for debug operations.
@@ -93,8 +97,10 @@ def __init__(self, config_dict: ConfigDict) -> None:
9397 Example:
9498 >>> config = {
9599 ... "api_key": "your_api_key",
96- ... "nodes": [{"host": "localhost", "port": "8108", "protocol": "http"}],
97- ... "connection_timeout_seconds": 2
100+ ... "nodes": [
101+ ... {"host": "localhost", "port": "8108", "protocol": "http"}
102+ ... ],
103+ ... "connection_timeout_seconds": 2,
98104 ... }
99105 >>> client = Client(config)
100106 """
@@ -104,9 +110,10 @@ def __init__(self, config_dict: ConfigDict) -> None:
104110 self .multi_search = MultiSearch (self .api_call )
105111 self .keys = Keys (self .api_call )
106112 self .aliases = Aliases (self .api_call )
107- self .analyticsV1 = AnalyticsV1 (self .api_call )
113+ self ._analyticsV1 = AnalyticsV1 (self .api_call )
108114 self .analytics = Analytics (self .api_call )
109115 self .stemming = Stemming (self .api_call )
116+ self .curation_sets = CurationSets (self .api_call )
110117 self .operations = Operations (self .api_call )
111118 self .debug = Debug (self .api_call )
112119 self .stopwords = Stopwords (self .api_call )
@@ -115,6 +122,14 @@ def __init__(self, config_dict: ConfigDict) -> None:
115122 self .conversations_models = ConversationsModels (self .api_call )
116123 self .nl_search_models = NLSearchModels (self .api_call )
117124
125+ @property
126+ @deprecated (
127+ "AnalyticsV1 is deprecated on v30+. Use client.analytics instead." ,
128+ category = None ,
129+ )
130+ def analyticsV1 (self ) -> AnalyticsV1 :
131+ return self ._analyticsV1
132+
118133 def typed_collection (
119134 self ,
120135 * ,
@@ -140,7 +155,6 @@ def typed_collection(
140155 >>> class Company(DocumentSchema):
141156 ... name: str
142157 ... num_employees: int
143- ...
144158 >>> client = Client(config)
145159 >>> companies_collection = client.typed_collection(model=Company)
146160 # This is equivalent to:
0 commit comments