studyfetch-sdk 0.1.0a8__py3-none-any.whl → 0.1.0a10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- studyfetch_sdk/_client.py +2 -2
- studyfetch_sdk/_version.py +1 -1
- {studyfetch_sdk-0.1.0a8.dist-info → studyfetch_sdk-0.1.0a10.dist-info}/METADATA +58 -13
- {studyfetch_sdk-0.1.0a8.dist-info → studyfetch_sdk-0.1.0a10.dist-info}/RECORD +6 -6
- {studyfetch_sdk-0.1.0a8.dist-info → studyfetch_sdk-0.1.0a10.dist-info}/WHEEL +0 -0
- {studyfetch_sdk-0.1.0a8.dist-info → studyfetch_sdk-0.1.0a10.dist-info}/licenses/LICENSE +0 -0
studyfetch_sdk/_client.py
CHANGED
@@ -88,7 +88,7 @@ class StudyfetchSDK(SyncAPIClient):
|
|
88
88
|
if base_url is None:
|
89
89
|
base_url = os.environ.get("STUDYFETCH_SDK_BASE_URL")
|
90
90
|
if base_url is None:
|
91
|
-
base_url = f"https://
|
91
|
+
base_url = f"https://studyfetchapi.com"
|
92
92
|
|
93
93
|
super().__init__(
|
94
94
|
version=__version__,
|
@@ -256,7 +256,7 @@ class AsyncStudyfetchSDK(AsyncAPIClient):
|
|
256
256
|
if base_url is None:
|
257
257
|
base_url = os.environ.get("STUDYFETCH_SDK_BASE_URL")
|
258
258
|
if base_url is None:
|
259
|
-
base_url = f"https://
|
259
|
+
base_url = f"https://studyfetchapi.com"
|
260
260
|
|
261
261
|
super().__init__(
|
262
262
|
version=__version__,
|
studyfetch_sdk/_version.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: studyfetch_sdk
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.0a10
|
4
4
|
Summary: The official Python library for the studyfetch-sdk API
|
5
5
|
Project-URL: Homepage, https://github.com/GoStudyFetchGo/studyfetch-sdk-python
|
6
6
|
Project-URL: Repository, https://github.com/GoStudyFetchGo/studyfetch-sdk-python
|
7
|
-
Author: Studyfetch SDK
|
7
|
+
Author-email: Studyfetch SDK <support@studyfetch.com>
|
8
8
|
License: Apache-2.0
|
9
9
|
Classifier: Intended Audience :: Developers
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
@@ -46,7 +46,7 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
46
46
|
|
47
47
|
## Documentation
|
48
48
|
|
49
|
-
The full API of this library can be found in [api.md](https://github.com/GoStudyFetchGo/studyfetch-sdk-python/tree/main/api.md).
|
49
|
+
The REST API documentation can be found on [studyfetch.com](https://studyfetch.com/docs). The full API of this library can be found in [api.md](https://github.com/GoStudyFetchGo/studyfetch-sdk-python/tree/main/api.md).
|
50
50
|
|
51
51
|
## Installation
|
52
52
|
|
@@ -67,7 +67,13 @@ client = StudyfetchSDK(
|
|
67
67
|
api_key=os.environ.get("STUDYFETCH_SDK_API_KEY"), # This is the default and can be omitted
|
68
68
|
)
|
69
69
|
|
70
|
-
|
70
|
+
component = client.v1.components.create(
|
71
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
72
|
+
name="My Study Component",
|
73
|
+
origin="api",
|
74
|
+
type="flashcards",
|
75
|
+
)
|
76
|
+
print(component._id)
|
71
77
|
```
|
72
78
|
|
73
79
|
While you can provide an `api_key` keyword argument,
|
@@ -90,7 +96,13 @@ client = AsyncStudyfetchSDK(
|
|
90
96
|
|
91
97
|
|
92
98
|
async def main() -> None:
|
93
|
-
|
99
|
+
component = await client.v1.components.create(
|
100
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
101
|
+
name="My Study Component",
|
102
|
+
origin="api",
|
103
|
+
type="flashcards",
|
104
|
+
)
|
105
|
+
print(component._id)
|
94
106
|
|
95
107
|
|
96
108
|
asyncio.run(main())
|
@@ -122,7 +134,13 @@ async def main() -> None:
|
|
122
134
|
api_key="My API Key",
|
123
135
|
http_client=DefaultAioHttpClient(),
|
124
136
|
) as client:
|
125
|
-
|
137
|
+
component = await client.v1.components.create(
|
138
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
139
|
+
name="My Study Component",
|
140
|
+
origin="api",
|
141
|
+
type="flashcards",
|
142
|
+
)
|
143
|
+
print(component._id)
|
126
144
|
|
127
145
|
|
128
146
|
asyncio.run(main())
|
@@ -187,7 +205,12 @@ from studyfetch_sdk import StudyfetchSDK
|
|
187
205
|
client = StudyfetchSDK()
|
188
206
|
|
189
207
|
try:
|
190
|
-
client.v1.
|
208
|
+
client.v1.components.create(
|
209
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
210
|
+
name="My Study Component",
|
211
|
+
origin="api",
|
212
|
+
type="flashcards",
|
213
|
+
)
|
191
214
|
except studyfetch_sdk.APIConnectionError as e:
|
192
215
|
print("The server could not be reached")
|
193
216
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
@@ -230,7 +253,12 @@ client = StudyfetchSDK(
|
|
230
253
|
)
|
231
254
|
|
232
255
|
# Or, configure per-request:
|
233
|
-
client.with_options(max_retries=5).v1.
|
256
|
+
client.with_options(max_retries=5).v1.components.create(
|
257
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
258
|
+
name="My Study Component",
|
259
|
+
origin="api",
|
260
|
+
type="flashcards",
|
261
|
+
)
|
234
262
|
```
|
235
263
|
|
236
264
|
### Timeouts
|
@@ -253,7 +281,12 @@ client = StudyfetchSDK(
|
|
253
281
|
)
|
254
282
|
|
255
283
|
# Override per-request:
|
256
|
-
client.with_options(timeout=5.0).v1.
|
284
|
+
client.with_options(timeout=5.0).v1.components.create(
|
285
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
286
|
+
name="My Study Component",
|
287
|
+
origin="api",
|
288
|
+
type="flashcards",
|
289
|
+
)
|
257
290
|
```
|
258
291
|
|
259
292
|
On timeout, an `APITimeoutError` is thrown.
|
@@ -294,11 +327,18 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
294
327
|
from studyfetch_sdk import StudyfetchSDK
|
295
328
|
|
296
329
|
client = StudyfetchSDK()
|
297
|
-
response = client.v1.
|
330
|
+
response = client.v1.components.with_raw_response.create(
|
331
|
+
config={
|
332
|
+
"model": "gpt-4o-mini-2024-07-18"
|
333
|
+
},
|
334
|
+
name="My Study Component",
|
335
|
+
origin="api",
|
336
|
+
type="flashcards",
|
337
|
+
)
|
298
338
|
print(response.headers.get('X-My-Header'))
|
299
339
|
|
300
|
-
|
301
|
-
print(
|
340
|
+
component = response.parse() # get the object that `v1.components.create()` would have returned
|
341
|
+
print(component._id)
|
302
342
|
```
|
303
343
|
|
304
344
|
These methods return an [`APIResponse`](https://github.com/GoStudyFetchGo/studyfetch-sdk-python/tree/main/src/studyfetch_sdk/_response.py) object.
|
@@ -312,7 +352,12 @@ The above interface eagerly reads the full response body when you make the reque
|
|
312
352
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
313
353
|
|
314
354
|
```python
|
315
|
-
with client.v1.
|
355
|
+
with client.v1.components.with_streaming_response.create(
|
356
|
+
config={"model": "gpt-4o-mini-2024-07-18"},
|
357
|
+
name="My Study Component",
|
358
|
+
origin="api",
|
359
|
+
type="flashcards",
|
360
|
+
) as response:
|
316
361
|
print(response.headers.get("X-My-Header"))
|
317
362
|
|
318
363
|
for line in response.iter_lines():
|
@@ -1,6 +1,6 @@
|
|
1
1
|
studyfetch_sdk/__init__.py,sha256=RDyNe4WTXHp7ELTihsfx-JAW6kY4v_inAdPWMACRXUU,2685
|
2
2
|
studyfetch_sdk/_base_client.py,sha256=_ErYxBDM7URgEvuFcse8LJMKz0x_XK1Ni55WzZgrz_I,66930
|
3
|
-
studyfetch_sdk/_client.py,sha256=
|
3
|
+
studyfetch_sdk/_client.py,sha256=LdmGGYJBA4OMpyjaL7xSj9S2ZzNVlpS_zeLaa24Dh0Y,15048
|
4
4
|
studyfetch_sdk/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
5
|
studyfetch_sdk/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
6
6
|
studyfetch_sdk/_exceptions.py,sha256=19gq_huoBWNcc8dc3YLQHCjkkmixKafZmW2GqVGlmCs,3234
|
@@ -11,7 +11,7 @@ studyfetch_sdk/_resource.py,sha256=y0aoAqMIYwTAwStuxbpO8XpTPnrSNQQ_ZcgiH5xcntg,1
|
|
11
11
|
studyfetch_sdk/_response.py,sha256=6ph8tSkqF5pNbTo_2Zhizhq2O-Eb67TcksHwyg3aXdc,28864
|
12
12
|
studyfetch_sdk/_streaming.py,sha256=HZoENuPVzWhBn24eH3lnMCvRbWN0EPwvhWYfdlJfw0A,10128
|
13
13
|
studyfetch_sdk/_types.py,sha256=6nvqHGarRGuhs_FL8tJ8sGXXD8XWajNynT2K78GxRUI,6205
|
14
|
-
studyfetch_sdk/_version.py,sha256=
|
14
|
+
studyfetch_sdk/_version.py,sha256=2RMmEarsUmjhmJ2q-V2DRZhuNbc2P2-fxWoUuZRsrbE,175
|
15
15
|
studyfetch_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
studyfetch_sdk/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
studyfetch_sdk/_utils/_logs.py,sha256=EoZgOiIkpf2WB_0Ts0Ti7G3o_25v7IsPf_q-yEU6sbY,798
|
@@ -116,7 +116,7 @@ studyfetch_sdk/types/v1/scenarios/component_update_params.py,sha256=_Rs0wRJtrLMK
|
|
116
116
|
studyfetch_sdk/types/v1/scenarios/submissions/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
117
117
|
studyfetch_sdk/types/v1/tests/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
118
118
|
studyfetch_sdk/types/v1/upload/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
119
|
-
studyfetch_sdk-0.1.
|
120
|
-
studyfetch_sdk-0.1.
|
121
|
-
studyfetch_sdk-0.1.
|
122
|
-
studyfetch_sdk-0.1.
|
119
|
+
studyfetch_sdk-0.1.0a10.dist-info/METADATA,sha256=NfCS9XEMpju7-5DA1qFNo9MudtCCPPiTr8aGMBlXq34,15991
|
120
|
+
studyfetch_sdk-0.1.0a10.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
121
|
+
studyfetch_sdk-0.1.0a10.dist-info/licenses/LICENSE,sha256=CsdbJMegH_AAWljUmVcwW0Cj_GyIm1hjw6qPqPnmdn4,11344
|
122
|
+
studyfetch_sdk-0.1.0a10.dist-info/RECORD,,
|
File without changes
|
File without changes
|