Skip to content

Commit 5f0dfec

Browse files
committed
python scripts/restructure_to_namespace.py
1 parent dbc1c23 commit 5f0dfec

File tree

554 files changed

+771
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+771
-771
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Each namespace has its own authentication requirements and access patterns. Whil
1414

1515
```python
1616
# Example of accessing Client namespace
17-
from glean import Glean, models
17+
from glean.api_client import Glean, models
1818
import os
1919

2020
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:
2424
print(search_response)
2525

2626
# Example of accessing Indexing namespace
27-
from glean import Glean, models
27+
from glean.api_client import Glean, models
2828
import os
2929

3030
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
106106
# ]
107107
# ///
108108

109-
from glean import Glean
109+
from glean.api_client import Glean
110110

111111
sdk = Glean(
112112
# SDK arguments
@@ -136,7 +136,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
136136

137137
```python
138138
# Synchronous Example
139-
from glean import Glean, models
139+
from glean.api_client import Glean, models
140140
import os
141141

142142

@@ -164,7 +164,7 @@ The same SDK client can also be used to make asychronous requests by importing a
164164
```python
165165
# Asynchronous Example
166166
import asyncio
167-
from glean import Glean, models
167+
from glean.api_client import Glean, models
168168
import os
169169

170170
async def main():
@@ -193,7 +193,7 @@ asyncio.run(main())
193193

194194
```python
195195
# Synchronous Example
196-
from glean import Glean, models
196+
from glean.api_client import Glean, models
197197
import os
198198

199199

@@ -221,7 +221,7 @@ The same SDK client can also be used to make asychronous requests by importing a
221221
```python
222222
# Asynchronous Example
223223
import asyncio
224-
from glean import Glean, models
224+
from glean.api_client import Glean, models
225225
import os
226226

227227
async def main():
@@ -260,8 +260,8 @@ This SDK supports the following security scheme globally:
260260

261261
To authenticate with the API the `api_token` parameter must be set when initializing the SDK client instance. For example:
262262
```python
263-
from glean import Glean, models
264-
from glean.utils import parse_datetime
263+
from glean.api_client import Glean, models
264+
from glean.api_client.utils import parse_datetime
265265
import os
266266

267267

@@ -549,8 +549,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
549549

550550
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
551551
```python
552-
from glean import Glean, models
553-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
552+
from glean.api_client import Glean, models
553+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
554554
import os
555555

556556

@@ -590,8 +590,8 @@ with Glean(
590590

591591
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:
592592
```python
593-
from glean import Glean, models
594-
from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
593+
from glean.api_client import Glean, models
594+
from glean.api_client.utils import BackoffStrategy, RetryConfig, parse_datetime
595595
import os
596596

597597

@@ -649,7 +649,7 @@ All operations return a response object or raise an exception:
649649
### Example
650650

651651
```python
652-
from glean import Glean, errors, models
652+
from glean.api_client import Glean, errors, models
653653
import os
654654

655655

@@ -728,8 +728,8 @@ The default server `https://{instance}-be.glean.com` contains variables and is s
728728
#### Example
729729

730730
```python
731-
from glean import Glean, models
732-
from glean.utils import parse_datetime
731+
from glean.api_client import Glean, models
732+
from glean.api_client.utils import parse_datetime
733733
import os
734734

735735

@@ -771,8 +771,8 @@ with Glean(
771771

772772
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:
773773
```python
774-
from glean import Glean, models
775-
from glean.utils import parse_datetime
774+
from glean.api_client import Glean, models
775+
from glean.api_client.utils import parse_datetime
776776
import os
777777

778778

@@ -820,7 +820,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu
820820

821821
For example, you could specify a header for every request that this sdk makes as follows:
822822
```python
823-
from glean import Glean
823+
from glean.api_client import Glean
824824
import httpx
825825

826826
http_client = httpx.Client(headers={"x-custom-header": "someValue"})
@@ -829,8 +829,8 @@ s = Glean(client=http_client)
829829

830830
or you could wrap the client with your own custom logic:
831831
```python
832-
from glean import Glean
833-
from glean.httpclient import AsyncHttpClient
832+
from glean.api_client import Glean
833+
from glean.api_client.httpclient import AsyncHttpClient
834834
import httpx
835835

