Skip to content

Commit 2c9d6b2

Browse files
committed
SDK regeneration
1 parent b492066 commit 2c9d6b2

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Ftruefoundry%2Ftruefoundry-python-sdk)
44
[![pypi](https://img.shields.io/pypi/v/truefoundry-sdk)](https://pypi.python.org/pypi/truefoundry-sdk)
5-
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/truefoundry/truefoundry-python-sdk)
65

76
The Truefoundry Python library provides convenient access to the Truefoundry API from Python.
87

@@ -23,7 +22,12 @@ Instantiate and use the client with the following:
2322
```python
2423
from truefoundry_sdk import TrueFoundry
2524
client = TrueFoundry(api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", )
26-
client.users.invite_user(accept_invite_client_url='<control plane url>/invite-accept', email='email', )
25+
response = client.applications.list(limit=10, offset=0, )
26+
for item in response:
27+
yield item
28+
# alternatively, you can paginate page-by-page
29+
for page in response.iter_pages():
30+
yield page
2731
```
2832

2933
## Async Client
@@ -35,7 +39,13 @@ from truefoundry_sdk import AsyncTrueFoundry
3539
import asyncio
3640
client = AsyncTrueFoundry(api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", )
3741
async def main() -> None:
38-
await client.users.invite_user(accept_invite_client_url='<control plane url>/invite-accept', email='email', )
42+
response = await client.applications.list(limit=10, offset=0, )
43+
async for item in response:
44+
yield item
45+
46+
# alternatively, you can paginate page-by-page
47+
async for page in response.iter_pages():
48+
yield page
3949
asyncio.run(main())
4050
```
4151

@@ -47,7 +57,7 @@ will be thrown.
4757
```python
4858
from truefoundry_sdk.core.api_error import ApiError
4959
try:
50-
client.users.invite_user(...)
60+
client.applications.list(...)
5161
except ApiError as e:
5262
print(e.status_code)
5363
print(e.body)
@@ -78,7 +88,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
7888
```python
7989
from truefoundry_sdk import TrueFoundry
8090
client = TrueFoundry(..., )
81-
response = client.users.with_raw_response.invite_user(...)
91+
response = client.applications.with_raw_response.list(...)
8292
print(response.headers) # access the response headers
8393
print(response.data) # access the underlying object
8494
pager = client.users.list(...)
@@ -106,7 +116,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
106116
Use the `max_retries` request option to configure this behavior.
107117

108118
```python
109-
client.users.invite_user(..., request_options={
119+
client.applications.list(..., request_options={
110120
"max_retries": 1
111121
})
112122
```
@@ -121,7 +131,7 @@ from truefoundry_sdk import TrueFoundry
121131
client = TrueFoundry(..., timeout=20.0, )
122132

123133
# Override timeout for a specific method
124-
client.users.invite_user(..., request_options={
134+
client.applications.list(..., request_options={
125135
"timeout_in_seconds": 1
126136
})
127137
```

0 commit comments

Comments
 (0)