studyfetch-sdk 0.1.0a8__py3-none-any.whl → 0.1.0a9__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.
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "studyfetch_sdk"
4
- __version__ = "0.1.0-alpha.8" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.9" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: studyfetch_sdk
3
- Version: 0.1.0a8
3
+ Version: 0.1.0a9
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
@@ -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
- materials = client.v1.materials.list()
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
- materials = await client.v1.materials.list()
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
- materials = await client.v1.materials.list()
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.materials.list()
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.materials.list()
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.materials.list()
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.materials.with_raw_response.list()
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
- material = response.parse() # get the object that `v1.materials.list()` would have returned
301
- print(material)
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.materials.with_streaming_response.list() as response:
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():
@@ -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=Vf6gzaBS9CUgMitt7McNjZ6uRx010I7u4yd1TX0pF4w,174
14
+ studyfetch_sdk/_version.py,sha256=gYtB4zbL7OSNvCpmdlxwjVsu3fUItiERkp1M6mm93VI,174
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.0a8.dist-info/METADATA,sha256=VHHBvOO_WDRqb1TF3L3MDLENKgVAziwaKJjdgIIV8yc,14699
120
- studyfetch_sdk-0.1.0a8.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
121
- studyfetch_sdk-0.1.0a8.dist-info/licenses/LICENSE,sha256=CsdbJMegH_AAWljUmVcwW0Cj_GyIm1hjw6qPqPnmdn4,11344
122
- studyfetch_sdk-0.1.0a8.dist-info/RECORD,,
119
+ studyfetch_sdk-0.1.0a9.dist-info/METADATA,sha256=O7nFCm7coUQ7_nXLfIfFmJJZZw5oHDfzAyZspubJDu8,15869
120
+ studyfetch_sdk-0.1.0a9.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
121
+ studyfetch_sdk-0.1.0a9.dist-info/licenses/LICENSE,sha256=CsdbJMegH_AAWljUmVcwW0Cj_GyIm1hjw6qPqPnmdn4,11344
122
+ studyfetch_sdk-0.1.0a9.dist-info/RECORD,,