836836
class CustomClient(AsyncHttpClient):
@@ -900,7 +900,7 @@ The `Glean` class implements the context manager protocol and registers a finali
900900
[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
901901

902902
```python
903-
from glean import Glean
903+
from glean.api_client import Glean
904904
import os
905905
def main():
906906

@@ -927,7 +927,7 @@ You can setup your SDK to emit debug logs for SDK requests and responses.
927927

928928
You can pass your own logger class directly into your SDK.
929929
```python
930-
from glean import Glean
930+
from glean.api_client import Glean
931931
import logging
932932

933933
logging.basicConfig(level=logging.DEBUG)

USAGE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Start SDK Example Usage [usage] -->
22
```python
33
# Synchronous Example
4-
from glean import Glean, models
4+
from glean.api_client import Glean, models
55
import os
66

77

@@ -29,7 +29,7 @@ The same SDK client can also be used to make asychronous requests by importing a
2929
```python
3030
# Asynchronous Example
3131
import asyncio
32-
from glean import Glean, models
32+
from glean.api_client import Glean, models
3333
import os
3434

3535
async def main():
@@ -56,7 +56,7 @@ asyncio.run(main())
5656

5757
```python
5858
# Synchronous Example
59-
from glean import Glean, models
59+
from glean.api_client import Glean, models
6060
import os
6161

6262

@@ -84,7 +84,7 @@ The same SDK client can also be used to make asychronous requests by importing a
8484
```python
8585
# Asynchronous Example
8686
import asyncio
87-
from glean import Glean, models
87+
from glean.api_client import Glean, models
8888
import os
8989

9090
async def main():

docs/sdks/agents/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Get an agent by ID. This endpoint implements the LangChain Agent Protocol, speci
1818
### Example Usage
1919

2020
```python
21-
from glean import Glean
21+
from glean.api_client import Glean
2222
import os
2323

2424

@@ -58,7 +58,7 @@ Get an agent's schemas by ID. This endpoint implements the LangChain Agent Proto
5858
### Example Usage
5959

6060
```python
61-
from glean import Glean
61+
from glean.api_client import Glean
6262
import os
6363

6464

@@ -98,7 +98,7 @@ List Agents available in this service. This endpoint implements the LangChain Ag
9898
### Example Usage
9999

100100
```python
101-
from glean import Glean
101+
from glean.api_client import Glean
102102
import os
103103

104104

@@ -137,7 +137,7 @@ Creates and triggers a run of an agent. Streams the output in SSE format. This e
137137
### Example Usage
138138

139139
```python
140-
from glean import Glean
140+
from glean.api_client import Glean
141141
import os
142142

143143

@@ -176,7 +176,7 @@ Creates and triggers a run of an agent. Waits for final output and then returns
176176
### Example Usage
177177

178178
```python
179-
from glean import Glean
179+
from glean.api_client import Glean
180180
import os
181181

182182

docs/sdks/announcements/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Create a textual announcement visible to some set of users based on department a
1717

1818
```python
1919
from datetime import date
20-
from glean import Glean, models
21-
from glean.utils import parse_datetime
20+
from glean.api_client import Glean, models
21+
from glean.api_client.utils import parse_datetime
2222
import os
2323

2424

@@ -22092,7 +22092,7 @@ Delete an existing user-generated announcement.
2209222092
### Example Usage
2209322093

2209422094
```python
22095-
from glean import Glean
22095+
from glean.api_client import Glean
2209622096
import os
2209722097

2209822098

@@ -22127,8 +22127,8 @@ Update a textual announcement visible to some set of users based on department a
2212722127

2212822128
```python
2212922129
from datetime import date
22130-
from glean import Glean, models
22131-
from glean.utils import parse_datetime
22130+
from glean.api_client import Glean, models
22131+
from glean.api_client.utils import parse_datetime
2213222132
import os
2213322133

2213422134

docs/sdks/answers/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Create a user-generated Answer that contains a question and answer.
1919

2020
```python
2121
from datetime import date
22-
from glean import Glean, models
23-
from glean.utils import parse_datetime
22+
from glean.api_client import Glean, models
23+
from glean.api_client.utils import parse_datetime
2424
import os
2525

2626

@@ -1390,7 +1390,7 @@ Delete an existing user-generated Answer.
13901390
### Example Usage
13911391

13921392
```python
1393-
from glean import Glean
1393+
from glean.api_client import Glean
13941394
import os
13951395

13961396

@@ -1426,8 +1426,8 @@ Update an existing user-generated Answer.
14261426

14271427
```python
14281428
from datetime import date
1429-
from glean import Glean, models
1430-
from glean.utils import parse_datetime
1429+
from glean.api_client import Glean, models
1430+
from glean.api_client.utils import parse_datetime
14311431
import os
14321432

14331433

@@ -2391,7 +2391,7 @@ Read the details of a particular Answer given its ID.
23912391
### Example Usage
23922392

23932393
```python
2394-
from glean import Glean
2394+
from glean.api_client import Glean
23952395
import os
23962396

23972397

@@ -2433,7 +2433,7 @@ List Answers created by the current user.
24332433
### Example Usage
24342434

24352435
```python
2436-
from glean import Glean
2436+
from glean.api_client import Glean
24372437
import os
24382438

24392439

docs/sdks/clientactivity/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Report user activity that occurs on indexed documents such as viewing or editing
1515
### Example Usage
1616

1717
```python
18-
from glean import Glean, models
19-
from glean.utils import parse_datetime
18+
from glean.api_client import Glean, models
19+
from glean.api_client.utils import parse_datetime
2020
import os
2121

2222

@@ -73,7 +73,7 @@ Report events that happen to results within a Glean client UI, such as search re
7373
### Example Usage
7474

7575
```python
76-
from glean import Glean, models
76+
from glean.api_client import Glean, models
7777
import os
7878

7979

docs/sdks/clientauthentication/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Creates an authentication token for the authenticated user.
1414
### Example Usage
1515

1616
```python
17-
from glean import Glean
17+
from glean.api_client import Glean
1818
import os
1919

2020

0 commit comments

Comments
 (0)