studyfetch-sdk 0.1.0a3__py3-none-any.whl → 0.1.0a5__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/chat/chat.py +7 -7
- studyfetch_sdk/resources/v1/components.py +9 -8
- studyfetch_sdk/resources/v1/explainers.py +154 -9
- studyfetch_sdk/resources/v1/flashcards.py +16 -16
- studyfetch_sdk/resources/v1/scenarios/component.py +116 -12
- studyfetch_sdk/resources/v1/scenarios/scenarios.py +245 -9
- studyfetch_sdk/types/v1/__init__.py +2 -0
- studyfetch_sdk/types/v1/chat_send_message_params.py +3 -3
- studyfetch_sdk/types/v1/component_create_params.py +349 -3
- studyfetch_sdk/types/v1/component_create_response.py +3 -1
- studyfetch_sdk/types/v1/component_embed_params.py +3 -2
- studyfetch_sdk/types/v1/component_list_response.py +3 -1
- studyfetch_sdk/types/v1/component_retrieve_response.py +3 -1
- studyfetch_sdk/types/v1/component_update_response.py +3 -1
- 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_all_params.py +2 -2
- studyfetch_sdk/types/v1/flashcard_get_due_params.py +1 -1
- studyfetch_sdk/types/v1/flashcard_get_stats_params.py +2 -2
- studyfetch_sdk/types/v1/scenario_create_params.py +39 -2
- studyfetch_sdk/types/v1/scenario_submit_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.0a3.dist-info → studyfetch_sdk-0.1.0a5.dist-info}/METADATA +1 -1
- {studyfetch_sdk-0.1.0a3.dist-info → studyfetch_sdk-0.1.0a5.dist-info}/RECORD +28 -26
- {studyfetch_sdk-0.1.0a3.dist-info → studyfetch_sdk-0.1.0a5.dist-info}/WHEEL +0 -0
- {studyfetch_sdk-0.1.0a3.dist-info → studyfetch_sdk-0.1.0a5.dist-info}/licenses/LICENSE +0 -0
@@ -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
|
),
|
@@ -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 .sessions import (
|
@@ -23,7 +25,7 @@ from .component import (
|
|
23
25
|
AsyncComponentResourceWithStreamingResponse,
|
24
26
|
)
|
25
27
|
from ...._compat import cached_property
|
26
|
-
from ....types.v1 import scenario_create_params, scenario_update_params
|
28
|
+
from ....types.v1 import scenario_create_params, scenario_submit_params, scenario_update_params
|
27
29
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
28
30
|
from ...._response import (
|
29
31
|
to_raw_response_wrapper,
|
@@ -79,7 +81,18 @@ class ScenariosResource(SyncAPIResource):
|
|
79
81
|
def create(
|
80
82
|
self,
|
81
83
|
*,
|
82
|
-
|
84
|
+
component_id: str,
|
85
|
+
name: str,
|
86
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
87
|
+
context: str | NotGiven = NOT_GIVEN,
|
88
|
+
description: str | NotGiven = NOT_GIVEN,
|
89
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
90
|
+
format: str | NotGiven = NOT_GIVEN,
|
91
|
+
goal: str | NotGiven = NOT_GIVEN,
|
92
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
93
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
94
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
95
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
83
96
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
84
97
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
85
98
|
extra_headers: Headers | None = None,
|
@@ -91,6 +104,30 @@ class ScenariosResource(SyncAPIResource):
|
|
91
104
|
Create a new scenario
|
92
105
|
|
93
106
|
Args:
|
107
|
+
component_id: Associated component ID
|
108
|
+
|
109
|
+
name: Scenario name
|
110
|
+
|
111
|
+
characters: Scenario characters
|
112
|
+
|
113
|
+
context: Scenario context
|
114
|
+
|
115
|
+
description: Scenario description
|
116
|
+
|
117
|
+
final_answer_prompt: Prompt for final answer
|
118
|
+
|
119
|
+
format: Interaction format
|
120
|
+
|
121
|
+
goal: Scenario goal
|
122
|
+
|
123
|
+
greeting_character_id: Character ID for greeting
|
124
|
+
|
125
|
+
greeting_message: Greeting message
|
126
|
+
|
127
|
+
requires_final_answer: Whether scenario requires a final answer
|
128
|
+
|
129
|
+
tools: Available tools
|
130
|
+
|
94
131
|
extra_headers: Send extra headers
|
95
132
|
|
96
133
|
extra_query: Add additional query parameters to the request
|
@@ -102,7 +139,23 @@ class ScenariosResource(SyncAPIResource):
|
|
102
139
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
103
140
|
return self._post(
|
104
141
|
"/api/v1/scenarios",
|
105
|
-
body=maybe_transform(
|
142
|
+
body=maybe_transform(
|
143
|
+
{
|
144
|
+
"component_id": component_id,
|
145
|
+
"name": name,
|
146
|
+
"characters": characters,
|
147
|
+
"context": context,
|
148
|
+
"description": description,
|
149
|
+
"final_answer_prompt": final_answer_prompt,
|
150
|
+
"format": format,
|
151
|
+
"goal": goal,
|
152
|
+
"greeting_character_id": greeting_character_id,
|
153
|
+
"greeting_message": greeting_message,
|
154
|
+
"requires_final_answer": requires_final_answer,
|
155
|
+
"tools": tools,
|
156
|
+
},
|
157
|
+
scenario_create_params.ScenarioCreateParams,
|
158
|
+
),
|
106
159
|
options=make_request_options(
|
107
160
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
108
161
|
),
|
@@ -147,7 +200,18 @@ class ScenariosResource(SyncAPIResource):
|
|
147
200
|
self,
|
148
201
|
id: str,
|
149
202
|
*,
|
150
|
-
|
203
|
+
component_id: str,
|
204
|
+
name: str,
|
205
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
206
|
+
context: str | NotGiven = NOT_GIVEN,
|
207
|
+
description: str | NotGiven = NOT_GIVEN,
|
208
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
209
|
+
format: str | NotGiven = NOT_GIVEN,
|
210
|
+
goal: str | NotGiven = NOT_GIVEN,
|
211
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
212
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
213
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
214
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
151
215
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
152
216
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
153
217
|
extra_headers: Headers | None = None,
|
@@ -159,6 +223,30 @@ class ScenariosResource(SyncAPIResource):
|
|
159
223
|
Update scenario
|
160
224
|
|
161
225
|
Args:
|
226
|
+
component_id: Associated component ID
|
227
|
+
|
228
|
+
name: Scenario name
|
229
|
+
|
230
|
+
characters: Scenario characters
|
231
|
+
|
232
|
+
context: Scenario context
|
233
|
+
|
234
|
+
description: Scenario description
|
235
|
+
|
236
|
+
final_answer_prompt: Prompt for final answer
|
237
|
+
|
238
|
+
format: Interaction format
|
239
|
+
|
240
|
+
goal: Scenario goal
|
241
|
+
|
242
|
+
greeting_character_id: Character ID for greeting
|
243
|
+
|
244
|
+
greeting_message: Greeting message
|
245
|
+
|
246
|
+
requires_final_answer: Whether scenario requires a final answer
|
247
|
+
|
248
|
+
tools: Available tools
|
249
|
+
|
162
250
|
extra_headers: Send extra headers
|
163
251
|
|
164
252
|
extra_query: Add additional query parameters to the request
|
@@ -172,7 +260,23 @@ class ScenariosResource(SyncAPIResource):
|
|
172
260
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
173
261
|
return self._put(
|
174
262
|
f"/api/v1/scenarios/{id}",
|
175
|
-
body=maybe_transform(
|
263
|
+
body=maybe_transform(
|
264
|
+
{
|
265
|
+
"component_id": component_id,
|
266
|
+
"name": name,
|
267
|
+
"characters": characters,
|
268
|
+
"context": context,
|
269
|
+
"description": description,
|
270
|
+
"final_answer_prompt": final_answer_prompt,
|
271
|
+
"format": format,
|
272
|
+
"goal": goal,
|
273
|
+
"greeting_character_id": greeting_character_id,
|
274
|
+
"greeting_message": greeting_message,
|
275
|
+
"requires_final_answer": requires_final_answer,
|
276
|
+
"tools": tools,
|
277
|
+
},
|
278
|
+
scenario_update_params.ScenarioUpdateParams,
|
279
|
+
),
|
176
280
|
options=make_request_options(
|
177
281
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
178
282
|
),
|
@@ -269,6 +373,8 @@ class ScenariosResource(SyncAPIResource):
|
|
269
373
|
self,
|
270
374
|
id: str,
|
271
375
|
*,
|
376
|
+
conversation_history: Iterable[object],
|
377
|
+
final_answer: str | NotGiven = NOT_GIVEN,
|
272
378
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
273
379
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
274
380
|
extra_headers: Headers | None = None,
|
@@ -277,7 +383,13 @@ class ScenariosResource(SyncAPIResource):
|
|
277
383
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
278
384
|
) -> None:
|
279
385
|
"""
|
386
|
+
Submit scenario answer
|
387
|
+
|
280
388
|
Args:
|
389
|
+
conversation_history: Conversation history
|
390
|
+
|
391
|
+
final_answer: Final answer for the scenario
|
392
|
+
|
281
393
|
extra_headers: Send extra headers
|
282
394
|
|
283
395
|
extra_query: Add additional query parameters to the request
|
@@ -291,6 +403,13 @@ class ScenariosResource(SyncAPIResource):
|
|
291
403
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
292
404
|
return self._post(
|
293
405
|
f"/api/v1/scenarios/{id}/submit",
|
406
|
+
body=maybe_transform(
|
407
|
+
{
|
408
|
+
"conversation_history": conversation_history,
|
409
|
+
"final_answer": final_answer,
|
410
|
+
},
|
411
|
+
scenario_submit_params.ScenarioSubmitParams,
|
412
|
+
),
|
294
413
|
options=make_request_options(
|
295
414
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
296
415
|
),
|
@@ -333,7 +452,18 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
333
452
|
async def create(
|
334
453
|
self,
|
335
454
|
*,
|
336
|
-
|
455
|
+
component_id: str,
|
456
|
+
name: str,
|
457
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
458
|
+
context: str | NotGiven = NOT_GIVEN,
|
459
|
+
description: str | NotGiven = NOT_GIVEN,
|
460
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
461
|
+
format: str | NotGiven = NOT_GIVEN,
|
462
|
+
goal: str | NotGiven = NOT_GIVEN,
|
463
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
464
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
465
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
466
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
337
467
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
338
468
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
339
469
|
extra_headers: Headers | None = None,
|
@@ -345,6 +475,30 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
345
475
|
Create a new scenario
|
346
476
|
|
347
477
|
Args:
|
478
|
+
component_id: Associated component ID
|
479
|
+
|
480
|
+
name: Scenario name
|
481
|
+
|
482
|
+
characters: Scenario characters
|
483
|
+
|
484
|
+
context: Scenario context
|
485
|
+
|
486
|
+
description: Scenario description
|
487
|
+
|
488
|
+
final_answer_prompt: Prompt for final answer
|
489
|
+
|
490
|
+
format: Interaction format
|
491
|
+
|
492
|
+
goal: Scenario goal
|
493
|
+
|
494
|
+
greeting_character_id: Character ID for greeting
|
495
|
+
|
496
|
+
greeting_message: Greeting message
|
497
|
+
|
498
|
+
requires_final_answer: Whether scenario requires a final answer
|
499
|
+
|
500
|
+
tools: Available tools
|
501
|
+
|
348
502
|
extra_headers: Send extra headers
|
349
503
|
|
350
504
|
extra_query: Add additional query parameters to the request
|
@@ -356,7 +510,23 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
356
510
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
357
511
|
return await self._post(
|
358
512
|
"/api/v1/scenarios",
|
359
|
-
body=await async_maybe_transform(
|
513
|
+
body=await async_maybe_transform(
|
514
|
+
{
|
515
|
+
"component_id": component_id,
|
516
|
+
"name": name,
|
517
|
+
"characters": characters,
|
518
|
+
"context": context,
|
519
|
+
"description": description,
|
520
|
+
"final_answer_prompt": final_answer_prompt,
|
521
|
+
"format": format,
|
522
|
+
"goal": goal,
|
523
|
+
"greeting_character_id": greeting_character_id,
|
524
|
+
"greeting_message": greeting_message,
|
525
|
+
"requires_final_answer": requires_final_answer,
|
526
|
+
"tools": tools,
|
527
|
+
},
|
528
|
+
scenario_create_params.ScenarioCreateParams,
|
529
|
+
),
|
360
530
|
options=make_request_options(
|
361
531
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
362
532
|
),
|
@@ -401,7 +571,18 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
401
571
|
self,
|
402
572
|
id: str,
|
403
573
|
*,
|
404
|
-
|
574
|
+
component_id: str,
|
575
|
+
name: str,
|
576
|
+
characters: Iterable[object] | NotGiven = NOT_GIVEN,
|
577
|
+
context: str | NotGiven = NOT_GIVEN,
|
578
|
+
description: str | NotGiven = NOT_GIVEN,
|
579
|
+
final_answer_prompt: str | NotGiven = NOT_GIVEN,
|
580
|
+
format: str | NotGiven = NOT_GIVEN,
|
581
|
+
goal: str | NotGiven = NOT_GIVEN,
|
582
|
+
greeting_character_id: str | NotGiven = NOT_GIVEN,
|
583
|
+
greeting_message: str | NotGiven = NOT_GIVEN,
|
584
|
+
requires_final_answer: bool | NotGiven = NOT_GIVEN,
|
585
|
+
tools: Iterable[object] | NotGiven = NOT_GIVEN,
|
405
586
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
406
587
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
407
588
|
extra_headers: Headers | None = None,
|
@@ -413,6 +594,30 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
413
594
|
Update scenario
|
414
595
|
|
415
596
|
Args:
|
597
|
+
component_id: Associated component ID
|
598
|
+
|
599
|
+
name: Scenario name
|
600
|
+
|
601
|
+
characters: Scenario characters
|
602
|
+
|
603
|
+
context: Scenario context
|
604
|
+
|
605
|
+
description: Scenario description
|
606
|
+
|
607
|
+
final_answer_prompt: Prompt for final answer
|
608
|
+
|
609
|
+
format: Interaction format
|
610
|
+
|
611
|
+
goal: Scenario goal
|
612
|
+
|
613
|
+
greeting_character_id: Character ID for greeting
|
614
|
+
|
615
|
+
greeting_message: Greeting message
|
616
|
+
|
617
|
+
requires_final_answer: Whether scenario requires a final answer
|
618
|
+
|
619
|
+
tools: Available tools
|
620
|
+
|
416
621
|
extra_headers: Send extra headers
|
417
622
|
|
418
623
|
extra_query: Add additional query parameters to the request
|
@@ -426,7 +631,23 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
426
631
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
427
632
|
return await self._put(
|
428
633
|
f"/api/v1/scenarios/{id}",
|
429
|
-
body=await async_maybe_transform(
|
634
|
+
body=await async_maybe_transform(
|
635
|
+
{
|
636
|
+
"component_id": component_id,
|
637
|
+
"name": name,
|
638
|
+
"characters": characters,
|
639
|
+
"context": context,
|
640
|
+
"description": description,
|
641
|
+
"final_answer_prompt": final_answer_prompt,
|
642
|
+
"format": format,
|
643
|
+
"goal": goal,
|
644
|
+
"greeting_character_id": greeting_character_id,
|
645
|
+
"greeting_message": greeting_message,
|
646
|
+
"requires_final_answer": requires_final_answer,
|
647
|
+
"tools": tools,
|
648
|
+
},
|
649
|
+
scenario_update_params.ScenarioUpdateParams,
|
650
|
+
),
|
430
651
|
options=make_request_options(
|
431
652
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
432
653
|
),
|
@@ -523,6 +744,8 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
523
744
|
self,
|
524
745
|
id: str,
|
525
746
|
*,
|
747
|
+
conversation_history: Iterable[object],
|
748
|
+
final_answer: str | NotGiven = NOT_GIVEN,
|
526
749
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
527
750
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
528
751
|
extra_headers: Headers | None = None,
|
@@ -531,7 +754,13 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
531
754
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
532
755
|
) -> None:
|
533
756
|
"""
|
757
|
+
Submit scenario answer
|
758
|
+
|
534
759
|
Args:
|
760
|
+
conversation_history: Conversation history
|
761
|
+
|
762
|
+
final_answer: Final answer for the scenario
|
763
|
+
|
535
764
|
extra_headers: Send extra headers
|
536
765
|
|
537
766
|
extra_query: Add additional query parameters to the request
|
@@ -545,6 +774,13 @@ class AsyncScenariosResource(AsyncAPIResource):
|
|
545
774
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
546
775
|
return await self._post(
|
547
776
|
f"/api/v1/scenarios/{id}/submit",
|
777
|
+
body=await async_maybe_transform(
|
778
|
+
{
|
779
|
+
"conversation_history": conversation_history,
|
780
|
+
"final_answer": final_answer,
|
781
|
+
},
|
782
|
+
scenario_submit_params.ScenarioSubmitParams,
|
783
|
+
),
|
548
784
|
options=make_request_options(
|
549
785
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
550
786
|
),
|
@@ -18,11 +18,13 @@ from .embed_get_theme_params import EmbedGetThemeParams as EmbedGetThemeParams
|
|
18
18
|
from .material_create_params import MaterialCreateParams as MaterialCreateParams
|
19
19
|
from .material_list_response import MaterialListResponse as MaterialListResponse
|
20
20
|
from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams
|
21
|
+
from .scenario_submit_params import ScenarioSubmitParams as ScenarioSubmitParams
|
21
22
|
from .scenario_update_params import ScenarioUpdateParams as ScenarioUpdateParams
|
22
23
|
from .usage_get_stats_params import UsageGetStatsParams as UsageGetStatsParams
|
23
24
|
from .component_create_params import ComponentCreateParams as ComponentCreateParams
|
24
25
|
from .component_list_response import ComponentListResponse as ComponentListResponse
|
25
26
|
from .component_update_params import ComponentUpdateParams as ComponentUpdateParams
|
27
|
+
from .explainer_create_params import ExplainerCreateParams as ExplainerCreateParams
|
26
28
|
from .chat_send_message_params import ChatSendMessageParams as ChatSendMessageParams
|
27
29
|
from .component_embed_response import ComponentEmbedResponse as ComponentEmbedResponse
|
28
30
|
from .flashcard_get_all_params import FlashcardGetAllParams as FlashcardGetAllParams
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from typing import Iterable
|
5
|
+
from typing import List, Iterable
|
6
6
|
from typing_extensions import Required, Annotated, TypedDict
|
7
7
|
|
8
8
|
from ..._utils import PropertyInfo
|
@@ -22,8 +22,8 @@ class ChatSendMessageParams(TypedDict, total=False):
|
|
22
22
|
context: object
|
23
23
|
"""Additional context data"""
|
24
24
|
|
25
|
-
|
26
|
-
"""Group
|
25
|
+
group_ids: Annotated[List[str], PropertyInfo(alias="groupIds")]
|
26
|
+
"""Group IDs for collaboration"""
|
27
27
|
|
28
28
|
session_id: Annotated[str, PropertyInfo(alias="sessionId")]
|
29
29
|
"""Session ID for conversation continuity"""
|