You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Each namespace has its own authentication requirements and access patterns. Whil
14
14
15
15
```python
16
16
# Example of accessing Client namespace
17
-
from glean import Glean, models
17
+
from glean.api_clientimport Glean, models
18
18
import os
19
19
20
20
with Glean(api_token="client-token", instance="instance-name") as glean:
@@ -24,7 +24,7 @@ with Glean(api_token="client-token", instance="instance-name") as glean:
24
24
print(search_response)
25
25
26
26
# Example of accessing Indexing namespace
27
-
from glean import Glean, models
27
+
from glean.api_clientimport Glean, models
28
28
import os
29
29
30
30
with Glean(api_token="indexing-token", instance="instance-name") as glean:
@@ -106,7 +106,7 @@ It's also possible to write a standalone Python script without needing to set up
106
106
# ]
107
107
# ///
108
108
109
-
from glean import Glean
109
+
from glean.api_clientimport Glean
110
110
111
111
sdk = Glean(
112
112
# SDK arguments
@@ -136,7 +136,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
136
136
137
137
```python
138
138
# Synchronous Example
139
-
from glean import Glean, models
139
+
from glean.api_clientimport Glean, models
140
140
import os
141
141
142
142
@@ -164,7 +164,7 @@ The same SDK client can also be used to make asychronous requests by importing a
164
164
```python
165
165
# Asynchronous Example
166
166
import asyncio
167
-
from glean import Glean, models
167
+
from glean.api_clientimport Glean, models
168
168
import os
169
169
170
170
asyncdefmain():
@@ -193,7 +193,7 @@ asyncio.run(main())
193
193
194
194
```python
195
195
# Synchronous Example
196
-
from glean import Glean, models
196
+
from glean.api_clientimport Glean, models
197
197
import os
198
198
199
199
@@ -221,7 +221,7 @@ The same SDK client can also be used to make asychronous requests by importing a
221
221
```python
222
222
# Asynchronous Example
223
223
import asyncio
224
-
from glean import Glean, models
224
+
from glean.api_clientimport Glean, models
225
225
import os
226
226
227
227
asyncdefmain():
@@ -260,8 +260,8 @@ This SDK supports the following security scheme globally:
260
260
261
261
To authenticate with the API the `api_token` parameter must be set when initializing the SDK client instance. For example:
262
262
```python
263
-
from glean import Glean, models
264
-
from glean.utils import parse_datetime
263
+
from glean.api_clientimport Glean, models
264
+
from glean.api_client.utils import parse_datetime
265
265
import os
266
266
267
267
@@ -549,8 +549,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
549
549
550
550
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
551
551
```python
552
-
from glean import Glean, models
553
-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
552
+
from glean.api_clientimport Glean, models
553
+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
554
554
import os
555
555
556
556
@@ -590,8 +590,8 @@ with Glean(
590
590
591
591
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
592
592
```python
593
-
from glean import Glean, models
594
-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
593
+
from glean.api_clientimport Glean, models
594
+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
595
595
import os
596
596
597
597
@@ -649,7 +649,7 @@ All operations return a response object or raise an exception:
649
649
### Example
650
650
651
651
```python
652
-
from glean import Glean, errors, models
652
+
from glean.api_clientimport Glean, errors, models
653
653
import os
654
654
655
655
@@ -728,8 +728,8 @@ The default server `https://{instance}-be.glean.com` contains variables and is s
728
728
#### Example
729
729
730
730
```python
731
-
from glean import Glean, models
732
-
from glean.utils import parse_datetime
731
+
from glean.api_clientimport Glean, models
732
+
from glean.api_client.utils import parse_datetime
733
733
import os
734
734
735
735
@@ -771,8 +771,8 @@ with Glean(
771
771
772
772
The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
773
773
```python
774
-
from glean import Glean, models
775
-
from glean.utils import parse_datetime
774
+
from glean.api_clientimport Glean, models
775
+
from glean.api_client.utils import parse_datetime
776
776
import os
777
777
778
778
@@ -820,7 +820,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu
820
820
821
821
For example, you could specify a header for every request that this sdk makes as follows:
0 commit comments