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
The AI Creation Engine SDK, by the BEATS AI Foundation, provides convenient access to the AI Creation Engine REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields,
5
+
The Beats Foundation Python library provides convenient access to the Beats Foundation REST API from any Python 3.8+
6
+
application. The library includes type definitions for all request params and response fields,
6
7
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
7
8
8
9
It is generated with [Stainless](https://www.stainlessapi.com/).
@@ -24,9 +25,9 @@ The full API of this library can be found in [api.md](api.md).
24
25
25
26
```python
26
27
import os
27
-
from beats_foundation importBeatsfoundation
28
+
from beats_foundation importBeatsFoundation
28
29
29
-
client =Beatsfoundation(
30
+
client =BeatsFoundation(
30
31
bearer_token=os.environ.get(
31
32
"BEATSFOUNDATION_BEARER_TOKEN"
32
33
), # This is the default and can be omitted
@@ -45,14 +46,14 @@ so that your Bearer Token is not stored in source control.
45
46
46
47
## Async usage
47
48
48
-
Simply import `AsyncBeatsfoundation` instead of `Beatsfoundation` and use `await` with each API call:
49
+
Simply import `AsyncBeatsFoundation` instead of `BeatsFoundation` and use `await` with each API call:
49
50
50
51
```python
51
52
import os
52
53
import asyncio
53
-
from beats_foundation importAsyncBeatsfoundation
54
+
from beats_foundation importAsyncBeatsFoundation
54
55
55
-
client =AsyncBeatsfoundation(
56
+
client =AsyncBeatsFoundation(
56
57
bearer_token=os.environ.get(
57
58
"BEATSFOUNDATION_BEARER_TOKEN"
58
59
), # This is the default and can be omitted
@@ -91,9 +92,9 @@ All errors inherit from `beats_foundation.APIError`.
91
92
92
93
```python
93
94
import beats_foundation
94
-
from beats_foundation importBeatsfoundation
95
+
from beats_foundation importBeatsFoundation
95
96
96
-
client =Beatsfoundation()
97
+
client =BeatsFoundation()
97
98
98
99
try:
99
100
client.songs.retrieve(
@@ -132,10 +133,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
132
133
You can use the `max_retries` option to configure or disable retry settings:
133
134
134
135
```python
135
-
from beats_foundation importBeatsfoundation
136
+
from beats_foundation importBeatsFoundation
136
137
137
138
# Configure the default for all requests:
138
-
client =Beatsfoundation(
139
+
client =BeatsFoundation(
139
140
# default is 2
140
141
max_retries=0,
141
142
)
@@ -152,16 +153,16 @@ By default requests time out after 1 minute. You can configure this with a `time
152
153
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the BEATSFOUNDATION_BEARER_TOKEN environment variable"
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the BEATSFOUNDATION_BEARER_TOKEN environment variable"
0 commit comments