@studyfetch/sdk 1.10.0 → 1.11.0
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.
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/resources/v1/components.d.mts +79 -7
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +79 -7
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/components.js +1 -1
- package/resources/v1/components.mjs +1 -1
- package/resources/v1/explainers.d.mts +116 -5
- package/resources/v1/explainers.d.mts.map +1 -1
- package/resources/v1/explainers.d.ts +116 -5
- package/resources/v1/explainers.d.ts.map +1 -1
- package/resources/v1/explainers.js +14 -6
- package/resources/v1/explainers.js.map +1 -1
- package/resources/v1/explainers.mjs +14 -6
- package/resources/v1/explainers.mjs.map +1 -1
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/scenarios/component.d.mts +51 -3
- package/resources/v1/scenarios/component.d.mts.map +1 -1
- package/resources/v1/scenarios/component.d.ts +51 -3
- package/resources/v1/scenarios/component.d.ts.map +1 -1
- package/resources/v1/scenarios/component.js +4 -4
- package/resources/v1/scenarios/component.js.map +1 -1
- package/resources/v1/scenarios/component.mjs +4 -4
- package/resources/v1/scenarios/component.mjs.map +1 -1
- package/resources/v1/scenarios/index.d.mts +1 -1
- package/resources/v1/scenarios/index.d.mts.map +1 -1
- package/resources/v1/scenarios/index.d.ts +1 -1
- package/resources/v1/scenarios/index.d.ts.map +1 -1
- package/resources/v1/scenarios/index.js.map +1 -1
- package/resources/v1/scenarios/index.mjs +1 -1
- package/resources/v1/scenarios/index.mjs.map +1 -1
- package/resources/v1/scenarios/scenarios.d.mts +123 -9
- package/resources/v1/scenarios/scenarios.d.mts.map +1 -1
- package/resources/v1/scenarios/scenarios.d.ts +123 -9
- package/resources/v1/scenarios/scenarios.d.ts.map +1 -1
- package/resources/v1/scenarios/scenarios.js +19 -10
- package/resources/v1/scenarios/scenarios.js.map +1 -1
- package/resources/v1/scenarios/scenarios.mjs +19 -10
- package/resources/v1/scenarios/scenarios.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/components.ts +97 -7
- package/src/resources/v1/explainers.ts +141 -8
- package/src/resources/v1/index.ts +6 -1
- package/src/resources/v1/scenarios/component.ts +63 -5
- package/src/resources/v1/scenarios/index.ts +6 -1
- package/src/resources/v1/scenarios/scenarios.ts +150 -12
- package/src/resources/v1/v1.ts +7 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -13,7 +13,7 @@ export class Components extends APIResource {
|
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* const component = await client.v1.components.create({
|
|
16
|
-
* config: { model: 'gpt-4o-mini' },
|
|
16
|
+
* config: { model: 'gpt-4o-mini-2024-07-18' },
|
|
17
17
|
* name: 'My Study Component',
|
|
18
18
|
* origin: 'chat',
|
|
19
19
|
* type: 'chat',
|
|
@@ -603,6 +603,11 @@ export namespace ComponentCreateParams {
|
|
|
603
603
|
*/
|
|
604
604
|
maxReviewInterval?: number;
|
|
605
605
|
|
|
606
|
+
/**
|
|
607
|
+
* AI model to use for flashcard generation
|
|
608
|
+
*/
|
|
609
|
+
model?: string;
|
|
610
|
+
|
|
606
611
|
/**
|
|
607
612
|
* Total number of flashcards to generate
|
|
608
613
|
*/
|
|
@@ -670,6 +675,11 @@ export namespace ComponentCreateParams {
|
|
|
670
675
|
*/
|
|
671
676
|
materials?: Array<string>;
|
|
672
677
|
|
|
678
|
+
/**
|
|
679
|
+
* AI model to use for scenario generation
|
|
680
|
+
*/
|
|
681
|
+
model?: string;
|
|
682
|
+
|
|
673
683
|
/**
|
|
674
684
|
* Placeholder text
|
|
675
685
|
*/
|
|
@@ -720,10 +730,20 @@ export namespace ComponentCreateParams {
|
|
|
720
730
|
*/
|
|
721
731
|
name: string;
|
|
722
732
|
|
|
733
|
+
/**
|
|
734
|
+
* Data format provided by the tool
|
|
735
|
+
*/
|
|
736
|
+
dataFormat?: string;
|
|
737
|
+
|
|
723
738
|
/**
|
|
724
739
|
* Tool description
|
|
725
740
|
*/
|
|
726
741
|
description?: string;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Tool type
|
|
745
|
+
*/
|
|
746
|
+
type?: string;
|
|
727
747
|
}
|
|
728
748
|
}
|
|
729
749
|
|
|
@@ -763,6 +783,11 @@ export namespace ComponentCreateParams {
|
|
|
763
783
|
*/
|
|
764
784
|
maxAttempts?: number;
|
|
765
785
|
|
|
786
|
+
/**
|
|
787
|
+
* AI model to use for question generation and grading
|
|
788
|
+
*/
|
|
789
|
+
model?: string;
|
|
790
|
+
|
|
766
791
|
/**
|
|
767
792
|
* Passing score percentage
|
|
768
793
|
*/
|
|
@@ -837,15 +862,20 @@ export namespace ComponentCreateParams {
|
|
|
837
862
|
}
|
|
838
863
|
|
|
839
864
|
export interface AudioRecapConfigDto {
|
|
865
|
+
/**
|
|
866
|
+
* Duration of audio recap in minutes
|
|
867
|
+
*/
|
|
868
|
+
duration?: number;
|
|
869
|
+
|
|
840
870
|
/**
|
|
841
871
|
* Folder IDs
|
|
842
872
|
*/
|
|
843
873
|
folders?: Array<string>;
|
|
844
874
|
|
|
845
875
|
/**
|
|
846
|
-
*
|
|
876
|
+
* Enable multi-voice conversation mode
|
|
847
877
|
*/
|
|
848
|
-
|
|
878
|
+
isMultiVoice?: boolean;
|
|
849
879
|
|
|
850
880
|
/**
|
|
851
881
|
* Material IDs
|
|
@@ -853,14 +883,39 @@ export namespace ComponentCreateParams {
|
|
|
853
883
|
materials?: Array<string>;
|
|
854
884
|
|
|
855
885
|
/**
|
|
856
|
-
*
|
|
886
|
+
* AI model to use for generation
|
|
887
|
+
*/
|
|
888
|
+
model?: string;
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Number of parts to split the audio into
|
|
892
|
+
*/
|
|
893
|
+
numParts?: number;
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Type of audio recap
|
|
897
|
+
*/
|
|
898
|
+
recapType?: 'SUMMARY' | 'LECTURE' | 'PODCAST' | 'AUDIO_BOOK';
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Theme or style for the audio recap
|
|
857
902
|
*/
|
|
858
|
-
|
|
903
|
+
theme?: string;
|
|
859
904
|
|
|
860
905
|
/**
|
|
861
|
-
*
|
|
906
|
+
* Specific topic to focus on
|
|
862
907
|
*/
|
|
863
|
-
|
|
908
|
+
topic?: string;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Primary voice for narration
|
|
912
|
+
*/
|
|
913
|
+
voice1?: string;
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Secondary voice for multi-voice mode
|
|
917
|
+
*/
|
|
918
|
+
voice2?: string;
|
|
864
919
|
}
|
|
865
920
|
|
|
866
921
|
export interface ExplainersConfigDto {
|
|
@@ -869,10 +924,45 @@ export namespace ComponentCreateParams {
|
|
|
869
924
|
*/
|
|
870
925
|
folders?: Array<string>;
|
|
871
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Enable image search for visuals
|
|
929
|
+
*/
|
|
930
|
+
imageSearch?: boolean;
|
|
931
|
+
|
|
872
932
|
/**
|
|
873
933
|
* Material IDs
|
|
874
934
|
*/
|
|
875
935
|
materials?: Array<string>;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* AI model to use for generation
|
|
939
|
+
*/
|
|
940
|
+
model?: string;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Video style
|
|
944
|
+
*/
|
|
945
|
+
style?: string;
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Target length in seconds
|
|
949
|
+
*/
|
|
950
|
+
targetLength?: number;
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Video title (defaults to component name if not provided)
|
|
954
|
+
*/
|
|
955
|
+
title?: string;
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Create vertical video format (9:16)
|
|
959
|
+
*/
|
|
960
|
+
verticalVideo?: boolean;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Enable web search for additional content
|
|
964
|
+
*/
|
|
965
|
+
webSearch?: boolean;
|
|
876
966
|
}
|
|
877
967
|
|
|
878
968
|
export interface UploadsConfigDto {
|
|
@@ -11,7 +11,13 @@ export class Explainers extends APIResource {
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
-
* await client.v1.explainers.create(
|
|
14
|
+
* await client.v1.explainers.create({
|
|
15
|
+
* componentId: 'componentId',
|
|
16
|
+
* folderIds: ['string'],
|
|
17
|
+
* materialIds: ['string'],
|
|
18
|
+
* targetLength: 15,
|
|
19
|
+
* title: 'title',
|
|
20
|
+
* });
|
|
15
21
|
* ```
|
|
16
22
|
*/
|
|
17
23
|
create(body: ExplainerCreateParams, options?: RequestOptions): APIPromise<void> {
|
|
@@ -23,27 +29,154 @@ export class Explainers extends APIResource {
|
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/**
|
|
26
|
-
* Handle webhook events
|
|
32
|
+
* Handle explainer video webhook events
|
|
27
33
|
*
|
|
28
34
|
* @example
|
|
29
35
|
* ```ts
|
|
30
|
-
* await client.v1.explainers.handleWebhook({
|
|
36
|
+
* await client.v1.explainers.handleWebhook({
|
|
37
|
+
* event: 'video.completed',
|
|
38
|
+
* video: { id: 'id' },
|
|
39
|
+
* });
|
|
31
40
|
* ```
|
|
32
41
|
*/
|
|
33
|
-
handleWebhook(
|
|
34
|
-
const { body } = params;
|
|
42
|
+
handleWebhook(body: ExplainerHandleWebhookParams, options?: RequestOptions): APIPromise<void> {
|
|
35
43
|
return this._client.post('/api/v1/explainers/webhook', {
|
|
36
|
-
body
|
|
44
|
+
body,
|
|
37
45
|
...options,
|
|
38
46
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
39
47
|
});
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
export interface ExplainerCreateParams {
|
|
51
|
+
export interface ExplainerCreateParams {
|
|
52
|
+
/**
|
|
53
|
+
* Component ID
|
|
54
|
+
*/
|
|
55
|
+
componentId: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Folder IDs to include
|
|
59
|
+
*/
|
|
60
|
+
folderIds: Array<string>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Material IDs to include
|
|
64
|
+
*/
|
|
65
|
+
materialIds: Array<string>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Target video length in seconds
|
|
69
|
+
*/
|
|
70
|
+
targetLength: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Title for the explainer video
|
|
74
|
+
*/
|
|
75
|
+
title: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Enable image search for visuals
|
|
79
|
+
*/
|
|
80
|
+
imageSearch?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* AI model to use
|
|
84
|
+
*/
|
|
85
|
+
model?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Video style
|
|
89
|
+
*/
|
|
90
|
+
style?: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* User ID
|
|
94
|
+
*/
|
|
95
|
+
userId?: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Create vertical video format (9:16)
|
|
99
|
+
*/
|
|
100
|
+
verticalVideo?: boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Enable web search for additional content
|
|
104
|
+
*/
|
|
105
|
+
webSearch?: boolean;
|
|
106
|
+
}
|
|
44
107
|
|
|
45
108
|
export interface ExplainerHandleWebhookParams {
|
|
46
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Webhook event type
|
|
111
|
+
*/
|
|
112
|
+
event: 'video.completed' | 'video.progress' | 'video.failed';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Video data
|
|
116
|
+
*/
|
|
117
|
+
video: ExplainerHandleWebhookParams.Video;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export namespace ExplainerHandleWebhookParams {
|
|
121
|
+
/**
|
|
122
|
+
* Video data
|
|
123
|
+
*/
|
|
124
|
+
export interface Video {
|
|
125
|
+
/**
|
|
126
|
+
* Video ID
|
|
127
|
+
*/
|
|
128
|
+
id: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Image sources
|
|
132
|
+
*/
|
|
133
|
+
imageSources?: unknown;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Progress percentage
|
|
137
|
+
*/
|
|
138
|
+
progress?: number;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Video sections
|
|
142
|
+
*/
|
|
143
|
+
sections?: Array<string>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Stream ID
|
|
147
|
+
*/
|
|
148
|
+
streamId?: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Stream URL
|
|
152
|
+
*/
|
|
153
|
+
streamUrl?: string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Thumbnail URL
|
|
157
|
+
*/
|
|
158
|
+
thumbnailUrl?: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Video transcript
|
|
162
|
+
*/
|
|
163
|
+
transcript?: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Video URL
|
|
167
|
+
*/
|
|
168
|
+
videoUrl?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Web search results
|
|
172
|
+
*/
|
|
173
|
+
webSearchResults?: unknown;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Web search sources
|
|
177
|
+
*/
|
|
178
|
+
webSearchSources?: unknown;
|
|
179
|
+
}
|
|
47
180
|
}
|
|
48
181
|
|
|
49
182
|
export declare namespace Explainers {
|
|
@@ -49,7 +49,12 @@ export {
|
|
|
49
49
|
type MaterialGetDownloadURLParams,
|
|
50
50
|
} from './materials/index';
|
|
51
51
|
export { Organizations } from './organizations/index';
|
|
52
|
-
export {
|
|
52
|
+
export {
|
|
53
|
+
Scenarios,
|
|
54
|
+
type ScenarioCreateParams,
|
|
55
|
+
type ScenarioUpdateParams,
|
|
56
|
+
type ScenarioSubmitParams,
|
|
57
|
+
} from './scenarios/index';
|
|
53
58
|
export {
|
|
54
59
|
Tests,
|
|
55
60
|
type TestCreateParams,
|
|
@@ -28,14 +28,14 @@ export class Component extends APIResource {
|
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
30
30
|
* await client.v1.scenarios.component.update('componentId', {
|
|
31
|
-
*
|
|
31
|
+
* body_componentId: 'componentId',
|
|
32
|
+
* name: 'name',
|
|
32
33
|
* });
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
|
-
update(componentID: string,
|
|
36
|
-
const { body } = params;
|
|
36
|
+
update(componentID: string, body: ComponentUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
37
37
|
return this._client.put(path`/api/v1/scenarios/component/${componentID}`, {
|
|
38
|
-
body
|
|
38
|
+
body,
|
|
39
39
|
...options,
|
|
40
40
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
41
41
|
});
|
|
@@ -58,7 +58,65 @@ export class Component extends APIResource {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface ComponentUpdateParams {
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Associated component ID
|
|
63
|
+
*/
|
|
64
|
+
body_componentId: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Scenario name
|
|
68
|
+
*/
|
|
69
|
+
name: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Scenario characters
|
|
73
|
+
*/
|
|
74
|
+
characters?: Array<unknown>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Scenario context
|
|
78
|
+
*/
|
|
79
|
+
context?: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Scenario description
|
|
83
|
+
*/
|
|
84
|
+
description?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Prompt for final answer
|
|
88
|
+
*/
|
|
89
|
+
finalAnswerPrompt?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Interaction format
|
|
93
|
+
*/
|
|
94
|
+
format?: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Scenario goal
|
|
98
|
+
*/
|
|
99
|
+
goal?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Character ID for greeting
|
|
103
|
+
*/
|
|
104
|
+
greetingCharacterId?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Greeting message
|
|
108
|
+
*/
|
|
109
|
+
greetingMessage?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Whether scenario requires a final answer
|
|
113
|
+
*/
|
|
114
|
+
requiresFinalAnswer?: boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Available tools
|
|
118
|
+
*/
|
|
119
|
+
tools?: Array<unknown>;
|
|
62
120
|
}
|
|
63
121
|
|
|
64
122
|
export declare namespace Component {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { Component, type ComponentUpdateParams } from './component';
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
Scenarios,
|
|
6
|
+
type ScenarioCreateParams,
|
|
7
|
+
type ScenarioUpdateParams,
|
|
8
|
+
type ScenarioSubmitParams,
|
|
9
|
+
} from './scenarios';
|
|
5
10
|
export { Sessions } from './sessions';
|
|
6
11
|
export { Submissions } from './submissions/index';
|
|
@@ -22,13 +22,15 @@ export class Scenarios extends APIResource {
|
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
|
-
* await client.v1.scenarios.create({
|
|
25
|
+
* await client.v1.scenarios.create({
|
|
26
|
+
* componentId: 'componentId',
|
|
27
|
+
* name: 'name',
|
|
28
|
+
* });
|
|
26
29
|
* ```
|
|
27
30
|
*/
|
|
28
|
-
create(
|
|
29
|
-
const { body } = params;
|
|
31
|
+
create(body: ScenarioCreateParams, options?: RequestOptions): APIPromise<void> {
|
|
30
32
|
return this._client.post('/api/v1/scenarios', {
|
|
31
|
-
body
|
|
33
|
+
body,
|
|
32
34
|
...options,
|
|
33
35
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
34
36
|
});
|
|
@@ -54,13 +56,15 @@ export class Scenarios extends APIResource {
|
|
|
54
56
|
*
|
|
55
57
|
* @example
|
|
56
58
|
* ```ts
|
|
57
|
-
* await client.v1.scenarios.update('id', {
|
|
59
|
+
* await client.v1.scenarios.update('id', {
|
|
60
|
+
* componentId: 'componentId',
|
|
61
|
+
* name: 'name',
|
|
62
|
+
* });
|
|
58
63
|
* ```
|
|
59
64
|
*/
|
|
60
|
-
update(id: string,
|
|
61
|
-
const { body } = params;
|
|
65
|
+
update(id: string, body: ScenarioUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
62
66
|
return this._client.put(path`/api/v1/scenarios/${id}`, {
|
|
63
|
-
body
|
|
67
|
+
body,
|
|
64
68
|
...options,
|
|
65
69
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
66
70
|
});
|
|
@@ -110,13 +114,18 @@ export class Scenarios extends APIResource {
|
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
/**
|
|
117
|
+
* Submit scenario answer
|
|
118
|
+
*
|
|
113
119
|
* @example
|
|
114
120
|
* ```ts
|
|
115
|
-
* await client.v1.scenarios.submit('id'
|
|
121
|
+
* await client.v1.scenarios.submit('id', {
|
|
122
|
+
* conversationHistory: [{}],
|
|
123
|
+
* });
|
|
116
124
|
* ```
|
|
117
125
|
*/
|
|
118
|
-
submit(id: string, options?: RequestOptions): APIPromise<void> {
|
|
126
|
+
submit(id: string, body: ScenarioSubmitParams, options?: RequestOptions): APIPromise<void> {
|
|
119
127
|
return this._client.post(path`/api/v1/scenarios/${id}/submit`, {
|
|
128
|
+
body,
|
|
120
129
|
...options,
|
|
121
130
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
122
131
|
});
|
|
@@ -124,11 +133,139 @@ export class Scenarios extends APIResource {
|
|
|
124
133
|
}
|
|
125
134
|
|
|
126
135
|
export interface ScenarioCreateParams {
|
|
127
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Associated component ID
|
|
138
|
+
*/
|
|
139
|
+
componentId: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Scenario name
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Scenario characters
|
|
148
|
+
*/
|
|
149
|
+
characters?: Array<unknown>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Scenario context
|
|
153
|
+
*/
|
|
154
|
+
context?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Scenario description
|
|
158
|
+
*/
|
|
159
|
+
description?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Prompt for final answer
|
|
163
|
+
*/
|
|
164
|
+
finalAnswerPrompt?: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Interaction format
|
|
168
|
+
*/
|
|
169
|
+
format?: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Scenario goal
|
|
173
|
+
*/
|
|
174
|
+
goal?: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Character ID for greeting
|
|
178
|
+
*/
|
|
179
|
+
greetingCharacterId?: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Greeting message
|
|
183
|
+
*/
|
|
184
|
+
greetingMessage?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Whether scenario requires a final answer
|
|
188
|
+
*/
|
|
189
|
+
requiresFinalAnswer?: boolean;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Available tools
|
|
193
|
+
*/
|
|
194
|
+
tools?: Array<unknown>;
|
|
128
195
|
}
|
|
129
196
|
|
|
130
197
|
export interface ScenarioUpdateParams {
|
|
131
|
-
|
|
198
|
+
/**
|
|
199
|
+
* Associated component ID
|
|
200
|
+
*/
|
|
201
|
+
componentId: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Scenario name
|
|
205
|
+
*/
|
|
206
|
+
name: string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Scenario characters
|
|
210
|
+
*/
|
|
211
|
+
characters?: Array<unknown>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Scenario context
|
|
215
|
+
*/
|
|
216
|
+
context?: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Scenario description
|
|
220
|
+
*/
|
|
221
|
+
description?: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Prompt for final answer
|
|
225
|
+
*/
|
|
226
|
+
finalAnswerPrompt?: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Interaction format
|
|
230
|
+
*/
|
|
231
|
+
format?: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Scenario goal
|
|
235
|
+
*/
|
|
236
|
+
goal?: string;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Character ID for greeting
|
|
240
|
+
*/
|
|
241
|
+
greetingCharacterId?: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Greeting message
|
|
245
|
+
*/
|
|
246
|
+
greetingMessage?: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Whether scenario requires a final answer
|
|
250
|
+
*/
|
|
251
|
+
requiresFinalAnswer?: boolean;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Available tools
|
|
255
|
+
*/
|
|
256
|
+
tools?: Array<unknown>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface ScenarioSubmitParams {
|
|
260
|
+
/**
|
|
261
|
+
* Conversation history
|
|
262
|
+
*/
|
|
263
|
+
conversationHistory: Array<unknown>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Final answer for the scenario
|
|
267
|
+
*/
|
|
268
|
+
finalAnswer?: string;
|
|
132
269
|
}
|
|
133
270
|
|
|
134
271
|
Scenarios.Component = Component;
|
|
@@ -139,6 +276,7 @@ export declare namespace Scenarios {
|
|
|
139
276
|
export {
|
|
140
277
|
type ScenarioCreateParams as ScenarioCreateParams,
|
|
141
278
|
type ScenarioUpdateParams as ScenarioUpdateParams,
|
|
279
|
+
type ScenarioSubmitParams as ScenarioSubmitParams,
|
|
142
280
|
};
|
|
143
281
|
|
|
144
282
|
export { Component as Component, type ComponentUpdateParams as ComponentUpdateParams };
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -59,7 +59,12 @@ import {
|
|
|
59
59
|
import * as OrganizationsAPI from './organizations/organizations';
|
|
60
60
|
import { Organizations } from './organizations/organizations';
|
|
61
61
|
import * as ScenariosAPI from './scenarios/scenarios';
|
|
62
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
ScenarioCreateParams,
|
|
64
|
+
ScenarioSubmitParams,
|
|
65
|
+
ScenarioUpdateParams,
|
|
66
|
+
Scenarios,
|
|
67
|
+
} from './scenarios/scenarios';
|
|
63
68
|
import * as TestsAPI from './tests/tests';
|
|
64
69
|
import {
|
|
65
70
|
TestCreateParams,
|
|
@@ -190,6 +195,7 @@ export declare namespace V1 {
|
|
|
190
195
|
Scenarios as Scenarios,
|
|
191
196
|
type ScenarioCreateParams as ScenarioCreateParams,
|
|
192
197
|
type ScenarioUpdateParams as ScenarioUpdateParams,
|
|
198
|
+
type ScenarioSubmitParams as ScenarioSubmitParams,
|
|
193
199
|
};
|
|
194
200
|
|
|
195
201
|
export {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.11.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.11.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.11.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|