cloudassist-ai-provider 0.0.1

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 (117) hide show
  1. package/CHANGELOG.md +1901 -0
  2. package/README.md +35 -0
  3. package/dist/convert-json-schema-to-openapi-schema.d.ts +6 -0
  4. package/dist/convert-json-schema-to-openapi-schema.d.ts.map +1 -0
  5. package/dist/convert-json-schema-to-openapi-schema.js +108 -0
  6. package/dist/convert-json-schema-to-openapi-schema.test.d.ts +2 -0
  7. package/dist/convert-json-schema-to-openapi-schema.test.d.ts.map +1 -0
  8. package/dist/convert-json-schema-to-openapi-schema.test.js +630 -0
  9. package/dist/convert-to-google-generative-ai-messages.d.ts +7 -0
  10. package/dist/convert-to-google-generative-ai-messages.d.ts.map +1 -0
  11. package/dist/convert-to-google-generative-ai-messages.js +195 -0
  12. package/dist/convert-to-google-generative-ai-messages.test.d.ts +2 -0
  13. package/dist/convert-to-google-generative-ai-messages.test.d.ts.map +1 -0
  14. package/dist/convert-to-google-generative-ai-messages.test.js +456 -0
  15. package/dist/get-model-path.d.ts +2 -0
  16. package/dist/get-model-path.d.ts.map +1 -0
  17. package/dist/get-model-path.js +3 -0
  18. package/dist/get-model-path.test.d.ts +2 -0
  19. package/dist/get-model-path.test.d.ts.map +1 -0
  20. package/dist/get-model-path.test.js +11 -0
  21. package/dist/google-error.d.ts +12 -0
  22. package/dist/google-error.d.ts.map +1 -0
  23. package/dist/google-error.js +13 -0
  24. package/dist/google-generative-ai-embedding-model.d.ts +21 -0
  25. package/dist/google-generative-ai-embedding-model.d.ts.map +1 -0
  26. package/dist/google-generative-ai-embedding-model.js +88 -0
  27. package/dist/google-generative-ai-embedding-model.test.d.ts +2 -0
  28. package/dist/google-generative-ai-embedding-model.test.d.ts.map +1 -0
  29. package/dist/google-generative-ai-embedding-model.test.js +148 -0
  30. package/dist/google-generative-ai-embedding-options.d.ts +8 -0
  31. package/dist/google-generative-ai-embedding-options.d.ts.map +1 -0
  32. package/dist/google-generative-ai-embedding-options.js +33 -0
  33. package/dist/google-generative-ai-image-model.d.ts +31 -0
  34. package/dist/google-generative-ai-image-model.d.ts.map +1 -0
  35. package/dist/google-generative-ai-image-model.js +96 -0
  36. package/dist/google-generative-ai-image-model.test.d.ts +2 -0
  37. package/dist/google-generative-ai-image-model.test.d.ts.map +1 -0
  38. package/dist/google-generative-ai-image-model.test.js +252 -0
  39. package/dist/google-generative-ai-image-settings.d.ts +8 -0
  40. package/dist/google-generative-ai-image-settings.d.ts.map +1 -0
  41. package/dist/google-generative-ai-image-settings.js +1 -0
  42. package/dist/google-generative-ai-language-model.d.ts +183 -0
  43. package/dist/google-generative-ai-language-model.d.ts.map +1 -0
  44. package/dist/google-generative-ai-language-model.js +1001 -0
  45. package/dist/google-generative-ai-language-model.test.d.ts +2 -0
  46. package/dist/google-generative-ai-language-model.test.d.ts.map +1 -0
  47. package/dist/google-generative-ai-language-model.test.js +3463 -0
  48. package/dist/google-generative-ai-options.d.ts +37 -0
  49. package/dist/google-generative-ai-options.d.ts.map +1 -0
  50. package/dist/google-generative-ai-options.js +149 -0
  51. package/dist/google-generative-ai-prompt.d.ts +52 -0
  52. package/dist/google-generative-ai-prompt.d.ts.map +1 -0
  53. package/dist/google-generative-ai-prompt.js +1 -0
  54. package/dist/google-prepare-tools.d.ts +27 -0
  55. package/dist/google-prepare-tools.d.ts.map +1 -0
  56. package/dist/google-prepare-tools.js +219 -0
  57. package/dist/google-prepare-tools.test.d.ts +2 -0
  58. package/dist/google-prepare-tools.test.d.ts.map +1 -0
  59. package/dist/google-prepare-tools.test.js +447 -0
  60. package/dist/google-provider.d.ts +65 -0
  61. package/dist/google-provider.d.ts.map +1 -0
  62. package/dist/google-provider.js +74 -0
  63. package/dist/google-provider.test.d.ts +2 -0
  64. package/dist/google-provider.test.d.ts.map +1 -0
  65. package/dist/google-provider.test.js +234 -0
  66. package/dist/google-supported-file-url.d.ts +2 -0
  67. package/dist/google-supported-file-url.d.ts.map +1 -0
  68. package/dist/google-supported-file-url.js +13 -0
  69. package/dist/google-supported-file-url.test.d.ts +2 -0
  70. package/dist/google-supported-file-url.test.d.ts.map +1 -0
  71. package/dist/google-supported-file-url.test.js +45 -0
  72. package/dist/google-tools.d.ts +76 -0
  73. package/dist/google-tools.d.ts.map +1 -0
  74. package/dist/google-tools.js +65 -0
  75. package/dist/index.d.mts +326 -0
  76. package/dist/index.d.ts +9 -0
  77. package/dist/index.d.ts.map +1 -0
  78. package/dist/index.js +2 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/index.mjs +2172 -0
  81. package/dist/index.mjs.map +1 -0
  82. package/dist/internal/index.d.mts +262 -0
  83. package/dist/internal/index.d.ts +4 -0
  84. package/dist/internal/index.d.ts.map +1 -0
  85. package/dist/internal/index.js +2 -0
  86. package/dist/internal/index.js.map +1 -0
  87. package/dist/internal/index.mjs +1810 -0
  88. package/dist/internal/index.mjs.map +1 -0
  89. package/dist/map-google-generative-ai-finish-reason.d.ts +6 -0
  90. package/dist/map-google-generative-ai-finish-reason.d.ts.map +1 -0
  91. package/dist/map-google-generative-ai-finish-reason.js +22 -0
  92. package/dist/tool/code-execution.d.ts +17 -0
  93. package/dist/tool/code-execution.d.ts.map +1 -0
  94. package/dist/tool/code-execution.js +25 -0
  95. package/dist/tool/enterprise-web-search.d.ts +2 -0
  96. package/dist/tool/enterprise-web-search.d.ts.map +1 -0
  97. package/dist/tool/enterprise-web-search.js +8 -0
  98. package/dist/tool/file-search.d.ts +16 -0
  99. package/dist/tool/file-search.d.ts.map +1 -0
  100. package/dist/tool/file-search.js +33 -0
  101. package/dist/tool/google-maps.d.ts +2 -0
  102. package/dist/tool/google-maps.d.ts.map +1 -0
  103. package/dist/tool/google-maps.js +9 -0
  104. package/dist/tool/google-search.d.ts +14 -0
  105. package/dist/tool/google-search.d.ts.map +1 -0
  106. package/dist/tool/google-search.js +15 -0
  107. package/dist/tool/url-context.d.ts +2 -0
  108. package/dist/tool/url-context.d.ts.map +1 -0
  109. package/dist/tool/url-context.js +7 -0
  110. package/dist/tool/vertex-rag-store.d.ts +16 -0
  111. package/dist/tool/vertex-rag-store.d.ts.map +1 -0
  112. package/dist/tool/vertex-rag-store.js +17 -0
  113. package/dist/version.d.ts +2 -0
  114. package/dist/version.d.ts.map +1 -0
  115. package/dist/version.js +3 -0
  116. package/internal.d.ts +1 -0
  117. package/package.json +73 -0
