studyfetch-sdk 0.1.0a18__py3-none-any.whl → 0.1.0a20__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.
Files changed (78) hide show
  1. studyfetch_sdk/_models.py +24 -3
  2. studyfetch_sdk/_version.py +1 -1
  3. studyfetch_sdk/resources/v1/__init__.py +0 -84
  4. studyfetch_sdk/resources/v1/assignment_grader.py +81 -1
  5. studyfetch_sdk/resources/v1/components.py +36 -4
  6. studyfetch_sdk/resources/v1/materials/materials.py +130 -2
  7. studyfetch_sdk/resources/v1/materials/upload.py +286 -0
  8. studyfetch_sdk/resources/v1/usage/analyst.py +143 -15
  9. studyfetch_sdk/resources/v1/v1.py +66 -192
  10. studyfetch_sdk/types/v1/__init__.py +2 -20
  11. studyfetch_sdk/types/v1/assignment_grader_response.py +20 -1
  12. studyfetch_sdk/types/v1/component.py +9 -1
  13. studyfetch_sdk/types/v1/component_create_params.py +81 -1
  14. studyfetch_sdk/types/v1/component_generate_embed_params.py +7 -1
  15. studyfetch_sdk/types/v1/component_list_params.py +9 -1
  16. studyfetch_sdk/types/v1/content_param.py +23 -0
  17. studyfetch_sdk/types/v1/material_create_and_process_params.py +27 -0
  18. studyfetch_sdk/types/v1/material_create_params.py +4 -17
  19. studyfetch_sdk/types/v1/materials/__init__.py +2 -0
  20. studyfetch_sdk/types/v1/materials/upload_create_presigned_url_params.py +3 -0
  21. studyfetch_sdk/types/v1/materials/upload_upload_file_and_process_params.py +29 -0
  22. studyfetch_sdk/types/v1/materials/upload_upload_file_params.py +3 -0
  23. studyfetch_sdk/types/v1/materials/upload_upload_url_and_process_params.py +26 -0
  24. studyfetch_sdk/types/v1/usage/__init__.py +3 -0
  25. studyfetch_sdk/types/v1/usage/analyst_get_test_questions_params.py +18 -0
  26. studyfetch_sdk/types/v1/usage/analyst_list_chat_messages_params.py +18 -0
  27. studyfetch_sdk/types/v1/usage/analyst_list_chat_messages_response.py +35 -0
  28. studyfetch_sdk/types/v1/usage/analyst_list_events_params.py +7 -0
  29. {studyfetch_sdk-0.1.0a18.dist-info → studyfetch_sdk-0.1.0a20.dist-info}/METADATA +1 -1
  30. {studyfetch_sdk-0.1.0a18.dist-info → studyfetch_sdk-0.1.0a20.dist-info}/RECORD +32 -71
  31. studyfetch_sdk/resources/v1/audio_recaps/__init__.py +0 -33
  32. studyfetch_sdk/resources/v1/audio_recaps/audio_recaps.py +0 -328
  33. studyfetch_sdk/resources/v1/audio_recaps/sections.py +0 -250
  34. studyfetch_sdk/resources/v1/chat/__init__.py +0 -47
  35. studyfetch_sdk/resources/v1/chat/chat.py +0 -574
  36. studyfetch_sdk/resources/v1/chat/sessions.py +0 -222
  37. studyfetch_sdk/resources/v1/chat/test.py +0 -190
  38. studyfetch_sdk/resources/v1/explainers.py +0 -441
  39. studyfetch_sdk/resources/v1/flashcards.py +0 -783
  40. studyfetch_sdk/resources/v1/scenarios/__init__.py +0 -61
  41. studyfetch_sdk/resources/v1/scenarios/component.py +0 -426
  42. studyfetch_sdk/resources/v1/scenarios/scenarios.py +0 -936
  43. studyfetch_sdk/resources/v1/scenarios/sessions.py +0 -236
  44. studyfetch_sdk/resources/v1/scenarios/submissions/__init__.py +0 -33
  45. studyfetch_sdk/resources/v1/scenarios/submissions/submissions.py +0 -102
  46. studyfetch_sdk/resources/v1/scenarios/submissions/user.py +0 -210
  47. studyfetch_sdk/resources/v1/tests/__init__.py +0 -33
  48. studyfetch_sdk/resources/v1/tests/component.py +0 -160
  49. studyfetch_sdk/resources/v1/tests/tests.py +0 -682
  50. studyfetch_sdk/types/v1/audio_recaps/__init__.py +0 -3
  51. studyfetch_sdk/types/v1/chat/__init__.py +0 -5
  52. studyfetch_sdk/types/v1/chat/session_retrieve_params.py +0 -11
  53. studyfetch_sdk/types/v1/chat_get_session_params.py +0 -13
  54. studyfetch_sdk/types/v1/chat_send_message_params.py +0 -54
  55. studyfetch_sdk/types/v1/chat_stream_params.py +0 -28
  56. studyfetch_sdk/types/v1/explainer_create_params.py +0 -45
  57. studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +0 -53
  58. studyfetch_sdk/types/v1/flashcard_batch_process_params.py +0 -36
  59. studyfetch_sdk/types/v1/flashcard_batch_process_response.py +0 -39
  60. studyfetch_sdk/types/v1/flashcard_get_algorithm_response.py +0 -37
  61. studyfetch_sdk/types/v1/flashcard_get_all_params.py +0 -23
  62. studyfetch_sdk/types/v1/flashcard_get_due_params.py +0 -19
  63. studyfetch_sdk/types/v1/flashcard_get_stats_params.py +0 -17
  64. studyfetch_sdk/types/v1/flashcard_get_types_response.py +0 -14
  65. studyfetch_sdk/types/v1/flashcard_rate_params.py +0 -23
  66. studyfetch_sdk/types/v1/scenario_create_params.py +0 -48
  67. studyfetch_sdk/types/v1/scenario_submit_answer_params.py +0 -18
  68. studyfetch_sdk/types/v1/scenario_update_params.py +0 -45
  69. studyfetch_sdk/types/v1/scenarios/__init__.py +0 -5
  70. studyfetch_sdk/types/v1/scenarios/component_update_params.py +0 -45
  71. studyfetch_sdk/types/v1/scenarios/submissions/__init__.py +0 -3
  72. studyfetch_sdk/types/v1/test_create_params.py +0 -20
  73. studyfetch_sdk/types/v1/test_retake_params.py +0 -14
  74. studyfetch_sdk/types/v1/test_submit_answer_params.py +0 -20
  75. studyfetch_sdk/types/v1/test_submit_params.py +0 -14
  76. studyfetch_sdk/types/v1/tests/__init__.py +0 -3
  77. {studyfetch_sdk-0.1.0a18.dist-info → studyfetch_sdk-0.1.0a20.dist-info}/WHEEL +0 -0
  78. {studyfetch_sdk-0.1.0a18.dist-info → studyfetch_sdk-0.1.0a20.dist-info}/licenses/LICENSE +0 -0
