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
17
+
from glean.api_clientimport Glean
18
18
import os
19
19
20
20
with Glean(api_token="client-token", instance="instance-name") as glean:
@@ -23,7 +23,7 @@ with Glean(api_token="client-token", instance="instance-name") as glean:
23
23
print(search_response)
24
24
25
25
# Example of accessing Indexing namespace
26
-
from glean import Glean, models
26
+
from glean.api_clientimport Glean, models
27
27
import os
28
28
29
29
with Glean(api_token="indexing-token", instance="instance-name") as glean:
@@ -105,7 +105,7 @@ It's also possible to write a standalone Python script without needing to set up
105
105
# ]
106
106
# ///
107
107
108
-
from glean import Glean
108
+
from glean.api_clientimport Glean
109
109
110
110
sdk = Glean(
111
111
# SDK arguments
@@ -135,7 +135,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
135
135
136
136
```python
137
137
# Synchronous Example
138
-
from glean import Glean, models
138
+
from glean.api_clientimport Glean, models
139
139
import os
140
140
141
141
@@ -163,7 +163,7 @@ The same SDK client can also be used to make asychronous requests by importing a
163
163
```python
164
164
# Asynchronous Example
165
165
import asyncio
166
-
from glean import Glean, models
166
+
from glean.api_clientimport Glean, models
167
167
import os
168
168
169
169
asyncdefmain():
@@ -192,7 +192,7 @@ asyncio.run(main())
192
192
193
193
```python
194
194
# Synchronous Example
195
-
from glean import Glean, models
195
+
from glean.api_clientimport Glean, models
196
196
import os
197
197
198
198
@@ -220,7 +220,7 @@ The same SDK client can also be used to make asychronous requests by importing a
220
220
```python
221
221
# Asynchronous Example
222
222
import asyncio
223
-
from glean import Glean, models
223
+
from glean.api_clientimport Glean, models
224
224
import os
225
225
226
226
asyncdefmain():
@@ -259,8 +259,8 @@ This SDK supports the following security scheme globally:
259
259
260
260
To authenticate with the API the `api_token` parameter must be set when initializing the SDK client instance. For example:
261
261
```python
262
-
from glean import Glean, models
263
-
from glean.utils import parse_datetime
262
+
from glean.api_clientimport Glean, models
263
+
from glean.api_client.utils import parse_datetime
264
264
import os
265
265
266
266
@@ -548,8 +548,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
548
548
549
549
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
550
550
```python
551
-
from glean import Glean, models
552
-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
551
+
from glean.api_clientimport Glean, models
552
+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
553
553
import os
554
554
555
555
@@ -589,8 +589,8 @@ with Glean(
589
589
590
590
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:
591
591
```python
592
-
from glean import Glean, models
593
-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
592
+
from glean.api_clientimport Glean, models
593
+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
594
594
import os
595
595
596
596
@@ -648,7 +648,7 @@ All operations return a response object or raise an exception:
648
648
### Example
649
649
650
650
```python
651
-
from glean import Glean, errors, models
651
+
from glean.api_clientimport Glean, errors, models
652
652
import os
653
653
654
654
@@ -727,8 +727,8 @@ The default server `https://{instance}-be.glean.com` contains variables and is s
727
727
#### Example
728
728
729
729
```python
730
-
from glean import Glean, models
731
-
from glean.utils import parse_datetime
730
+
from glean.api_clientimport Glean, models
731
+
from glean.api_client.utils import parse_datetime
732
732
import os
733
733
734
734
@@ -770,8 +770,8 @@ with Glean(
770
770
771
771
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:
772
772
```python
773
-
from glean import Glean, models
774
-
from glean.utils import parse_datetime
773
+
from glean.api_clientimport Glean, models
774
+
from glean.api_client.utils import parse_datetime
775
775
import os
776
776
777
777
@@ -819,7 +819,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu
819
819
820
820
For example, you could specify a header for every request that this sdk makes as follows:
0 commit comments