@@ -0,0 +1,630 @@
1
+ import { convertJSONSchemaToOpenAPISchema } from './convert-json-schema-to-openapi-schema';
2
+ import { it, expect } from 'vitest';
3
+ it('should remove additionalProperties and $schema', () => {
4
+ const input = {
5
+ $schema: 'http://json-schema.org/draft-07/schema#',
6
+ type: 'object',
7
+ properties: {
8
+ name: { type: 'string' },
9
+ age: { type: 'number' },
10
+ },
11
+ additionalProperties: false,
12
+ };
13
+ const expected = {
14
+ type: 'object',
15
+ properties: {
16
+ name: { type: 'string' },
17
+ age: { type: 'number' },
18
+ },
19
+ };
20
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
21
+ });
22
+ it('should remove additionalProperties object from nested object schemas', function () {
23
+ const input = {
24
+ type: 'object',
25
+ properties: {
26
+ keys: {
27
+ type: 'object',
28
+ additionalProperties: { type: 'string' },
29
+ description: 'Description for the key',
30
+ },
31
+ },
32
+ additionalProperties: false,
33
+ $schema: 'http://json-schema.org/draft-07/schema#',
34
+ };
35
+ const expected = {
36
+ type: 'object',
37
+ properties: {
38
+ keys: {
39
+ type: 'object',
40
+ description: 'Description for the key',
41
+ },
42
+ },
43
+ };
44
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
45
+ });
46
+ it('should handle nested objects and arrays', () => {
47
+ const input = {
48
+ type: 'object',
49
+ properties: {
50
+ users: {
51
+ type: 'array',
52
+ items: {
53
+ type: 'object',
54
+ properties: {
55
+ id: { type: 'number' },
56
+ name: { type: 'string' },
57
+ },
58
+ additionalProperties: false,
59
+ },
60
+ },
61
+ },
62
+ additionalProperties: false,
63
+ };
64
+ const expected = {
65
+ type: 'object',
66
+ properties: {
67
+ users: {
68
+ type: 'array',
69
+ items: {
70
+ type: 'object',
71
+ properties: {
72
+ id: { type: 'number' },
73
+ name: { type: 'string' },
74
+ },
75
+ },
76
+ },
77
+ },
78
+ };
79
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
80
+ });
81
+ it('should convert "const" to "enum" with a single value', () => {
82
+ const input = {
83
+ type: 'object',
84
+ properties: {
85
+ status: { const: 'active' },
86
+ },
87
+ };
88
+ const expected = {
89
+ type: 'object',
90
+ properties: {
91
+ status: { enum: ['active'] },
92
+ },
93
+ };
94
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
95
+ });
96
+ it('should handle allOf, anyOf, and oneOf', () => {
97
+ const input = {
98
+ type: 'object',
99
+ properties: {
100
+ allOfProp: { allOf: [{ type: 'string' }, { minLength: 5 }] },
101
+ anyOfProp: { anyOf: [{ type: 'string' }, { type: 'number' }] },
102
+ oneOfProp: { oneOf: [{ type: 'boolean' }, { type: 'null' }] },
103
+ },
104
+ };
105
+ const expected = {
106
+ type: 'object',
107
+ properties: {
108
+ allOfProp: {
109
+ allOf: [{ type: 'string' }, { minLength: 5 }],
110
+ },
111
+ anyOfProp: {
112
+ anyOf: [{ type: 'string' }, { type: 'number' }],
113
+ },
114
+ oneOfProp: {
115
+ oneOf: [{ type: 'boolean' }, { type: 'null' }],
116
+ },
117
+ },
118
+ };
119
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
120
+ });
121
+ it('should convert "format: date-time" to "format: date-time"', () => {
122
+ const input = {
123
+ type: 'object',
124
+ properties: {
125
+ timestamp: { type: 'string', format: 'date-time' },
126
+ },
127
+ };
128
+ const expected = {
129
+ type: 'object',
130
+ properties: {
131
+ timestamp: { type: 'string', format: 'date-time' },
132
+ },
133
+ };
134
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
135
+ });
136
+ it('should handle required properties', () => {
137
+ const input = {
138
+ type: 'object',
139
+ properties: {
140
+ id: { type: 'number' },
141
+ name: { type: 'string' },
142
+ },
143
+ required: ['id'],
144
+ };
145
+ const expected = {
146
+ type: 'object',
147
+ properties: {
148
+ id: { type: 'number' },
149
+ name: { type: 'string' },
150
+ },
151
+ required: ['id'],
152
+ };
153
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
154
+ });
155
+ it('should convert deeply nested "const" to "enum"', () => {
156
+ const input = {
157
+ type: 'object',
158
+ properties: {
159
+ nested: {
160
+ type: 'object',
161
+ properties: {
162
+ deeplyNested: {
163
+ anyOf: [
164
+ {
165
+ type: 'object',
166
+ properties: {
167
+ value: {
168
+ const: 'specific value',
169
+ },
170
+ },
171
+ },
172
+ {
173
+ type: 'string',
174
+ },
175
+ ],
176
+ },
177
+ },
178
+ },
179
+ },
180
+ };
181
+ const expected = {
182
+ type: 'object',
183
+ properties: {
184
+ nested: {
185
+ type: 'object',
186
+ properties: {
187
+ deeplyNested: {
188
+ anyOf: [
189
+ {
190
+ type: 'object',
191
+ properties: {
192
+ value: {
193
+ enum: ['specific value'],
194
+ },
195
+ },
196
+ },
197
+ {
198
+ type: 'string',
199
+ },
200
+ ],
201
+ },
202
+ },
203
+ },
204
+ },
205
+ };
206
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
207
+ });
208
+ it('should correctly convert a complex schema with nested const and anyOf', () => {
209
+ const input = {
210
+ type: 'object',
211
+ properties: {
212
+ name: {
213
+ type: 'string',
214
+ },
215
+ age: {
216
+ type: 'number',
217
+ },
218
+ contact: {
219
+ anyOf: [
220
+ {
221
+ type: 'object',
222
+ properties: {
223
+ type: {
224
+ type: 'string',
225
+ const: 'email',
226
+ },
227
+ value: {
228
+ type: 'string',
229
+ },
230
+ },
231
+ required: ['type', 'value'],
232
+ additionalProperties: false,
233
+ },
234
+ {
235
+ type: 'object',
236
+ properties: {
237
+ type: {
238
+ type: 'string',
239
+ const: 'phone',
240
+ },
241
+ value: {
242
+ type: 'string',
243
+ },
244
+ },
245
+ required: ['type', 'value'],
246
+ additionalProperties: false,
247
+ },
248
+ ],
249
+ },
250
+ occupation: {
251
+ anyOf: [
252
+ {
253
+ type: 'object',
254
+ properties: {
255
+ type: {
256
+ type: 'string',
257
+ const: 'employed',
258
+ },
259
+ company: {
260
+ type: 'string',
261
+ },
262
+ position: {
263
+ type: 'string',
264
+ },
265
+ },
266
+ required: ['type', 'company', 'position'],
267
+ additionalProperties: false,
268
+ },
269
+ {
270
+ type: 'object',
271
+ properties: {
272
+ type: {
273
+ type: 'string',
274
+ const: 'student',
275
+ },
276
+ school: {
277
+ type: 'string',
278
+ },
279
+ grade: {
280
+ type: 'number',
281
+ },
282
+ },
283
+ required: ['type', 'school', 'grade'],
284
+ additionalProperties: false,
285
+ },
286
+ {
287
+ type: 'object',
288
+ properties: {
289
+ type: {
290
+ type: 'string',
291
+ const: 'unemployed',
292
+ },
293
+ },
294
+ required: ['type'],
295
+ additionalProperties: false,
296
+ },
297
+ ],
298
+ },
299
+ },
300
+ required: ['name', 'age', 'contact', 'occupation'],
301
+ additionalProperties: false,
302
+ $schema: 'http://json-schema.org/draft-07/schema#',
303
+ };
304
+ const expected = {
305
+ type: 'object',
306
+ properties: {
307
+ name: {
308
+ type: 'string',
309
+ },
310
+ age: {
311
+ type: 'number',
312
+ },
313
+ contact: {
314
+ anyOf: [
315
+ {
316
+ type: 'object',
317
+ properties: {
318
+ type: {
319
+ type: 'string',
320
+ enum: ['email'],
321
+ },
322
+ value: {
323
+ type: 'string',
324
+ },
325
+ },
326
+ required: ['type', 'value'],
327
+ },
328
+ {
329
+ type: 'object',
330
+ properties: {
331
+ type: {
332
+ type: 'string',
333
+ enum: ['phone'],
334
+ },
335
+ value: {
336
+ type: 'string',
337
+ },
338
+ },
339
+ required: ['type', 'value'],
340
+ },
341
+ ],
342
+ },
343
+ occupation: {
344
+ anyOf: [
345
+ {
346
+ type: 'object',
347
+ properties: {
348
+ type: {
349
+ type: 'string',
350
+ enum: ['employed'],
351
+ },
352
+ company: {
353
+ type: 'string',
354
+ },
355
+ position: {
356
+ type: 'string',
357
+ },
358
+ },
359
+ required: ['type', 'company', 'position'],
360
+ },
361
+ {
362
+ type: 'object',
363
+ properties: {
364
+ type: {
365
+ type: 'string',
366
+ enum: ['student'],
367
+ },
368
+ school: {
369
+ type: 'string',
370
+ },
371
+ grade: {
372
+ type: 'number',
373
+ },
374
+ },
375
+ required: ['type', 'school', 'grade'],
376
+ },
377
+ {
378
+ type: 'object',
379
+ properties: {
380
+ type: {
381
+ type: 'string',
382
+ enum: ['unemployed'],
383
+ },
384
+ },
385
+ required: ['type'],
386
+ },
387
+ ],
388
+ },
389
+ },
390
+ required: ['name', 'age', 'contact', 'occupation'],
391
+ };
392
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
393
+ });
394
+ it('should handle null type correctly', () => {
395
+ const input = {
396
+ type: 'object',
397
+ properties: {
398
+ nullableField: {
399
+ type: ['string', 'null'],
400
+ },
401
+ explicitNullField: {
402
+ type: 'null',
403
+ },
404
+ },
405
+ };
406
+ const expected = {
407
+ type: 'object',
408
+ properties: {
409
+ nullableField: {
410
+ anyOf: [{ type: 'string' }],
411
+ nullable: true,
412
+ },
413
+ explicitNullField: {
414
+ type: 'null',
415
+ },
416
+ },
417
+ };
418
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
419
+ });
420
+ it('should handle descriptions', () => {
421
+ const input = {
422
+ type: 'object',
423
+ description: 'A user object',
424
+ properties: {
425
+ id: {
426
+ type: 'number',
427
+ description: 'The user ID',
428
+ },
429
+ name: {
430
+ type: 'string',
431
+ description: "The user's full name",
432
+ },
433
+ email: {
434
+ type: 'string',
435
+ format: 'email',
436
+ description: "The user's email address",
437
+ },
438
+ },
439
+ required: ['id', 'name'],
440
+ };
441
+ const expected = {
442
+ type: 'object',
443
+ description: 'A user object',
444
+ properties: {
445
+ id: {
446
+ type: 'number',
447
+ description: 'The user ID',
448
+ },
449
+ name: {
450
+ type: 'string',
451
+ description: "The user's full name",
452
+ },
453
+ email: {
454
+ type: 'string',
455
+ format: 'email',
456
+ description: "The user's email address",
457
+ },
458
+ },
459
+ required: ['id', 'name'],
460
+ };
461
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
462
+ });
463
+ it('should return undefined for empty object schemas at root level', () => {
464
+ const emptyObjectSchemas = [
465
+ { type: 'object' },
466
+ { type: 'object', properties: {} },
467
+ ];
468
+ emptyObjectSchemas.forEach(schema => {
469
+ expect(convertJSONSchemaToOpenAPISchema(schema)).toBeUndefined();
470
+ });
471
+ });
472
+ it('should preserve nested empty object schemas to avoid breaking required array validation', () => {
473
+ const input = {
474
+ type: 'object',
475
+ properties: {
476
+ url: { type: 'string', description: 'URL to navigate to' },
477
+ launchOptions: {
478
+ type: 'object',
479
+ description: 'PuppeteerJS LaunchOptions',
480
+ },
481
+ allowDangerous: {
482
+ type: 'boolean',
483
+ description: 'Allow dangerous options',
484
+ },
485
+ },
486
+ required: ['url', 'launchOptions'],
487
+ };
488
+ const expected = {
489
+ type: 'object',
490
+ properties: {
491
+ url: { type: 'string', description: 'URL to navigate to' },
492
+ launchOptions: {
493
+ type: 'object',
494
+ description: 'PuppeteerJS LaunchOptions',
495
+ },
496
+ allowDangerous: {
497
+ type: 'boolean',
498
+ description: 'Allow dangerous options',
499
+ },
500
+ },
501
+ required: ['url', 'launchOptions'],
502
+ };
503
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
504
+ });
505
+ it('should preserve nested empty object schemas without descriptions', () => {
506
+ const input = {
507
+ type: 'object',
508
+ properties: {
509
+ options: { type: 'object' },
510
+ },
511
+ required: ['options'],
512
+ };
513
+ const expected = {
514
+ type: 'object',
515
+ properties: {
516
+ options: { type: 'object' },
517
+ },
518
+ required: ['options'],
519
+ };
520
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
521
+ });
522
+ it('should handle non-empty object schemas', () => {
523
+ const nonEmptySchema = {
524
+ type: 'object',
525
+ properties: {
526
+ name: { type: 'string' },
527
+ },
528
+ };
529
+ expect(convertJSONSchemaToOpenAPISchema(nonEmptySchema)).toEqual({
530
+ type: 'object',
531
+ properties: {
532
+ name: { type: 'string' },
533
+ },
534
+ });
535
+ });
536
+ it('should convert string enum properties', () => {
537
+ const schemaWithEnumProperty = {
538
+ type: 'object',
539
+ properties: {
540
+ kind: {
541
+ type: 'string',
542
+ enum: ['text', 'code', 'image'],
543
+ },
544
+ },
545
+ required: ['kind'],
546
+ additionalProperties: false,
547
+ $schema: 'http://json-schema.org/draft-07/schema#',
548
+ };
549
+ expect(convertJSONSchemaToOpenAPISchema(schemaWithEnumProperty)).toEqual({
550
+ type: 'object',
551
+ properties: {
552
+ kind: {
553
+ type: 'string',
554
+ enum: ['text', 'code', 'image'],
555
+ },
556
+ },
557
+ required: ['kind'],
558
+ });
559
+ });
560
+ it('should convert nullable string enum', () => {
561
+ const schemaWithEnumProperty = {
562
+ type: 'object',
563
+ properties: {
564
+ fieldD: {
565
+ anyOf: [
566
+ {
567
+ type: 'string',
568
+ enum: ['a', 'b', 'c'],
569
+ },
570
+ {
571
+ type: 'null',
572
+ },
573
+ ],
574
+ },
575
+ },
576
+ required: ['fieldD'],
577
+ additionalProperties: false,
578
+ $schema: 'http://json-schema.org/draft-07/schema#',
579
+ };
580
+ expect(convertJSONSchemaToOpenAPISchema(schemaWithEnumProperty)).toEqual({
581
+ required: ['fieldD'],
582
+ type: 'object',
583
+ properties: {
584
+ fieldD: {
585
+ nullable: true,
586
+ type: 'string',
587
+ enum: ['a', 'b', 'c'],
588
+ },
589
+ },
590
+ });
591
+ });
592
+ it('should handle type arrays with multiple non-null types plus null', () => {
593
+ const input = {
594
+ type: 'object',
595
+ properties: {
596
+ multiTypeField: {
597
+ type: ['string', 'number', 'null'],
598
+ },
599
+ },
600
+ };
601
+ const expected = {
602
+ type: 'object',
603
+ properties: {
604
+ multiTypeField: {
605
+ anyOf: [{ type: 'string' }, { type: 'number' }],
606
+ nullable: true,
607
+ },
608
+ },
609
+ };
610
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
611
+ });
612
+ it('should convert type arrays without null to anyOf', () => {
613
+ const input = {
614
+ type: 'object',
615
+ properties: {
616
+ multiTypeField: {
617
+ type: ['string', 'number'],
618
+ },
619
+ },
620
+ };
621
+ const expected = {
622
+ type: 'object',
623
+ properties: {
624
+ multiTypeField: {
625
+ anyOf: [{ type: 'string' }, { type: 'number' }],
626
+ },
627
+ },
628
+ };
629
+ expect(convertJSONSchemaToOpenAPISchema(input)).toEqual(expected);
630
+ });
@@ -0,0 +1,7 @@
1
+ import { LanguageModelV2Prompt } from '@ai-sdk/provider';
2
+ import { GoogleGenerativeAIPrompt } from './google-generative-ai-prompt';
3
+ export declare function convertToGoogleGenerativeAIMessages(prompt: LanguageModelV2Prompt, options?: {
4
+ isGemmaModel?: boolean;
5
+ modelId?: string;
6
+ }): GoogleGenerativeAIPrompt;
7
+ //# sourceMappingURL=convert-to-google-generative-ai-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-to-google-generative-ai-messages.d.ts","sourceRoot":"","sources":["../src/convert-to-google-generative-ai-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAIvC,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,wBAAwB,CAkO1B"}