@@ -1,936 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Iterable
6
-
7
- import httpx
8
-
9
- from .sessions import (
10
- SessionsResource,
11
- AsyncSessionsResource,
12
- SessionsResourceWithRawResponse,
13
- AsyncSessionsResourceWithRawResponse,
14
- SessionsResourceWithStreamingResponse,
15
- AsyncSessionsResourceWithStreamingResponse,
16
- )
17
- from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
18
- from ...._utils import maybe_transform, async_maybe_transform
19
- from .component import (
20
- ComponentResource,
21
- AsyncComponentResource,
22
- ComponentResourceWithRawResponse,
23
- AsyncComponentResourceWithRawResponse,
24
- ComponentResourceWithStreamingResponse,
25
- AsyncComponentResourceWithStreamingResponse,
26
- )
27
- from ...._compat import cached_property
28
- from ....types.v1 import scenario_create_params, scenario_update_params, scenario_submit_answer_params
29
- from ...._resource import SyncAPIResource, AsyncAPIResource
30
- from ...._response import (
31
- to_raw_response_wrapper,
32
- to_streamed_response_wrapper,
33
- async_to_raw_response_wrapper,
34
- async_to_streamed_response_wrapper,
35
- )
36
- from ...._base_client import make_request_options
37
- from .submissions.submissions import (
38
- SubmissionsResource,
39
- AsyncSubmissionsResource,
40
- SubmissionsResourceWithRawResponse,
41
- AsyncSubmissionsResourceWithRawResponse,
42
- SubmissionsResourceWithStreamingResponse,
43
- AsyncSubmissionsResourceWithStreamingResponse,
44
- )
45
-
46
- __all__ = ["ScenariosResource", "AsyncScenariosResource"]
47
-
48
-
49
- class ScenariosResource(SyncAPIResource):
50
- @cached_property
51
- def component(self) -> ComponentResource:
52
- return ComponentResource(self._client)
53
-
54
- @cached_property
55
- def sessions(self) -> SessionsResource:
56
- return SessionsResource(self._client)
57
-
58
- @cached_property
59
- def submissions(self) -> SubmissionsResource:
60
- return SubmissionsResource(self._client)
61
-
62
- @cached_property
63
- def with_raw_response(self) -> ScenariosResourceWithRawResponse:
64
- """
65
- This property can be used as a prefix for any HTTP method call to return
66
- the raw response object instead of the parsed content.
67
-
68
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
69
- """
70
- return ScenariosResourceWithRawResponse(self)
71
-
72
- @cached_property
73
- def with_streaming_response(self) -> ScenariosResourceWithStreamingResponse:
74
- """
75
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
76
-
77
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
78
- """
79
- return ScenariosResourceWithStreamingResponse(self)
80
-
81
- def create(
82
- self,
83
- *,
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,
96
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
97
- # The extra values given here take precedence over values defined on the client or passed to this method.
98
- extra_headers: Headers | None = None,
99
- extra_query: Query | None = None,
100
- extra_body: Body | None = None,
101
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
102
- ) -> None:
103
- """
104
- Create a new scenario
105
-
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
-
131
- extra_headers: Send extra headers
132
-
133
- extra_query: Add additional query parameters to the request
134
-
135
- extra_body: Add additional JSON properties to the request
136
-
137
- timeout: Override the client-level default timeout for this request, in seconds
138
- """
139
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
140
- return self._post(
141
- "/api/v1/scenarios",
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
- ),
159
- options=make_request_options(
160
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
161
- ),
162
- cast_to=NoneType,
163
- )
164
-
165
- def retrieve(
166
- self,
167
- id: str,
168
- *,
169
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
170
- # The extra values given here take precedence over values defined on the client or passed to this method.
171
- extra_headers: Headers | None = None,
172
- extra_query: Query | None = None,
173
- extra_body: Body | None = None,
174
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
175
- ) -> None:
176
- """
177
- Get scenario by ID
178
-
179
- Args:
180
- extra_headers: Send extra headers
181
-
182
- extra_query: Add additional query parameters to the request
183
-
184
- extra_body: Add additional JSON properties to the request
185
-
186
- timeout: Override the client-level default timeout for this request, in seconds
187
- """
188
- if not id:
189
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
190
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
191
- return self._get(
192
- f"/api/v1/scenarios/{id}",
193
- options=make_request_options(
194
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
195
- ),
196
- cast_to=NoneType,
197
- )
198
-
199
- def update(
200
- self,
201
- id: str,
202
- *,
203
- name: str,
204
- characters: Iterable[object] | NotGiven = NOT_GIVEN,
205
- context: str | NotGiven = NOT_GIVEN,
206
- description: str | NotGiven = NOT_GIVEN,
207
- final_answer_prompt: str | NotGiven = NOT_GIVEN,
208
- format: str | NotGiven = NOT_GIVEN,
209
- goal: str | NotGiven = NOT_GIVEN,
210
- greeting_character_id: str | NotGiven = NOT_GIVEN,
211
- greeting_message: str | NotGiven = NOT_GIVEN,
212
- requires_final_answer: bool | NotGiven = NOT_GIVEN,
213
- tools: Iterable[object] | NotGiven = NOT_GIVEN,
214
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215
- # The extra values given here take precedence over values defined on the client or passed to this method.
216
- extra_headers: Headers | None = None,
217
- extra_query: Query | None = None,
218
- extra_body: Body | None = None,
219
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
220
- ) -> None:
221
- """
222
- Update scenario
223
-
224
- Args:
225
- name: Scenario name
226
-
227
- characters: Scenario characters
228
-
229
- context: Scenario context
230
-
231
- description: Scenario description
232
-
233
- final_answer_prompt: Prompt for final answer
234
-
235
- format: Interaction format
236
-
237
- goal: Scenario goal
238
-
239
- greeting_character_id: Character ID for greeting
240
-
241
- greeting_message: Greeting message
242
-
243
- requires_final_answer: Whether scenario requires a final answer
244
-
245
- tools: Available tools
246
-
247
- extra_headers: Send extra headers
248
-
249
- extra_query: Add additional query parameters to the request
250
-
251
- extra_body: Add additional JSON properties to the request
252
-
253
- timeout: Override the client-level default timeout for this request, in seconds
254
- """
255
- if not id:
256
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
257
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
258
- return self._put(
259
- f"/api/v1/scenarios/{id}",
260
- body=maybe_transform(
261
- {
262
- "name": name,
263
- "characters": characters,
264
- "context": context,
265
- "description": description,
266
- "final_answer_prompt": final_answer_prompt,
267
- "format": format,
268
- "goal": goal,
269
- "greeting_character_id": greeting_character_id,
270
- "greeting_message": greeting_message,
271
- "requires_final_answer": requires_final_answer,
272
- "tools": tools,
273
- },
274
- scenario_update_params.ScenarioUpdateParams,
275
- ),
276
- options=make_request_options(
277
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
278
- ),
279
- cast_to=NoneType,
280
- )
281
-
282
- def list(
283
- self,
284
- *,
285
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
286
- # The extra values given here take precedence over values defined on the client or passed to this method.
287
- extra_headers: Headers | None = None,
288
- extra_query: Query | None = None,
289
- extra_body: Body | None = None,
290
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
291
- ) -> None:
292
- """Get all scenarios"""
293
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
294
- return self._get(
295
- "/api/v1/scenarios",
296
- options=make_request_options(
297
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
298
- ),
299
- cast_to=NoneType,
300
- )
301
-
302
- def delete(
303
- self,
304
- id: str,
305
- *,
306
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
307
- # The extra values given here take precedence over values defined on the client or passed to this method.
308
- extra_headers: Headers | None = None,
309
- extra_query: Query | None = None,
310
- extra_body: Body | None = None,
311
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
312
- ) -> None:
313
- """
314
- Delete scenario
315
-
316
- Args:
317
- extra_headers: Send extra headers
318
-
319
- extra_query: Add additional query parameters to the request
320
-
321
- extra_body: Add additional JSON properties to the request
322
-
323
- timeout: Override the client-level default timeout for this request, in seconds
324
- """
325
- if not id:
326
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
327
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
328
- return self._delete(
329
- f"/api/v1/scenarios/{id}",
330
- options=make_request_options(
331
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
332
- ),
333
- cast_to=NoneType,
334
- )
335
-
336
- def get_stats(
337
- self,
338
- id: str,
339
- *,
340
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341
- # The extra values given here take precedence over values defined on the client or passed to this method.
342
- extra_headers: Headers | None = None,
343
- extra_query: Query | None = None,
344
- extra_body: Body | None = None,
345
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
346
- ) -> None:
347
- """
348
- Args:
349
- extra_headers: Send extra headers
350
-
351
- extra_query: Add additional query parameters to the request
352
-
353
- extra_body: Add additional JSON properties to the request
354
-
355
- timeout: Override the client-level default timeout for this request, in seconds
356
- """
357
- if not id:
358
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
359
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
360
- return self._get(
361
- f"/api/v1/scenarios/{id}/stats",
362
- options=make_request_options(
363
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
364
- ),
365
- cast_to=NoneType,
366
- )
367
-
368
- def submit_answer(
369
- self,
370
- id: str,
371
- *,
372
- conversation_history: Iterable[object],
373
- final_answer: str | NotGiven = NOT_GIVEN,
374
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
375
- # The extra values given here take precedence over values defined on the client or passed to this method.
376
- extra_headers: Headers | None = None,
377
- extra_query: Query | None = None,
378
- extra_body: Body | None = None,
379
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
380
- ) -> None:
381
- """
382
- Submit scenario answer
383
-
384
- Args:
385
- conversation_history: Conversation history
386
-
387
- final_answer: Final answer for the scenario
388
-
389
- extra_headers: Send extra headers
390
-
391
- extra_query: Add additional query parameters to the request
392
-
393
- extra_body: Add additional JSON properties to the request
394
-
395
- timeout: Override the client-level default timeout for this request, in seconds
396
- """
397
- if not id:
398
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
399
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
400
- return self._post(
401
- f"/api/v1/scenarios/{id}/submit",
402
- body=maybe_transform(
403
- {
404
- "conversation_history": conversation_history,
405
- "final_answer": final_answer,
406
- },
407
- scenario_submit_answer_params.ScenarioSubmitAnswerParams,
408
- ),
409
- options=make_request_options(
410
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
411
- ),
412
- cast_to=NoneType,
413
- )
414
-
415
-
416
- class AsyncScenariosResource(AsyncAPIResource):
417
- @cached_property
418
- def component(self) -> AsyncComponentResource:
419
- return AsyncComponentResource(self._client)
420
-
421
- @cached_property
422
- def sessions(self) -> AsyncSessionsResource:
423
- return AsyncSessionsResource(self._client)
424
-
425
- @cached_property
426
- def submissions(self) -> AsyncSubmissionsResource:
427
- return AsyncSubmissionsResource(self._client)
428
-
429
- @cached_property
430
- def with_raw_response(self) -> AsyncScenariosResourceWithRawResponse:
431
- """
432
- This property can be used as a prefix for any HTTP method call to return
433
- the raw response object instead of the parsed content.
434
-
435
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
436
- """
437
- return AsyncScenariosResourceWithRawResponse(self)
438
-
439
- @cached_property
440
- def with_streaming_response(self) -> AsyncScenariosResourceWithStreamingResponse:
441
- """
442
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
443
-
444
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
445
- """
446
- return AsyncScenariosResourceWithStreamingResponse(self)
447
-
448
- async def create(
449
- self,
450
- *,
451
- component_id: str,
452
- name: str,
453
- characters: Iterable[object] | NotGiven = NOT_GIVEN,
454
- context: str | NotGiven = NOT_GIVEN,
455
- description: str | NotGiven = NOT_GIVEN,
456
- final_answer_prompt: str | NotGiven = NOT_GIVEN,
457
- format: str | NotGiven = NOT_GIVEN,
458
- goal: str | NotGiven = NOT_GIVEN,
459
- greeting_character_id: str | NotGiven = NOT_GIVEN,
460
- greeting_message: str | NotGiven = NOT_GIVEN,
461
- requires_final_answer: bool | NotGiven = NOT_GIVEN,
462
- tools: Iterable[object] | NotGiven = NOT_GIVEN,
463
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
464
- # The extra values given here take precedence over values defined on the client or passed to this method.
465
- extra_headers: Headers | None = None,
466
- extra_query: Query | None = None,
467
- extra_body: Body | None = None,
468
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
469
- ) -> None:
470
- """
471
- Create a new scenario
472
-
473
- Args:
474
- component_id: Associated component ID
475
-
476
- name: Scenario name
477
-
478
- characters: Scenario characters
479
-
480
- context: Scenario context
481
-
482
- description: Scenario description
483
-
484
- final_answer_prompt: Prompt for final answer
485
-
486
- format: Interaction format
487
-
488
- goal: Scenario goal
489
-
490
- greeting_character_id: Character ID for greeting
491
-
492
- greeting_message: Greeting message
493
-
494
- requires_final_answer: Whether scenario requires a final answer
495
-
496
- tools: Available tools
497
-
498
- extra_headers: Send extra headers
499
-
500
- extra_query: Add additional query parameters to the request
501
-
502
- extra_body: Add additional JSON properties to the request
503
-
504
- timeout: Override the client-level default timeout for this request, in seconds
505
- """
506
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
507
- return await self._post(
508
- "/api/v1/scenarios",
509
- body=await async_maybe_transform(
510
- {
511
- "component_id": component_id,
512
- "name": name,
513
- "characters": characters,
514
- "context": context,
515
- "description": description,
516
- "final_answer_prompt": final_answer_prompt,
517
- "format": format,
518
- "goal": goal,
519
- "greeting_character_id": greeting_character_id,
520
- "greeting_message": greeting_message,
521
- "requires_final_answer": requires_final_answer,
522
- "tools": tools,
523
- },
524
- scenario_create_params.ScenarioCreateParams,
525
- ),
526
- options=make_request_options(
527
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
528
- ),
529
- cast_to=NoneType,
530
- )
531
-
532
- async def retrieve(
533
- self,
534
- id: str,
535
- *,
536
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
537
- # The extra values given here take precedence over values defined on the client or passed to this method.
538
- extra_headers: Headers | None = None,
539
- extra_query: Query | None = None,
540
- extra_body: Body | None = None,
541
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
542
- ) -> None:
543
- """
544
- Get scenario by ID
545
-
546
- Args:
547
- extra_headers: Send extra headers
548
-
549
- extra_query: Add additional query parameters to the request
550
-
551
- extra_body: Add additional JSON properties to the request
552
-
553
- timeout: Override the client-level default timeout for this request, in seconds
554
- """
555
- if not id:
556
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
557
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
558
- return await self._get(
559
- f"/api/v1/scenarios/{id}",
560
- options=make_request_options(
561
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
562
- ),
563
- cast_to=NoneType,
564
- )
565
-
566
- async def update(
567
- self,
568
- id: str,
569
- *,
570
- name: str,
571
- characters: Iterable[object] | NotGiven = NOT_GIVEN,
572
- context: str | NotGiven = NOT_GIVEN,
573
- description: str | NotGiven = NOT_GIVEN,
574
- final_answer_prompt: str | NotGiven = NOT_GIVEN,
575
- format: str | NotGiven = NOT_GIVEN,
576
- goal: str | NotGiven = NOT_GIVEN,
577
- greeting_character_id: str | NotGiven = NOT_GIVEN,
578
- greeting_message: str | NotGiven = NOT_GIVEN,
579
- requires_final_answer: bool | NotGiven = NOT_GIVEN,
580
- tools: Iterable[object] | NotGiven = NOT_GIVEN,
581
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
582
- # The extra values given here take precedence over values defined on the client or passed to this method.
583
- extra_headers: Headers | None = None,
584
- extra_query: Query | None = None,
585
- extra_body: Body | None = None,
586
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
587
- ) -> None:
588
- """
589
- Update scenario
590
-
591
- Args:
592
- name: Scenario name
593
-
594
- characters: Scenario characters
595
-
596
- context: Scenario context
597
-
598
- description: Scenario description
599
-
600
- final_answer_prompt: Prompt for final answer
601
-
602
- format: Interaction format
603
-
604
- goal: Scenario goal
605
-
606
- greeting_character_id: Character ID for greeting
607
-
608
- greeting_message: Greeting message
609
-
610
- requires_final_answer: Whether scenario requires a final answer
611
-
612
- tools: Available tools
613
-
614
- extra_headers: Send extra headers
615
-
616
- extra_query: Add additional query parameters to the request
617
-
618
- extra_body: Add additional JSON properties to the request
619
-
620
- timeout: Override the client-level default timeout for this request, in seconds
621
- """
622
- if not id:
623
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
624
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
625
- return await self._put(
626
- f"/api/v1/scenarios/{id}",
627
- body=await async_maybe_transform(
628
- {
629
- "name": name,
630
- "characters": characters,
631
- "context": context,
632
- "description": description,
633
- "final_answer_prompt": final_answer_prompt,
634
- "format": format,
635
- "goal": goal,
636
- "greeting_character_id": greeting_character_id,
637
- "greeting_message": greeting_message,
638
- "requires_final_answer": requires_final_answer,
639
- "tools": tools,
640
- },
641
- scenario_update_params.ScenarioUpdateParams,
642
- ),
643
- options=make_request_options(
644
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
645
- ),
646
- cast_to=NoneType,
647
- )
648
-
649
- async def list(
650
- self,
651
- *,
652
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
653
- # The extra values given here take precedence over values defined on the client or passed to this method.
654
- extra_headers: Headers | None = None,
655
- extra_query: Query | None = None,
656
- extra_body: Body | None = None,
657
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
658
- ) -> None:
659
- """Get all scenarios"""
660
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
661
- return await self._get(
662
- "/api/v1/scenarios",
663
- options=make_request_options(
664
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
665
- ),
666
- cast_to=NoneType,
667
- )
668
-
669
- async def delete(
670
- self,
671
- id: str,
672
- *,
673
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
674
- # The extra values given here take precedence over values defined on the client or passed to this method.
675
- extra_headers: Headers | None = None,
676
- extra_query: Query | None = None,
677
- extra_body: Body | None = None,
678
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
679
- ) -> None:
680
- """
681
- Delete scenario
682
-
683
- Args:
684
- extra_headers: Send extra headers
685
-
686
- extra_query: Add additional query parameters to the request
687
-
688
- extra_body: Add additional JSON properties to the request
689
-
690
- timeout: Override the client-level default timeout for this request, in seconds
691
- """
692
- if not id:
693
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
694
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
695
- return await self._delete(
696
- f"/api/v1/scenarios/{id}",
697
- options=make_request_options(
698
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
699
- ),
700
- cast_to=NoneType,
701
- )
702
-
703
- async def get_stats(
704
- self,
705
- id: str,
706
- *,
707
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
708
- # The extra values given here take precedence over values defined on the client or passed to this method.
709
- extra_headers: Headers | None = None,
710
- extra_query: Query | None = None,
711
- extra_body: Body | None = None,
712
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
713
- ) -> None:
714
- """
715
- Args:
716
- extra_headers: Send extra headers
717
-
718
- extra_query: Add additional query parameters to the request
719
-
720
- extra_body: Add additional JSON properties to the request
721
-
722
- timeout: Override the client-level default timeout for this request, in seconds
723
- """
724
- if not id:
725
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
726
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
727
- return await self._get(
728
- f"/api/v1/scenarios/{id}/stats",
729
- options=make_request_options(
730
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
731
- ),
732
- cast_to=NoneType,
733
- )
734
-
735
- async def submit_answer(
736
- self,
737
- id: str,
738
- *,
739
- conversation_history: Iterable[object],
740
- final_answer: str | NotGiven = NOT_GIVEN,
741
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
742
- # The extra values given here take precedence over values defined on the client or passed to this method.
743
- extra_headers: Headers | None = None,
744
- extra_query: Query | None = None,
745
- extra_body: Body | None = None,
746
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
747
- ) -> None:
748
- """
749
- Submit scenario answer
750
-
751
- Args:
752
- conversation_history: Conversation history
753
-
754
- final_answer: Final answer for the scenario
755
-
756
- extra_headers: Send extra headers
757
-
758
- extra_query: Add additional query parameters to the request
759
-
760
- extra_body: Add additional JSON properties to the request
761
-
762
- timeout: Override the client-level default timeout for this request, in seconds
763
- """
764
- if not id:
765
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
766
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
767
- return await self._post(
768
- f"/api/v1/scenarios/{id}/submit",
769
- body=await async_maybe_transform(
770
- {
771
- "conversation_history": conversation_history,
772
- "final_answer": final_answer,
773
- },
774
- scenario_submit_answer_params.ScenarioSubmitAnswerParams,
775
- ),
776
- options=make_request_options(
777
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
778
- ),
779
- cast_to=NoneType,
780
- )
781
-
782
-
783
- class ScenariosResourceWithRawResponse:
784
- def __init__(self, scenarios: ScenariosResource) -> None:
785
- self._scenarios = scenarios
786
-
787
- self.create = to_raw_response_wrapper(
788
- scenarios.create,
789
- )
790
- self.retrieve = to_raw_response_wrapper(
791
- scenarios.retrieve,
792
- )
793
- self.update = to_raw_response_wrapper(
794
- scenarios.update,
795
- )
796
- self.list = to_raw_response_wrapper(
797
- scenarios.list,
798
- )
799
- self.delete = to_raw_response_wrapper(
800
- scenarios.delete,
801
- )
802
- self.get_stats = to_raw_response_wrapper(
803
- scenarios.get_stats,
804
- )
805
- self.submit_answer = to_raw_response_wrapper(
806
- scenarios.submit_answer,
807
- )
808
-
809
- @cached_property
810
- def component(self) -> ComponentResourceWithRawResponse:
811
- return ComponentResourceWithRawResponse(self._scenarios.component)
812
-
813
- @cached_property
814
- def sessions(self) -> SessionsResourceWithRawResponse:
815
- return SessionsResourceWithRawResponse(self._scenarios.sessions)
816
-
817
- @cached_property
818
- def submissions(self) -> SubmissionsResourceWithRawResponse:
819
- return SubmissionsResourceWithRawResponse(self._scenarios.submissions)
820
-
821
-
822
- class AsyncScenariosResourceWithRawResponse:
823
- def __init__(self, scenarios: AsyncScenariosResource) -> None:
824
- self._scenarios = scenarios
825
-
826
- self.create = async_to_raw_response_wrapper(
827
- scenarios.create,
828
- )
829
- self.retrieve = async_to_raw_response_wrapper(
830
- scenarios.retrieve,
831
- )
832
- self.update = async_to_raw_response_wrapper(
833
- scenarios.update,
834
- )
835
- self.list = async_to_raw_response_wrapper(
836
- scenarios.list,
837
- )
838
- self.delete = async_to_raw_response_wrapper(
839
- scenarios.delete,
840
- )
841
- self.get_stats = async_to_raw_response_wrapper(
842
- scenarios.get_stats,
843
- )
844
- self.submit_answer = async_to_raw_response_wrapper(
845
- scenarios.submit_answer,
846
- )
847
-
848
- @cached_property
849
- def component(self) -> AsyncComponentResourceWithRawResponse:
850
- return AsyncComponentResourceWithRawResponse(self._scenarios.component)
851
-
852
- @cached_property
853
- def sessions(self) -> AsyncSessionsResourceWithRawResponse:
854
- return AsyncSessionsResourceWithRawResponse(self._scenarios.sessions)
855
-
856
- @cached_property
857
- def submissions(self) -> AsyncSubmissionsResourceWithRawResponse:
858
- return AsyncSubmissionsResourceWithRawResponse(self._scenarios.submissions)
859
-
860
-
861
- class ScenariosResourceWithStreamingResponse:
862
- def __init__(self, scenarios: ScenariosResource) -> None:
863
- self._scenarios = scenarios
864
-
865
- self.create = to_streamed_response_wrapper(
866
- scenarios.create,
867
- )
868
- self.retrieve = to_streamed_response_wrapper(
869
- scenarios.retrieve,
870
- )
871
- self.update = to_streamed_response_wrapper(
872
- scenarios.update,
873
- )
874
- self.list = to_streamed_response_wrapper(
875
- scenarios.list,
876
- )
877
- self.delete = to_streamed_response_wrapper(
878
- scenarios.delete,
879
- )
880
- self.get_stats = to_streamed_response_wrapper(
881
- scenarios.get_stats,
882
- )
883
- self.submit_answer = to_streamed_response_wrapper(
884
- scenarios.submit_answer,
885
- )
886
-
887
- @cached_property
888
- def component(self) -> ComponentResourceWithStreamingResponse:
889
- return ComponentResourceWithStreamingResponse(self._scenarios.component)
890
-
891
- @cached_property
892
- def sessions(self) -> SessionsResourceWithStreamingResponse:
893
- return SessionsResourceWithStreamingResponse(self._scenarios.sessions)
894
-
895
- @cached_property
896
- def submissions(self) -> SubmissionsResourceWithStreamingResponse:
897
- return SubmissionsResourceWithStreamingResponse(self._scenarios.submissions)
898
-
899
-
900
- class AsyncScenariosResourceWithStreamingResponse:
901
- def __init__(self, scenarios: AsyncScenariosResource) -> None:
902
- self._scenarios = scenarios
903
-
904
- self.create = async_to_streamed_response_wrapper(
905
- scenarios.create,
906
- )
907
- self.retrieve = async_to_streamed_response_wrapper(
908
- scenarios.retrieve,
909
- )
910
- self.update = async_to_streamed_response_wrapper(
911
- scenarios.update,
912
- )
913
- self.list = async_to_streamed_response_wrapper(
914
- scenarios.list,
915
- )
916
- self.delete = async_to_streamed_response_wrapper(
917
- scenarios.delete,
918
- )
919
- self.get_stats = async_to_streamed_response_wrapper(
920
- scenarios.get_stats,
921
- )
922
- self.submit_answer = async_to_streamed_response_wrapper(
923
- scenarios.submit_answer,
924
- )
925
-
926
- @cached_property
927
- def component(self) -> AsyncComponentResourceWithStreamingResponse:
928
- return AsyncComponentResourceWithStreamingResponse(self._scenarios.component)
929
-
930
- @cached_property
931
- def sessions(self) -> AsyncSessionsResourceWithStreamingResponse:
932
- return AsyncSessionsResourceWithStreamingResponse(self._scenarios.sessions)
933
-
934
- @cached_property
935
- def submissions(self) -> AsyncSubmissionsResourceWithStreamingResponse:
936
- return AsyncSubmissionsResourceWithStreamingResponse(self._scenarios.submissions)