@@ -18,6 +18,14 @@ import { serializeAiTextGenItemsTypeField } from '../schemas/aiTextGen.generated
18
18
import { deserializeAiTextGenItemsTypeField } from '../schemas/aiTextGen.generated.js' ;
19
19
import { serializeAiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js' ;
20
20
import { deserializeAiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js' ;
21
+ import { serializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js' ;
22
+ import { deserializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js' ;
23
+ import { serializeGetAiAgentDefaultConfigQueryParamsModeField } from '../managers/ai.generated.js' ;
24
+ import { deserializeGetAiAgentDefaultConfigQueryParamsModeField } from '../managers/ai.generated.js' ;
25
+ import { serializeAiAgentAsk } from '../schemas/aiAgentAsk.generated.js' ;
26
+ import { deserializeAiAgentAsk } from '../schemas/aiAgentAsk.generated.js' ;
27
+ import { serializeAiAgentTextGen } from '../schemas/aiAgentTextGen.generated.js' ;
28
+ import { deserializeAiAgentTextGen } from '../schemas/aiAgentTextGen.generated.js' ;
21
29
import { BoxClient } from '../client.generated.js' ;
22
30
import { FileFull } from '../schemas/fileFull.generated.js' ;
23
31
import { AiResponse } from '../schemas/aiResponse.generated.js' ;
@@ -29,12 +37,17 @@ import { AiTextGen } from '../schemas/aiTextGen.generated.js';
29
37
import { AiTextGenItemsField } from '../schemas/aiTextGen.generated.js' ;
30
38
import { AiTextGenItemsTypeField } from '../schemas/aiTextGen.generated.js' ;
31
39
import { AiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js' ;
40
+ import { AiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js' ;
41
+ import { GetAiAgentDefaultConfigQueryParams } from '../managers/ai.generated.js' ;
42
+ import { GetAiAgentDefaultConfigQueryParamsModeField } from '../managers/ai.generated.js' ;
32
43
import { getDefaultClient } from './commons.generated.js' ;
33
44
import { getUuid } from '../internal/utils.js' ;
34
45
import { generateByteStream } from '../internal/utils.js' ;
35
46
import { dateTimeFromString } from '../internal/utils.js' ;
36
47
import { dateTimeToString } from '../internal/utils.js' ;
37
48
import { uploadNewFile } from './commons.generated.js' ;
49
+ import { AiAgentAsk } from '../schemas/aiAgentAsk.generated.js' ;
50
+ import { AiAgentTextGen } from '../schemas/aiAgentTextGen.generated.js' ;
38
51
import { SerializedData } from '../serialization/json.js' ;
39
52
import { sdIsEmpty } from '../serialization/json.js' ;
40
53
import { sdIsBoolean } from '../serialization/json.js' ;
@@ -125,4 +138,114 @@ test('testAITextGenWithDialogueHistory', async function testAITextGenWithDialogu
125
138
}
126
139
await client . files . deleteFileById ( fileToAsk . id ) ;
127
140
} ) ;
141
+ test ( 'testGettingAIAskAgentConfig' , async function testGettingAIAskAgentConfig ( ) : Promise < any > {
142
+ const aiAskConfig : AiAgentAskOrAiAgentTextGen =
143
+ await client . ai . getAiAgentDefaultConfig ( {
144
+ mode : 'ask' as GetAiAgentDefaultConfigQueryParamsModeField ,
145
+ language : 'ja-JP' ,
146
+ } satisfies GetAiAgentDefaultConfigQueryParams ) ;
147
+ if ( ! ( aiAskConfig . type == 'ai_agent_ask' ) ) {
148
+ throw new Error ( 'Assertion failed' ) ;
149
+ }
150
+ if ( ! ! ( aiAskConfig . basicText ! . model ! == '' ) ) {
151
+ throw new Error ( 'Assertion failed' ) ;
152
+ }
153
+ if ( ! ! ( aiAskConfig . basicText ! . promptTemplate ! == '' ) ) {
154
+ throw new Error ( 'Assertion failed' ) ;
155
+ }
156
+ if ( ! ! ( aiAskConfig . basicText ! . systemMessage ! == '' ) ) {
157
+ throw new Error ( 'Assertion failed' ) ;
158
+ }
159
+ if ( ! ( aiAskConfig . basicText ! . numTokensForCompletion ! > - 1 ) ) {
160
+ throw new Error ( 'Assertion failed' ) ;
161
+ }
162
+ if ( ! ! ( aiAskConfig . basicText ! . llmEndpointParams ! == void 0 ) ) {
163
+ throw new Error ( 'Assertion failed' ) ;
164
+ }
165
+ if ( ! ! ( aiAskConfig . basicTextMulti ! . model ! == '' ) ) {
166
+ throw new Error ( 'Assertion failed' ) ;
167
+ }
168
+ if ( ! ! ( aiAskConfig . basicTextMulti ! . promptTemplate ! == '' ) ) {
169
+ throw new Error ( 'Assertion failed' ) ;
170
+ }
171
+ if ( ! ( aiAskConfig . basicTextMulti ! . numTokensForCompletion ! > - 1 ) ) {
172
+ throw new Error ( 'Assertion failed' ) ;
173
+ }
174
+ if ( ! ! ( aiAskConfig . basicTextMulti ! . llmEndpointParams ! == void 0 ) ) {
175
+ throw new Error ( 'Assertion failed' ) ;
176
+ }
177
+ if ( ! ! ( aiAskConfig . longText ! . model ! == '' ) ) {
178
+ throw new Error ( 'Assertion failed' ) ;
179
+ }
180
+ if ( ! ! ( aiAskConfig . longText ! . promptTemplate ! == '' ) ) {
181
+ throw new Error ( 'Assertion failed' ) ;
182
+ }
183
+ if ( ! ! ( aiAskConfig . longText ! . systemMessage ! == '' ) ) {
184
+ throw new Error ( 'Assertion failed' ) ;
185
+ }
186
+ if ( ! ( aiAskConfig . longText ! . numTokensForCompletion ! > - 1 ) ) {
187
+ throw new Error ( 'Assertion failed' ) ;
188
+ }
189
+ if ( ! ! ( aiAskConfig . longText ! . embeddings ! . model ! == '' ) ) {
190
+ throw new Error ( 'Assertion failed' ) ;
191
+ }
192
+ if ( ! ! ( aiAskConfig . longText ! . embeddings ! . strategy ! . id ! == '' ) ) {
193
+ throw new Error ( 'Assertion failed' ) ;
194
+ }
195
+ if ( ! ! ( aiAskConfig . longText ! . llmEndpointParams ! == void 0 ) ) {
196
+ throw new Error ( 'Assertion failed' ) ;
197
+ }
198
+ if ( ! ! ( aiAskConfig . longTextMulti ! . model ! == '' ) ) {
199
+ throw new Error ( 'Assertion failed' ) ;
200
+ }
201
+ if ( ! ! ( aiAskConfig . longTextMulti ! . promptTemplate ! == '' ) ) {
202
+ throw new Error ( 'Assertion failed' ) ;
203
+ }
204
+ if ( ! ( aiAskConfig . longTextMulti ! . numTokensForCompletion ! > - 1 ) ) {
205
+ throw new Error ( 'Assertion failed' ) ;
206
+ }
207
+ if ( ! ! ( aiAskConfig . longTextMulti ! . embeddings ! . model ! == '' ) ) {
208
+ throw new Error ( 'Assertion failed' ) ;
209
+ }
210
+ if ( ! ! ( aiAskConfig . longTextMulti ! . embeddings ! . strategy ! . id ! == '' ) ) {
211
+ throw new Error ( 'Assertion failed' ) ;
212
+ }
213
+ if ( ! ! ( aiAskConfig . longTextMulti ! . llmEndpointParams ! == void 0 ) ) {
214
+ throw new Error ( 'Assertion failed' ) ;
215
+ }
216
+ } ) ;
217
+ test ( 'testGettingAITextGenAgentConfig' , async function testGettingAITextGenAgentConfig ( ) : Promise < any > {
218
+ const aiTextGenConfig : AiAgentAskOrAiAgentTextGen =
219
+ await client . ai . getAiAgentDefaultConfig ( {
220
+ mode : 'text_gen' as GetAiAgentDefaultConfigQueryParamsModeField ,
221
+ language : 'en-US' ,
222
+ } satisfies GetAiAgentDefaultConfigQueryParams ) ;
223
+ if ( ! ( aiTextGenConfig . type == 'ai_agent_text_gen' ) ) {
224
+ throw new Error ( 'Assertion failed' ) ;
225
+ }
226
+ if ( ! ! ( aiTextGenConfig . basicGen ! . llmEndpointParams ! == void 0 ) ) {
227
+ throw new Error ( 'Assertion failed' ) ;
228
+ }
229
+ if ( ! ! ( aiTextGenConfig . basicGen ! . model ! == '' ) ) {
230
+ throw new Error ( 'Assertion failed' ) ;
231
+ }
232
+ if ( ! ! ( aiTextGenConfig . basicGen ! . promptTemplate ! == '' ) ) {
233
+ throw new Error ( 'Assertion failed' ) ;
234
+ }
235
+ if ( ! ! ( aiTextGenConfig . basicGen ! . systemMessage ! == '' ) ) {
236
+ throw new Error ( 'Assertion failed' ) ;
237
+ }
238
+ if ( ! ( aiTextGenConfig . basicGen ! . numTokensForCompletion ! > - 1 ) ) {
239
+ throw new Error ( 'Assertion failed' ) ;
240
+ }
241
+ if ( ! ! ( aiTextGenConfig . basicGen ! . contentTemplate ! == '' ) ) {
242
+ throw new Error ( 'Assertion failed' ) ;
243
+ }
244
+ if ( ! ! ( aiTextGenConfig . basicGen ! . embeddings ! . model ! == '' ) ) {
245
+ throw new Error ( 'Assertion failed' ) ;
246
+ }
247
+ if ( ! ! ( aiTextGenConfig . basicGen ! . embeddings ! . strategy ! . id ! == '' ) ) {
248
+ throw new Error ( 'Assertion failed' ) ;
249
+ }
250
+ } ) ;
128
251
export { } ;
0 commit comments