studyfetch-sdk 0.1.0a4__py3-none-any.whl → 0.1.0a6__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/_version.py +1 -1
- studyfetch_sdk/resources/v1/__init__.py +12 -12
- studyfetch_sdk/resources/v1/chat/chat.py +13 -15
- studyfetch_sdk/resources/v1/components.py +40 -37
- studyfetch_sdk/resources/v1/explainers.py +234 -9
- studyfetch_sdk/resources/v1/flashcards.py +15 -15
- studyfetch_sdk/resources/v1/materials/materials.py +19 -20
- studyfetch_sdk/resources/v1/materials/upload.py +19 -20
- studyfetch_sdk/resources/v1/scenarios/component.py +116 -12
- studyfetch_sdk/resources/v1/scenarios/scenarios.py +255 -19
- studyfetch_sdk/resources/v1/scenarios/submissions/user.py +50 -50
- studyfetch_sdk/resources/v1/v1.py +48 -48
- studyfetch_sdk/types/v1/__init__.py +8 -11
- studyfetch_sdk/types/v1/{chat_retrieve_session_params.py → chat_get_session_params.py} +2 -2
- studyfetch_sdk/types/v1/{component_create_response.py → component.py} +2 -2
- studyfetch_sdk/types/v1/component_create_params.py +60 -6
- studyfetch_sdk/types/v1/{component_embed_params.py → component_generate_embed_params.py} +2 -2
- studyfetch_sdk/types/v1/{component_embed_response.py → component_generate_embed_response.py} +2 -2
- studyfetch_sdk/types/v1/component_list_response.py +5 -46
- studyfetch_sdk/types/v1/explainer_create_params.py +45 -0
- studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +45 -3
- studyfetch_sdk/types/v1/{flashcard_get_algorithm_info_response.py → flashcard_get_algorithm_response.py} +2 -2
- studyfetch_sdk/types/v1/{material_create_response.py → material.py} +2 -2
- studyfetch_sdk/types/v1/material_list_response.py +5 -60
- studyfetch_sdk/types/v1/materials/__init__.py +0 -2
- studyfetch_sdk/types/v1/scenario_create_params.py +39 -2
- studyfetch_sdk/types/v1/scenario_submit_answer_params.py +18 -0
- studyfetch_sdk/types/v1/scenario_update_params.py +39 -2
- studyfetch_sdk/types/v1/scenarios/component_update_params.py +39 -2
- {studyfetch_sdk-0.1.0a4.dist-info → studyfetch_sdk-0.1.0a6.dist-info}/METADATA +28 -12
- {studyfetch_sdk-0.1.0a4.dist-info → studyfetch_sdk-0.1.0a6.dist-info}/RECORD +33 -43
- studyfetch_sdk/types/v1/admin/__init__.py +0 -3
- studyfetch_sdk/types/v1/admin/organizations/__init__.py +0 -3
- studyfetch_sdk/types/v1/admin/organizations/models/__init__.py +0 -3
- studyfetch_sdk/types/v1/component_retrieve_response.py +0 -48
- studyfetch_sdk/types/v1/component_update_response.py +0 -48
- studyfetch_sdk/types/v1/material_retrieve_response.py +0 -62
- studyfetch_sdk/types/v1/materials/upload_upload_file_response.py +0 -62
- studyfetch_sdk/types/v1/materials/upload_upload_from_url_response.py +0 -62
- studyfetch_sdk/types/v1/organizations/__init__.py +0 -3
- studyfetch_sdk/types/v1/organizations/logo/__init__.py +0 -3
- studyfetch_sdk/types/v1/organizations/profile/__init__.py +0 -3
- studyfetch_sdk/types/v1/organizations/team/__init__.py +0 -3
- {studyfetch_sdk-0.1.0a4.dist-info → studyfetch_sdk-0.1.0a6.dist-info}/WHEEL +0 -0
- {studyfetch_sdk-0.1.0a4.dist-info → studyfetch_sdk-0.1.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -17,9 +17,8 @@ from ...._response import (
|
|
17
17
|
async_to_streamed_response_wrapper,
|
18
18
|
)
|
19
19
|
from ...._base_client import make_request_options
|
20
|
+
from ....types.v1.material import Material
|
20
21
|
from ....types.v1.materials import upload_upload_file_params, upload_upload_from_url_params
|
21
|
-
from ....types.v1.materials.upload_upload_file_response import UploadUploadFileResponse
|
22
|
-
from ....types.v1.materials.upload_upload_from_url_response import UploadUploadFromURLResponse
|
23
22
|
|
24
23
|
__all__ = ["UploadResource", "AsyncUploadResource"]
|
25
24
|
|
@@ -63,7 +62,7 @@ class UploadResource(SyncAPIResource):
|
|
63
62
|
cast_to=NoneType,
|
64
63
|
)
|
65
64
|
|
66
|
-
def
|
65
|
+
def create_presigned_url(
|
67
66
|
self,
|
68
67
|
*,
|
69
68
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
@@ -94,7 +93,7 @@ class UploadResource(SyncAPIResource):
|
|
94
93
|
extra_query: Query | None = None,
|
95
94
|
extra_body: Body | None = None,
|
96
95
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
97
|
-
) ->
|
96
|
+
) -> Material:
|
98
97
|
"""
|
99
98
|
Upload a material file
|
100
99
|
|
@@ -130,7 +129,7 @@ class UploadResource(SyncAPIResource):
|
|
130
129
|
options=make_request_options(
|
131
130
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
132
131
|
),
|
133
|
-
cast_to=
|
132
|
+
cast_to=Material,
|
134
133
|
)
|
135
134
|
|
136
135
|
def upload_from_url(
|
@@ -145,7 +144,7 @@ class UploadResource(SyncAPIResource):
|
|
145
144
|
extra_query: Query | None = None,
|
146
145
|
extra_body: Body | None = None,
|
147
146
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
148
|
-
) ->
|
147
|
+
) -> Material:
|
149
148
|
"""
|
150
149
|
Upload material from URL
|
151
150
|
|
@@ -177,7 +176,7 @@ class UploadResource(SyncAPIResource):
|
|
177
176
|
options=make_request_options(
|
178
177
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
179
178
|
),
|
180
|
-
cast_to=
|
179
|
+
cast_to=Material,
|
181
180
|
)
|
182
181
|
|
183
182
|
|
@@ -220,7 +219,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|
220
219
|
cast_to=NoneType,
|
221
220
|
)
|
222
221
|
|
223
|
-
async def
|
222
|
+
async def create_presigned_url(
|
224
223
|
self,
|
225
224
|
*,
|
226
225
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
@@ -251,7 +250,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|
251
250
|
extra_query: Query | None = None,
|
252
251
|
extra_body: Body | None = None,
|
253
252
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
254
|
-
) ->
|
253
|
+
) -> Material:
|
255
254
|
"""
|
256
255
|
Upload a material file
|
257
256
|
|
@@ -287,7 +286,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|
287
286
|
options=make_request_options(
|
288
287
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
289
288
|
),
|
290
|
-
cast_to=
|
289
|
+
cast_to=Material,
|
291
290
|
)
|
292
291
|
|
293
292
|
async def upload_from_url(
|
@@ -302,7 +301,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|
302
301
|
extra_query: Query | None = None,
|
303
302
|
extra_body: Body | None = None,
|
304
303
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
305
|
-
) ->
|
304
|
+
) -> Material:
|
306
305
|
"""
|
307
306
|
Upload material from URL
|
308
307
|
|
@@ -334,7 +333,7 @@ class AsyncUploadResource(AsyncAPIResource):
|
|
334
333
|
options=make_request_options(
|
335
334
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
336
335
|
),
|
337
|
-
cast_to=
|
336
|
+
cast_to=Material,
|
338
337
|
)
|
339
338
|
|
340
339
|
|
@@ -345,8 +344,8 @@ class UploadResourceWithRawResponse:
|
|
345
344
|
self.complete_upload = to_raw_response_wrapper(
|
346
345
|
upload.complete_upload,
|
347
346
|
)
|
348
|
-
self.
|
349
|
-
upload.
|
347
|
+
self.create_presigned_url = to_raw_response_wrapper(
|
348
|
+
upload.create_presigned_url,
|
350
349
|
)
|
351
350
|
self.upload_file = to_raw_response_wrapper(
|
352
351
|
upload.upload_file,
|
@@ -363,8 +362,8 @@ class AsyncUploadResourceWithRawResponse:
|
|
363
362
|
self.complete_upload = async_to_raw_response_wrapper(
|
364
363
|
upload.complete_upload,
|
365
364
|
)
|
366
|
-
self.
|
367
|
-
upload.
|
365
|
+
self.create_presigned_url = async_to_raw_response_wrapper(
|
366
|
+
upload.create_presigned_url,
|
368
367
|
)
|
369
368
|
self.upload_file = async_to_raw_response_wrapper(
|
370
369
|
upload.upload_file,
|
@@ -381,8 +380,8 @@ class UploadResourceWithStreamingResponse:
|
|
381
380
|
self.complete_upload = to_streamed_response_wrapper(
|
382
381
|
upload.complete_upload,
|
383
382
|
)
|
384
|
-
self.
|
385
|
-
upload.
|
383
|
+
self.create_presigned_url = to_streamed_response_wrapper(
|
384
|
+
upload.create_presigned_url,
|
386
385
|
)
|
387
386
|
self.upload_file = to_streamed_response_wrapper(
|
388
387
|
upload.upload_file,
|
@@ -399,8 +398,8 @@ class AsyncUploadResourceWithStreamingResponse:
|
|
399
398
|
self.complete_upload = async_to_streamed_response_wrapper(
|
400
399
|
upload.complete_upload,
|
401
400
|
)
|
402
|
-
self.
|
403
|
-
upload.
|
401
|
+
self.create_presigned_url = async_to_streamed_response_wrapper(
|
402
|
+
upload.create_presigned_url,
|
404
403
|
)
|
405
404
|
self.upload_file = async_to_streamed_response_wrapper(
|
406
405
|
upload.upload_file,
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
+
from typing import Iterable
|
6
|
+
|
5
7
|
import httpx
|
6
8
|
|
7
9
|
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
@@ -76,9 +78,20 @@ class ComponentResource(SyncAPIResource):
|
|
76
78
|
|
77
79
|
def update(
|
78
80
|
self,
|
79
|
-
|
81
|
+
path_component_id: str,
|
80
82
|
*,
|
81
|
-
|
83
|
+
body_component_id: str,
|
84
|
+
name: str,
|
85
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
86
|
+
context: str | NotGiven = NOT_GIVEN,
|
87
|
+
description: str | NotGiven = NOT_GIVEN,
|
88
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
89
|
+
format: str | NotGiven = NOT_GIVEN,
|
90
|
+
goal: str | NotGiven = NOT_GIVEN,
|
91
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
92
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
93
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
94
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
82
95
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
83
96
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
84
97
|
extra_headers: Headers | None = None,
|
@@ -90,6 +103,30 @@ class ComponentResource(SyncAPIResource):
|
|
90
103
|
Update scenario by component ID
|
91
104
|
|
92
105
|
Args:
|
106
|
+
body_component_id: Associated component ID
|
107
|
+
|
108
|
+
name: Scenario name
|
109
|
+
|
110
|
+
characters: Scenario characters
|
111
|
+
|
112
|
+
context: Scenario context
|
113
|
+
|
114
|
+
description: Scenario description
|
115
|
+
|
116
|
+
final_answer_prompt: Prompt for final answer
|
117
|
+
|
118
|
+
format: Interaction format
|
119
|
+
|
120
|
+
goal: Scenario goal
|
121
|
+
|
122
|
+
greeting_character_id: Character ID for greeting
|
123
|
+
|
124
|
+
greeting_message: Greeting message
|
125
|
+
|
126
|
+
requires_final_answer: Whether scenario requires a final answer
|
127
|
+
|
128
|
+
tools: Available tools
|
129
|
+
|
93
130
|
extra_headers: Send extra headers
|
94
131
|
|
95
132
|
extra_query: Add additional query parameters to the request
|
@@ -98,12 +135,28 @@ class ComponentResource(SyncAPIResource):
|
|
98
135
|
|
99
136
|
timeout: Override the client-level default timeout for this request, in seconds
|
100
137
|
"""
|
101
|
-
if not
|
102
|
-
raise ValueError(f"Expected a non-empty value for `
|
138
|
+
if not path_component_id:
|
139
|
+
raise ValueError(f"Expected a non-empty value for `path_component_id` but received {path_component_id!r}")
|
103
140
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
104
141
|
return self._put(
|
105
|
-
f"/api/v1/scenarios/component/{
|
106
|
-
body=maybe_transform(
|
142
|
+
f"/api/v1/scenarios/component/{path_component_id}",
|
143
|
+
body=maybe_transform(
|
144
|
+
{
|
145
|
+
"body_component_id": body_component_id,
|
146
|
+
"name": name,
|
147
|
+
"characters": characters,
|
148
|
+
"context": context,
|
149
|
+
"description": description,
|
150
|
+
"final_answer_prompt": final_answer_prompt,
|
151
|
+
"format": format,
|
152
|
+
"goal": goal,
|
153
|
+
"greeting_character_id": greeting_character_id,
|
154
|
+
"greeting_message": greeting_message,
|
155
|
+
"requires_final_answer": requires_final_answer,
|
156
|
+
"tools": tools,
|
157
|
+
},
|
158
|
+
component_update_params.ComponentUpdateParams,
|
159
|
+
),
|
107
160
|
options=make_request_options(
|
108
161
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
109
162
|
),
|
@@ -201,9 +254,20 @@ class AsyncComponentResource(AsyncAPIResource):
|
|
201
254
|
|
202
255
|
async def update(
|
203
256
|
self,
|
204
|
-
|
257
|
+
path_component_id: str,
|
205
258
|
*,
|
206
|
-
|
259
|
+
body_component_id: str,
|
260
|
+
name: str,
|
261
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
262
|
+
context: str | NotGiven = NOT_GIVEN,
|
263
|
+
description: str | NotGiven = NOT_GIVEN,
|
264
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
265
|
+
format: str | NotGiven = NOT_GIVEN,
|
266
|
+
goal: str | NotGiven = NOT_GIVEN,
|
267
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
268
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
269
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
270
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
207
271
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
208
272
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
209
273
|
extra_headers: Headers | None = None,
|
@@ -215,6 +279,30 @@ class AsyncComponentResource(AsyncAPIResource):
|
|
215
279
|
Update scenario by component ID
|
216
280
|
|
217
281
|
Args:
|
282
|
+
body_component_id: Associated component ID
|
283
|
+
|
284
|
+
name: Scenario name
|
285
|
+
|
286
|
+
characters: Scenario characters
|
287
|
+
|
288
|
+
context: Scenario context
|
289
|
+
|
290
|
+
description: Scenario description
|
291
|
+
|
292
|
+
final_answer_prompt: Prompt for final answer
|
293
|
+
|
294
|
+
format: Interaction format
|
295
|
+
|
296
|
+
goal: Scenario goal
|
297
|
+
|
298
|
+
greeting_character_id: Character ID for greeting
|
299
|
+
|
300
|
+
greeting_message: Greeting message
|
301
|
+
|
302
|
+
requires_final_answer: Whether scenario requires a final answer
|
303
|
+
|
304
|
+
tools: Available tools
|
305
|
+
|
218
306
|
extra_headers: Send extra headers
|
219
307
|
|
220
308
|
extra_query: Add additional query parameters to the request
|
@@ -223,12 +311,28 @@ class AsyncComponentResource(AsyncAPIResource):
|
|
223
311
|
|
224
312
|
timeout: Override the client-level default timeout for this request, in seconds
|
225
313
|
"""
|
226
|
-
if not
|
227
|
-
raise ValueError(f"Expected a non-empty value for `
|
314
|
+
if not path_component_id:
|
315
|
+
raise ValueError(f"Expected a non-empty value for `path_component_id` but received {path_component_id!r}")
|
228
316
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
229
317
|
return await self._put(
|
230
|
-
f"/api/v1/scenarios/component/{
|
231
|
-
body=await async_maybe_transform(
|
318
|
+
f"/api/v1/scenarios/component/{path_component_id}",
|
319
|
+
body=await async_maybe_transform(
|
320
|
+
{
|
321
|
+
"body_component_id": body_component_id,
|
322
|
+
"name": name,
|
323
|
+
"characters": characters,
|
324
|
+
"context": context,
|
325
|
+
"description": description,
|
326
|
+
"final_answer_prompt": final_answer_prompt,
|
327
|
+
"format": format,
|
328
|
+
"goal": goal,
|
329
|
+
"greeting_character_id": greeting_character_id,
|
330
|
+
"greeting_message": greeting_message,
|
331
|
+
"requires_final_answer": requires_final_answer,
|
332
|
+
"tools": tools,
|
333
|
+
},
|
334
|
+
component_update_params.ComponentUpdateParams,
|
335
|
+
),
|
232
336
|
options=make_request_options(
|
233
337
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
234
338
|
),
|