@perplexity-ai/mcp-server 0.2.2 → 0.13.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.
Files changed (131) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +169 -73
  3. package/compat.d.mts +58 -0
  4. package/compat.d.mts.map +1 -0
  5. package/compat.d.ts +58 -0
  6. package/compat.d.ts.map +1 -0
  7. package/compat.js +387 -0
  8. package/compat.js.map +1 -0
  9. package/compat.mjs +378 -0
  10. package/compat.mjs.map +1 -0
  11. package/dynamic-tools.d.mts +12 -0
  12. package/dynamic-tools.d.mts.map +1 -0
  13. package/dynamic-tools.d.ts +12 -0
  14. package/dynamic-tools.d.ts.map +1 -0
  15. package/dynamic-tools.js +135 -0
  16. package/dynamic-tools.js.map +1 -0
  17. package/dynamic-tools.mjs +132 -0
  18. package/dynamic-tools.mjs.map +1 -0
  19. package/filtering.d.mts +2 -0
  20. package/filtering.d.mts.map +1 -0
  21. package/filtering.d.ts +2 -0
  22. package/filtering.d.ts.map +1 -0
  23. package/filtering.js +20 -0
  24. package/filtering.js.map +1 -0
  25. package/filtering.mjs +13 -0
  26. package/filtering.mjs.map +1 -0
  27. package/headers.d.mts +4 -0
  28. package/headers.d.mts.map +1 -0
  29. package/headers.d.ts +4 -0
  30. package/headers.d.ts.map +1 -0
  31. package/headers.js +22 -0
  32. package/headers.js.map +1 -0
  33. package/headers.mjs +18 -0
  34. package/headers.mjs.map +1 -0
  35. package/http.d.mts +9 -0
  36. package/http.d.mts.map +1 -0
  37. package/http.d.ts +9 -0
  38. package/http.d.ts.map +1 -0
  39. package/http.js +108 -0
  40. package/http.js.map +1 -0
  41. package/http.mjs +100 -0
  42. package/http.mjs.map +1 -0
  43. package/index.d.mts +3 -0
  44. package/index.d.mts.map +1 -0
  45. package/index.d.ts +3 -0
  46. package/index.d.ts.map +1 -0
  47. package/index.js +91 -0
  48. package/index.js.map +1 -0
  49. package/index.mjs +89 -0
  50. package/index.mjs.map +1 -0
  51. package/options.d.mts +18 -0
  52. package/options.d.mts.map +1 -0
  53. package/options.d.ts +18 -0
  54. package/options.d.ts.map +1 -0
  55. package/options.js +415 -0
  56. package/options.js.map +1 -0
  57. package/options.mjs +408 -0
  58. package/options.mjs.map +1 -0
  59. package/package.json +156 -37
  60. package/server.d.mts +35 -0
  61. package/server.d.mts.map +1 -0
  62. package/server.d.ts +35 -0
  63. package/server.d.ts.map +1 -0
  64. package/server.js +166 -0
  65. package/server.js.map +1 -0
  66. package/server.mjs +152 -0
  67. package/server.mjs.map +1 -0
  68. package/src/compat.ts +483 -0
  69. package/src/dynamic-tools.ts +159 -0
  70. package/src/filtering.ts +14 -0
  71. package/src/headers.ts +23 -0
  72. package/src/http.ts +127 -0
  73. package/src/index.ts +108 -0
  74. package/src/options.ts +453 -0
  75. package/src/server.ts +201 -0
  76. package/src/stdio.ts +13 -0
  77. package/src/tools/chat/completions/create-chat-completions.ts +1360 -0
  78. package/src/tools/index.ts +73 -0
  79. package/src/tools/search/create-search.ts +89 -0
  80. package/src/tools/types.ts +103 -0
  81. package/src/tools.ts +1 -0
  82. package/src/tsconfig.json +11 -0
  83. package/stdio.d.mts +3 -0
  84. package/stdio.d.mts.map +1 -0
  85. package/stdio.d.ts +3 -0
  86. package/stdio.d.ts.map +1 -0
  87. package/stdio.js +14 -0
  88. package/stdio.js.map +1 -0
  89. package/stdio.mjs +10 -0
  90. package/stdio.mjs.map +1 -0
  91. package/tools/chat/completions/create-chat-completions.d.mts +45 -0
  92. package/tools/chat/completions/create-chat-completions.d.mts.map +1 -0
  93. package/tools/chat/completions/create-chat-completions.d.ts +45 -0
  94. package/tools/chat/completions/create-chat-completions.d.ts.map +1 -0
  95. package/tools/chat/completions/create-chat-completions.js +1357 -0
  96. package/tools/chat/completions/create-chat-completions.js.map +1 -0
  97. package/tools/chat/completions/create-chat-completions.mjs +1353 -0
  98. package/tools/chat/completions/create-chat-completions.mjs.map +1 -0
  99. package/tools/index.d.mts +10 -0
  100. package/tools/index.d.mts.map +1 -0
  101. package/tools/index.d.ts +10 -0
  102. package/tools/index.d.ts.map +1 -0
  103. package/tools/index.js +57 -0
  104. package/tools/index.js.map +1 -0
  105. package/tools/index.mjs +50 -0
  106. package/tools/index.mjs.map +1 -0
  107. package/tools/search/create-search.d.mts +45 -0
  108. package/tools/search/create-search.d.mts.map +1 -0
  109. package/tools/search/create-search.d.ts +45 -0
  110. package/tools/search/create-search.d.ts.map +1 -0
  111. package/tools/search/create-search.js +86 -0
  112. package/tools/search/create-search.js.map +1 -0
  113. package/tools/search/create-search.mjs +82 -0
  114. package/tools/search/create-search.mjs.map +1 -0
  115. package/tools/types.d.mts +51 -0
  116. package/tools/types.d.mts.map +1 -0
  117. package/tools/types.d.ts +51 -0
  118. package/tools/types.d.ts.map +1 -0
  119. package/tools/types.js +46 -0
  120. package/tools/types.js.map +1 -0
  121. package/tools/types.mjs +42 -0
  122. package/tools/types.mjs.map +1 -0
  123. package/tools.d.mts +2 -0
  124. package/tools.d.mts.map +1 -0
  125. package/tools.d.ts +2 -0
  126. package/tools.d.ts.map +1 -0
  127. package/tools.js +18 -0
  128. package/tools.js.map +1 -0
  129. package/tools.mjs +2 -0
  130. package/tools.mjs.map +1 -0
  131. package/dist/index.js +0 -446
@@ -0,0 +1,1357 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.handler = exports.tool = exports.metadata = void 0;
5
+ const types_1 = require("@perplexity-ai/mcp-server/tools/types");
6
+ exports.metadata = {
7
+ resource: 'chat.completions',
8
+ operation: 'write',
9
+ tags: [],
10
+ httpMethod: 'post',
11
+ httpPath: '/chat/completions',
12
+ operationId: 'chat_completions_chat_completions_post',
13
+ };
14
+ exports.tool = {
15
+ name: 'create_chat_completions',
16
+ description: 'Generate a chat completion response for the given conversation.',
17
+ inputSchema: {
18
+ type: 'object',
19
+ anyOf: [
20
+ {
21
+ type: 'object',
22
+ properties: {
23
+ messages: {
24
+ type: 'array',
25
+ title: 'Messages',
26
+ items: {
27
+ $ref: '#/$defs/chat_message_input',
28
+ },
29
+ },
30
+ model: {
31
+ type: 'string',
32
+ title: 'Model',
33
+ },
34
+ _debug_pro_search: {
35
+ type: 'boolean',
36
+ title: 'Debug Pro Search',
37
+ },
38
+ _inputs: {
39
+ type: 'array',
40
+ title: 'Inputs',
41
+ items: {
42
+ type: 'integer',
43
+ },
44
+ },
45
+ _is_browser_agent: {
46
+ type: 'boolean',
47
+ title: 'Is Browser Agent',
48
+ },
49
+ _prompt_token_length: {
50
+ type: 'integer',
51
+ title: 'Prompt Token Length',
52
+ },
53
+ best_of: {
54
+ type: 'integer',
55
+ title: 'Best Of',
56
+ },
57
+ country: {
58
+ type: 'string',
59
+ title: 'Country',
60
+ },
61
+ cum_logprobs: {
62
+ type: 'boolean',
63
+ title: 'Cum Logprobs',
64
+ },
65
+ debug_params: {
66
+ type: 'object',
67
+ title: 'DebugParams',
68
+ properties: {
69
+ summarizer_model_override: {
70
+ type: 'string',
71
+ title: 'Summarizer Model Override',
72
+ },
73
+ summarizer_prompt_override: {
74
+ type: 'string',
75
+ title: 'Summarizer Prompt Override',
76
+ },
77
+ },
78
+ },
79
+ disable_search: {
80
+ type: 'boolean',
81
+ title: 'Disable Search',
82
+ },
83
+ diverse_first_token: {
84
+ type: 'boolean',
85
+ title: 'Diverse First Token',
86
+ },
87
+ enable_search_classifier: {
88
+ type: 'boolean',
89
+ title: 'Enable Search Classifier',
90
+ },
91
+ file_workspace_id: {
92
+ type: 'string',
93
+ title: 'File Workspace Id',
94
+ },
95
+ frequency_penalty: {
96
+ type: 'number',
97
+ title: 'Frequency Penalty',
98
+ },
99
+ has_image_url: {
100
+ type: 'boolean',
101
+ title: 'Has Image Url',
102
+ },
103
+ image_domain_filter: {
104
+ type: 'array',
105
+ title: 'Image Domain Filter',
106
+ items: {
107
+ type: 'string',
108
+ },
109
+ },
110
+ image_format_filter: {
111
+ type: 'array',
112
+ title: 'Image Format Filter',
113
+ items: {
114
+ type: 'string',
115
+ },
116
+ },
117
+ language_preference: {
118
+ type: 'string',
119
+ title: 'Language Preference',
120
+ },
121
+ last_updated_after_filter: {
122
+ type: 'string',
123
+ title: 'Last Updated After Filter',
124
+ },
125
+ last_updated_before_filter: {
126
+ type: 'string',
127
+ title: 'Last Updated Before Filter',
128
+ },
129
+ latitude: {
130
+ type: 'number',
131
+ title: 'Latitude',
132
+ },
133
+ logprobs: {
134
+ type: 'boolean',
135
+ title: 'Logprobs',
136
+ },
137
+ longitude: {
138
+ type: 'number',
139
+ title: 'Longitude',
140
+ },
141
+ max_tokens: {
142
+ type: 'integer',
143
+ title: 'Max Tokens',
144
+ },
145
+ n: {
146
+ type: 'integer',
147
+ title: 'N',
148
+ },
149
+ num_images: {
150
+ type: 'integer',
151
+ title: 'Num Images',
152
+ },
153
+ num_search_results: {
154
+ type: 'integer',
155
+ title: 'Num Search Results',
156
+ },
157
+ parallel_tool_calls: {
158
+ type: 'boolean',
159
+ title: 'Parallel Tool Calls',
160
+ },
161
+ presence_penalty: {
162
+ type: 'number',
163
+ title: 'Presence Penalty',
164
+ },
165
+ ranking_model: {
166
+ type: 'string',
167
+ title: 'Ranking Model',
168
+ },
169
+ reasoning_effort: {
170
+ type: 'string',
171
+ title: 'Reasoning Effort',
172
+ enum: ['minimal', 'low', 'medium', 'high'],
173
+ },
174
+ response_format: {
175
+ anyOf: [
176
+ {
177
+ type: 'object',
178
+ title: 'ResponseFormatText',
179
+ properties: {
180
+ type: {
181
+ type: 'string',
182
+ title: 'Type',
183
+ enum: ['text'],
184
+ },
185
+ },
186
+ required: ['type'],
187
+ },
188
+ {
189
+ type: 'object',
190
+ title: 'ResponseFormatJSONSchema',
191
+ properties: {
192
+ json_schema: {
193
+ type: 'object',
194
+ title: 'JSONSchema',
195
+ properties: {
196
+ schema: {
197
+ type: 'object',
198
+ title: 'Schema',
199
+ additionalProperties: true,
200
+ },
201
+ description: {
202
+ type: 'string',
203
+ title: 'Description',
204
+ },
205
+ name: {
206
+ type: 'string',
207
+ title: 'Name',
208
+ },
209
+ strict: {
210
+ type: 'boolean',
211
+ title: 'Strict',
212
+ },
213
+ },
214
+ required: ['schema'],
215
+ },
216
+ type: {
217
+ type: 'string',
218
+ title: 'Type',
219
+ enum: ['json_schema'],
220
+ },
221
+ },
222
+ required: ['json_schema', 'type'],
223
+ },
224
+ {
225
+ type: 'object',
226
+ title: 'ResponseFormatRegex',
227
+ properties: {
228
+ regex: {
229
+ type: 'object',
230
+ title: 'RegexSchema',
231
+ properties: {
232
+ regex: {
233
+ type: 'string',
234
+ title: 'Regex',
235
+ },
236
+ description: {
237
+ type: 'string',
238
+ title: 'Description',
239
+ },
240
+ name: {
241
+ type: 'string',
242
+ title: 'Name',
243
+ },
244
+ strict: {
245
+ type: 'boolean',
246
+ title: 'Strict',
247
+ },
248
+ },
249
+ required: ['regex'],
250
+ },
251
+ type: {
252
+ type: 'string',
253
+ title: 'Type',
254
+ enum: ['regex'],
255
+ },
256
+ },
257
+ required: ['regex', 'type'],
258
+ },
259
+ ],
260
+ title: 'Response Format',
261
+ },
262
+ response_metadata: {
263
+ type: 'object',
264
+ title: 'Response Metadata',
265
+ additionalProperties: true,
266
+ },
267
+ return_images: {
268
+ type: 'boolean',
269
+ title: 'Return Images',
270
+ },
271
+ return_related_questions: {
272
+ type: 'boolean',
273
+ title: 'Return Related Questions',
274
+ },
275
+ safe_search: {
276
+ type: 'boolean',
277
+ title: 'Safe Search',
278
+ },
279
+ search_after_date_filter: {
280
+ type: 'string',
281
+ title: 'Search After Date Filter',
282
+ },
283
+ search_before_date_filter: {
284
+ type: 'string',
285
+ title: 'Search Before Date Filter',
286
+ },
287
+ search_domain_filter: {
288
+ type: 'array',
289
+ title: 'Search Domain Filter',
290
+ items: {
291
+ type: 'string',
292
+ },
293
+ },
294
+ search_internal_properties: {
295
+ type: 'object',
296
+ title: 'Search Internal Properties',
297
+ additionalProperties: true,
298
+ },
299
+ search_mode: {
300
+ type: 'string',
301
+ title: 'Search Mode',
302
+ enum: ['web', 'academic', 'sec'],
303
+ },
304
+ search_recency_filter: {
305
+ type: 'string',
306
+ title: 'Search Recency Filter',
307
+ enum: ['hour', 'day', 'week', 'month', 'year'],
308
+ },
309
+ search_tenant: {
310
+ type: 'string',
311
+ title: 'Search Tenant',
312
+ },
313
+ stop: {
314
+ anyOf: [
315
+ {
316
+ type: 'string',
317
+ },
318
+ {
319
+ type: 'array',
320
+ items: {
321
+ type: 'string',
322
+ },
323
+ },
324
+ ],
325
+ title: 'Stop',
326
+ },
327
+ stream: {
328
+ type: 'string',
329
+ title: 'Stream',
330
+ enum: [false],
331
+ },
332
+ stream_mode: {
333
+ type: 'string',
334
+ title: 'Stream Mode',
335
+ enum: ['full', 'concise'],
336
+ },
337
+ temperature: {
338
+ type: 'number',
339
+ title: 'Temperature',
340
+ },
341
+ thread_id: {
342
+ type: 'string',
343
+ title: 'Thread Id',
344
+ },
345
+ tool_choice: {
346
+ type: 'string',
347
+ title: 'Tool Choice',
348
+ enum: ['none', 'auto', 'required'],
349
+ },
350
+ tools: {
351
+ type: 'array',
352
+ title: 'Tools',
353
+ items: {
354
+ type: 'object',
355
+ title: 'ToolSpec',
356
+ properties: {
357
+ function: {
358
+ type: 'object',
359
+ title: 'FunctionSpec',
360
+ properties: {
361
+ description: {
362
+ type: 'string',
363
+ title: 'Description',
364
+ },
365
+ name: {
366
+ type: 'string',
367
+ title: 'Name',
368
+ },
369
+ parameters: {
370
+ type: 'object',
371
+ title: 'ParameterSpec',
372
+ properties: {
373
+ properties: {
374
+ type: 'object',
375
+ title: 'Properties',
376
+ additionalProperties: true,
377
+ },
378
+ type: {
379
+ type: 'string',
380
+ title: 'Type',
381
+ },
382
+ additional_properties: {
383
+ type: 'boolean',
384
+ title: 'Additional Properties',
385
+ },
386
+ required: {
387
+ type: 'array',
388
+ title: 'Required',
389
+ items: {
390
+ type: 'string',
391
+ },
392
+ },
393
+ },
394
+ required: ['properties', 'type'],
395
+ },
396
+ strict: {
397
+ type: 'boolean',
398
+ title: 'Strict',
399
+ },
400
+ },
401
+ required: ['description', 'name', 'parameters'],
402
+ },
403
+ type: {
404
+ type: 'string',
405
+ title: 'Type',
406
+ enum: ['function'],
407
+ },
408
+ },
409
+ required: ['function', 'type'],
410
+ },
411
+ },
412
+ top_k: {
413
+ type: 'integer',
414
+ title: 'Top K',
415
+ },
416
+ top_logprobs: {
417
+ type: 'integer',
418
+ title: 'Top Logprobs',
419
+ },
420
+ top_p: {
421
+ type: 'number',
422
+ title: 'Top P',
423
+ },
424
+ updated_after_timestamp: {
425
+ type: 'integer',
426
+ title: 'Updated After Timestamp',
427
+ },
428
+ updated_before_timestamp: {
429
+ type: 'integer',
430
+ title: 'Updated Before Timestamp',
431
+ },
432
+ use_threads: {
433
+ type: 'boolean',
434
+ title: 'Use Threads',
435
+ },
436
+ web_search_options: {
437
+ type: 'object',
438
+ title: 'WebSearchOptions',
439
+ properties: {
440
+ image_results_enhanced_relevance: {
441
+ type: 'boolean',
442
+ title: 'Image Results Enhanced Relevance',
443
+ },
444
+ search_context_size: {
445
+ type: 'string',
446
+ title: 'Search Context Size',
447
+ enum: ['low', 'medium', 'high'],
448
+ },
449
+ search_type: {
450
+ type: 'string',
451
+ title: 'Search Type',
452
+ enum: ['fast', 'pro', 'auto'],
453
+ },
454
+ user_location: {
455
+ type: 'object',
456
+ title: 'UserLocation',
457
+ properties: {
458
+ city: {
459
+ type: 'string',
460
+ title: 'City',
461
+ },
462
+ country: {
463
+ type: 'string',
464
+ title: 'Country',
465
+ },
466
+ latitude: {
467
+ type: 'number',
468
+ title: 'Latitude',
469
+ },
470
+ longitude: {
471
+ type: 'number',
472
+ title: 'Longitude',
473
+ },
474
+ region: {
475
+ type: 'string',
476
+ title: 'Region',
477
+ },
478
+ },
479
+ },
480
+ },
481
+ },
482
+ },
483
+ required: ['messages', 'model'],
484
+ },
485
+ {
486
+ type: 'object',
487
+ properties: {
488
+ messages: {
489
+ type: 'array',
490
+ title: 'Messages',
491
+ items: {
492
+ $ref: '#/$defs/chat_message_input',
493
+ },
494
+ },
495
+ model: {
496
+ type: 'string',
497
+ title: 'Model',
498
+ },
499
+ stream: {
500
+ type: 'string',
501
+ title: 'Stream',
502
+ enum: [true],
503
+ },
504
+ _debug_pro_search: {
505
+ type: 'boolean',
506
+ title: 'Debug Pro Search',
507
+ },
508
+ _inputs: {
509
+ type: 'array',
510
+ title: 'Inputs',
511
+ items: {
512
+ type: 'integer',
513
+ },
514
+ },
515
+ _is_browser_agent: {
516
+ type: 'boolean',
517
+ title: 'Is Browser Agent',
518
+ },
519
+ _prompt_token_length: {
520
+ type: 'integer',
521
+ title: 'Prompt Token Length',
522
+ },
523
+ best_of: {
524
+ type: 'integer',
525
+ title: 'Best Of',
526
+ },
527
+ country: {
528
+ type: 'string',
529
+ title: 'Country',
530
+ },
531
+ cum_logprobs: {
532
+ type: 'boolean',
533
+ title: 'Cum Logprobs',
534
+ },
535
+ debug_params: {
536
+ type: 'object',
537
+ title: 'DebugParams',
538
+ properties: {
539
+ summarizer_model_override: {
540
+ type: 'string',
541
+ title: 'Summarizer Model Override',
542
+ },
543
+ summarizer_prompt_override: {
544
+ type: 'string',
545
+ title: 'Summarizer Prompt Override',
546
+ },
547
+ },
548
+ },
549
+ disable_search: {
550
+ type: 'boolean',
551
+ title: 'Disable Search',
552
+ },
553
+ diverse_first_token: {
554
+ type: 'boolean',
555
+ title: 'Diverse First Token',
556
+ },
557
+ enable_search_classifier: {
558
+ type: 'boolean',
559
+ title: 'Enable Search Classifier',
560
+ },
561
+ file_workspace_id: {
562
+ type: 'string',
563
+ title: 'File Workspace Id',
564
+ },
565
+ frequency_penalty: {
566
+ type: 'number',
567
+ title: 'Frequency Penalty',
568
+ },
569
+ has_image_url: {
570
+ type: 'boolean',
571
+ title: 'Has Image Url',
572
+ },
573
+ image_domain_filter: {
574
+ type: 'array',
575
+ title: 'Image Domain Filter',
576
+ items: {
577
+ type: 'string',
578
+ },
579
+ },
580
+ image_format_filter: {
581
+ type: 'array',
582
+ title: 'Image Format Filter',
583
+ items: {
584
+ type: 'string',
585
+ },
586
+ },
587
+ language_preference: {
588
+ type: 'string',
589
+ title: 'Language Preference',
590
+ },
591
+ last_updated_after_filter: {
592
+ type: 'string',
593
+ title: 'Last Updated After Filter',
594
+ },
595
+ last_updated_before_filter: {
596
+ type: 'string',
597
+ title: 'Last Updated Before Filter',
598
+ },
599
+ latitude: {
600
+ type: 'number',
601
+ title: 'Latitude',
602
+ },
603
+ logprobs: {
604
+ type: 'boolean',
605
+ title: 'Logprobs',
606
+ },
607
+ longitude: {
608
+ type: 'number',
609
+ title: 'Longitude',
610
+ },
611
+ max_tokens: {
612
+ type: 'integer',
613
+ title: 'Max Tokens',
614
+ },
615
+ n: {
616
+ type: 'integer',
617
+ title: 'N',
618
+ },
619
+ num_images: {
620
+ type: 'integer',
621
+ title: 'Num Images',
622
+ },
623
+ num_search_results: {
624
+ type: 'integer',
625
+ title: 'Num Search Results',
626
+ },
627
+ parallel_tool_calls: {
628
+ type: 'boolean',
629
+ title: 'Parallel Tool Calls',
630
+ },
631
+ presence_penalty: {
632
+ type: 'number',
633
+ title: 'Presence Penalty',
634
+ },
635
+ ranking_model: {
636
+ type: 'string',
637
+ title: 'Ranking Model',
638
+ },
639
+ reasoning_effort: {
640
+ type: 'string',
641
+ title: 'Reasoning Effort',
642
+ enum: ['minimal', 'low', 'medium', 'high'],
643
+ },
644
+ response_format: {
645
+ anyOf: [
646
+ {
647
+ type: 'object',
648
+ title: 'ResponseFormatText',
649
+ properties: {
650
+ type: {
651
+ type: 'string',
652
+ title: 'Type',
653
+ enum: ['text'],
654
+ },
655
+ },
656
+ required: ['type'],
657
+ },
658
+ {
659
+ type: 'object',
660
+ title: 'ResponseFormatJSONSchema',
661
+ properties: {
662
+ json_schema: {
663
+ type: 'object',
664
+ title: 'JSONSchema',
665
+ properties: {
666
+ schema: {
667
+ type: 'object',
668
+ title: 'Schema',
669
+ additionalProperties: true,
670
+ },
671
+ description: {
672
+ type: 'string',
673
+ title: 'Description',
674
+ },
675
+ name: {
676
+ type: 'string',
677
+ title: 'Name',
678
+ },
679
+ strict: {
680
+ type: 'boolean',
681
+ title: 'Strict',
682
+ },
683
+ },
684
+ required: ['schema'],
685
+ },
686
+ type: {
687
+ type: 'string',
688
+ title: 'Type',
689
+ enum: ['json_schema'],
690
+ },
691
+ },
692
+ required: ['json_schema', 'type'],
693
+ },
694
+ {
695
+ type: 'object',
696
+ title: 'ResponseFormatRegex',
697
+ properties: {
698
+ regex: {
699
+ type: 'object',
700
+ title: 'RegexSchema',
701
+ properties: {
702
+ regex: {
703
+ type: 'string',
704
+ title: 'Regex',
705
+ },
706
+ description: {
707
+ type: 'string',
708
+ title: 'Description',
709
+ },
710
+ name: {
711
+ type: 'string',
712
+ title: 'Name',
713
+ },
714
+ strict: {
715
+ type: 'boolean',
716
+ title: 'Strict',
717
+ },
718
+ },
719
+ required: ['regex'],
720
+ },
721
+ type: {
722
+ type: 'string',
723
+ title: 'Type',
724
+ enum: ['regex'],
725
+ },
726
+ },
727
+ required: ['regex', 'type'],
728
+ },
729
+ ],
730
+ title: 'Response Format',
731
+ },
732
+ response_metadata: {
733
+ type: 'object',
734
+ title: 'Response Metadata',
735
+ additionalProperties: true,
736
+ },
737
+ return_images: {
738
+ type: 'boolean',
739
+ title: 'Return Images',
740
+ },
741
+ return_related_questions: {
742
+ type: 'boolean',
743
+ title: 'Return Related Questions',
744
+ },
745
+ safe_search: {
746
+ type: 'boolean',
747
+ title: 'Safe Search',
748
+ },
749
+ search_after_date_filter: {
750
+ type: 'string',
751
+ title: 'Search After Date Filter',
752
+ },
753
+ search_before_date_filter: {
754
+ type: 'string',
755
+ title: 'Search Before Date Filter',
756
+ },
757
+ search_domain_filter: {
758
+ type: 'array',
759
+ title: 'Search Domain Filter',
760
+ items: {
761
+ type: 'string',
762
+ },
763
+ },
764
+ search_internal_properties: {
765
+ type: 'object',
766
+ title: 'Search Internal Properties',
767
+ additionalProperties: true,
768
+ },
769
+ search_mode: {
770
+ type: 'string',
771
+ title: 'Search Mode',
772
+ enum: ['web', 'academic', 'sec'],
773
+ },
774
+ search_recency_filter: {
775
+ type: 'string',
776
+ title: 'Search Recency Filter',
777
+ enum: ['hour', 'day', 'week', 'month', 'year'],
778
+ },
779
+ search_tenant: {
780
+ type: 'string',
781
+ title: 'Search Tenant',
782
+ },
783
+ stop: {
784
+ anyOf: [
785
+ {
786
+ type: 'string',
787
+ },
788
+ {
789
+ type: 'array',
790
+ items: {
791
+ type: 'string',
792
+ },
793
+ },
794
+ ],
795
+ title: 'Stop',
796
+ },
797
+ stream_mode: {
798
+ type: 'string',
799
+ title: 'Stream Mode',
800
+ enum: ['full', 'concise'],
801
+ },
802
+ temperature: {
803
+ type: 'number',
804
+ title: 'Temperature',
805
+ },
806
+ thread_id: {
807
+ type: 'string',
808
+ title: 'Thread Id',
809
+ },
810
+ tool_choice: {
811
+ type: 'string',
812
+ title: 'Tool Choice',
813
+ enum: ['none', 'auto', 'required'],
814
+ },
815
+ tools: {
816
+ type: 'array',
817
+ title: 'Tools',
818
+ items: {
819
+ type: 'object',
820
+ title: 'ToolSpec',
821
+ properties: {
822
+ function: {
823
+ type: 'object',
824
+ title: 'FunctionSpec',
825
+ properties: {
826
+ description: {
827
+ type: 'string',
828
+ title: 'Description',
829
+ },
830
+ name: {
831
+ type: 'string',
832
+ title: 'Name',
833
+ },
834
+ parameters: {
835
+ type: 'object',
836
+ title: 'ParameterSpec',
837
+ properties: {
838
+ properties: {
839
+ type: 'object',
840
+ title: 'Properties',
841
+ additionalProperties: true,
842
+ },
843
+ type: {
844
+ type: 'string',
845
+ title: 'Type',
846
+ },
847
+ additional_properties: {
848
+ type: 'boolean',
849
+ title: 'Additional Properties',
850
+ },
851
+ required: {
852
+ type: 'array',
853
+ title: 'Required',
854
+ items: {
855
+ type: 'string',
856
+ },
857
+ },
858
+ },
859
+ required: ['properties', 'type'],
860
+ },
861
+ strict: {
862
+ type: 'boolean',
863
+ title: 'Strict',
864
+ },
865
+ },
866
+ required: ['description', 'name', 'parameters'],
867
+ },
868
+ type: {
869
+ type: 'string',
870
+ title: 'Type',
871
+ enum: ['function'],
872
+ },
873
+ },
874
+ required: ['function', 'type'],
875
+ },
876
+ },
877
+ top_k: {
878
+ type: 'integer',
879
+ title: 'Top K',
880
+ },
881
+ top_logprobs: {
882
+ type: 'integer',
883
+ title: 'Top Logprobs',
884
+ },
885
+ top_p: {
886
+ type: 'number',
887
+ title: 'Top P',
888
+ },
889
+ updated_after_timestamp: {
890
+ type: 'integer',
891
+ title: 'Updated After Timestamp',
892
+ },
893
+ updated_before_timestamp: {
894
+ type: 'integer',
895
+ title: 'Updated Before Timestamp',
896
+ },
897
+ use_threads: {
898
+ type: 'boolean',
899
+ title: 'Use Threads',
900
+ },
901
+ web_search_options: {
902
+ type: 'object',
903
+ title: 'WebSearchOptions',
904
+ properties: {
905
+ image_results_enhanced_relevance: {
906
+ type: 'boolean',
907
+ title: 'Image Results Enhanced Relevance',
908
+ },
909
+ search_context_size: {
910
+ type: 'string',
911
+ title: 'Search Context Size',
912
+ enum: ['low', 'medium', 'high'],
913
+ },
914
+ search_type: {
915
+ type: 'string',
916
+ title: 'Search Type',
917
+ enum: ['fast', 'pro', 'auto'],
918
+ },
919
+ user_location: {
920
+ type: 'object',
921
+ title: 'UserLocation',
922
+ properties: {
923
+ city: {
924
+ type: 'string',
925
+ title: 'City',
926
+ },
927
+ country: {
928
+ type: 'string',
929
+ title: 'Country',
930
+ },
931
+ latitude: {
932
+ type: 'number',
933
+ title: 'Latitude',
934
+ },
935
+ longitude: {
936
+ type: 'number',
937
+ title: 'Longitude',
938
+ },
939
+ region: {
940
+ type: 'string',
941
+ title: 'Region',
942
+ },
943
+ },
944
+ },
945
+ },
946
+ },
947
+ },
948
+ required: ['messages', 'model', 'stream'],
949
+ },
950
+ ],
951
+ $defs: {
952
+ chat_message_input: {
953
+ type: 'object',
954
+ title: 'ChatMessage',
955
+ properties: {
956
+ content: {
957
+ anyOf: [
958
+ {
959
+ type: 'string',
960
+ },
961
+ {
962
+ type: 'array',
963
+ title: 'Structured Content',
964
+ items: {
965
+ anyOf: [
966
+ {
967
+ type: 'object',
968
+ title: 'ChatMessageContentTextChunk',
969
+ properties: {
970
+ text: {
971
+ type: 'string',
972
+ title: 'Text',
973
+ },
974
+ type: {
975
+ type: 'string',
976
+ title: 'Type',
977
+ enum: ['text'],
978
+ },
979
+ },
980
+ required: ['text', 'type'],
981
+ },
982
+ {
983
+ type: 'object',
984
+ title: 'ChatMessageContentImageChunk',
985
+ properties: {
986
+ image_url: {
987
+ anyOf: [
988
+ {
989
+ type: 'object',
990
+ title: 'URL',
991
+ properties: {
992
+ url: {
993
+ type: 'string',
994
+ title: 'Url',
995
+ },
996
+ },
997
+ required: ['url'],
998
+ },
999
+ {
1000
+ type: 'string',
1001
+ },
1002
+ ],
1003
+ title: 'Image Url',
1004
+ },
1005
+ type: {
1006
+ type: 'string',
1007
+ title: 'Type',
1008
+ enum: ['image_url'],
1009
+ },
1010
+ },
1011
+ required: ['image_url', 'type'],
1012
+ },
1013
+ {
1014
+ type: 'object',
1015
+ title: 'ChatMessageContentFileChunk',
1016
+ properties: {
1017
+ file_url: {
1018
+ anyOf: [
1019
+ {
1020
+ type: 'object',
1021
+ title: 'URL',
1022
+ properties: {
1023
+ url: {
1024
+ type: 'string',
1025
+ title: 'Url',
1026
+ },
1027
+ },
1028
+ required: ['url'],
1029
+ },
1030
+ {
1031
+ type: 'string',
1032
+ },
1033
+ ],
1034
+ title: 'File Url',
1035
+ },
1036
+ type: {
1037
+ type: 'string',
1038
+ title: 'Type',
1039
+ enum: ['file_url'],
1040
+ },
1041
+ file_name: {
1042
+ type: 'string',
1043
+ title: 'File Name',
1044
+ },
1045
+ },
1046
+ required: ['file_url', 'type'],
1047
+ },
1048
+ {
1049
+ type: 'object',
1050
+ title: 'ChatMessageContentPDFChunk',
1051
+ properties: {
1052
+ pdf_url: {
1053
+ anyOf: [
1054
+ {
1055
+ type: 'object',
1056
+ title: 'URL',
1057
+ properties: {
1058
+ url: {
1059
+ type: 'string',
1060
+ title: 'Url',
1061
+ },
1062
+ },
1063
+ required: ['url'],
1064
+ },
1065
+ {
1066
+ type: 'string',
1067
+ },
1068
+ ],
1069
+ title: 'Pdf Url',
1070
+ },
1071
+ type: {
1072
+ type: 'string',
1073
+ title: 'Type',
1074
+ enum: ['pdf_url'],
1075
+ },
1076
+ },
1077
+ required: ['pdf_url', 'type'],
1078
+ },
1079
+ {
1080
+ type: 'object',
1081
+ title: 'ChatMessageContentVideoChunk',
1082
+ properties: {
1083
+ type: {
1084
+ type: 'string',
1085
+ title: 'Type',
1086
+ enum: ['video_url'],
1087
+ },
1088
+ video_url: {
1089
+ anyOf: [
1090
+ {
1091
+ type: 'object',
1092
+ title: 'VideoURL',
1093
+ properties: {
1094
+ url: {
1095
+ type: 'string',
1096
+ title: 'Url',
1097
+ },
1098
+ frame_interval: {
1099
+ anyOf: [
1100
+ {
1101
+ type: 'string',
1102
+ },
1103
+ {
1104
+ type: 'integer',
1105
+ },
1106
+ ],
1107
+ title: 'Frame Interval',
1108
+ },
1109
+ },
1110
+ required: ['url'],
1111
+ },
1112
+ {
1113
+ type: 'string',
1114
+ },
1115
+ ],
1116
+ title: 'Video Url',
1117
+ },
1118
+ },
1119
+ required: ['type', 'video_url'],
1120
+ },
1121
+ ],
1122
+ },
1123
+ },
1124
+ ],
1125
+ title: 'Content',
1126
+ },
1127
+ role: {
1128
+ type: 'string',
1129
+ title: 'ChatMessageRole',
1130
+ description: 'Chat roles enum',
1131
+ enum: ['system', 'user', 'assistant', 'tool'],
1132
+ },
1133
+ reasoning_steps: {
1134
+ type: 'array',
1135
+ title: 'Reasoning Steps',
1136
+ items: {
1137
+ type: 'object',
1138
+ title: 'ReasoningStep',
1139
+ description: 'Reasoning step wrapper class',
1140
+ properties: {
1141
+ thought: {
1142
+ type: 'string',
1143
+ title: 'Thought',
1144
+ },
1145
+ type: {
1146
+ type: 'string',
1147
+ title: 'Type',
1148
+ enum: [
1149
+ 'web_search',
1150
+ 'fetch_url_content',
1151
+ 'execute_python',
1152
+ 'agent_progress',
1153
+ 'browser_agent',
1154
+ 'browser_tool_execution',
1155
+ 'file_attachment_search',
1156
+ ],
1157
+ },
1158
+ agent_progress: {
1159
+ type: 'object',
1160
+ title: 'AgentProgressStepDetails',
1161
+ description: 'Agent progress class for live-browsing updates',
1162
+ properties: {
1163
+ action: {
1164
+ type: 'string',
1165
+ title: 'Action',
1166
+ },
1167
+ screenshot: {
1168
+ type: 'string',
1169
+ title: 'Screenshot',
1170
+ },
1171
+ url: {
1172
+ type: 'string',
1173
+ title: 'Url',
1174
+ },
1175
+ },
1176
+ required: ['action', 'screenshot', 'url'],
1177
+ },
1178
+ browser_agent: {
1179
+ type: 'object',
1180
+ title: 'BrowserAgentStepDetails',
1181
+ description: 'Browser agent step summary class',
1182
+ properties: {
1183
+ result: {
1184
+ type: 'string',
1185
+ title: 'Result',
1186
+ },
1187
+ url: {
1188
+ type: 'string',
1189
+ title: 'Url',
1190
+ },
1191
+ },
1192
+ required: ['result', 'url'],
1193
+ },
1194
+ browser_tool_execution: {
1195
+ type: 'object',
1196
+ title: 'BrowserToolExecutionDetails',
1197
+ description: 'Tool input for kicking off browser tool automation',
1198
+ properties: {
1199
+ tool: {
1200
+ type: 'object',
1201
+ title: 'Tool',
1202
+ additionalProperties: true,
1203
+ },
1204
+ },
1205
+ required: ['tool'],
1206
+ },
1207
+ execute_python: {
1208
+ type: 'object',
1209
+ title: 'ExecutePythonStepDetails',
1210
+ description: 'Code generation step details wrapper class',
1211
+ properties: {
1212
+ code: {
1213
+ type: 'string',
1214
+ title: 'Code',
1215
+ },
1216
+ result: {
1217
+ type: 'string',
1218
+ title: 'Result',
1219
+ },
1220
+ },
1221
+ required: ['code', 'result'],
1222
+ },
1223
+ fetch_url_content: {
1224
+ type: 'object',
1225
+ title: 'FetchUrlContentStepDetails',
1226
+ description: 'Fetch url content step details wrapper class',
1227
+ properties: {
1228
+ contents: {
1229
+ type: 'array',
1230
+ title: 'Contents',
1231
+ items: {
1232
+ $ref: '#/$defs/api_public_search_result',
1233
+ },
1234
+ },
1235
+ },
1236
+ required: ['contents'],
1237
+ },
1238
+ file_attachment_search: {
1239
+ type: 'object',
1240
+ title: 'FileAttachmentSearchStepDetails',
1241
+ description: 'File attachment search step details wrapper class',
1242
+ properties: {
1243
+ attachment_urls: {
1244
+ type: 'array',
1245
+ title: 'Attachment Urls',
1246
+ items: {
1247
+ type: 'string',
1248
+ },
1249
+ },
1250
+ },
1251
+ required: ['attachment_urls'],
1252
+ },
1253
+ web_search: {
1254
+ type: 'object',
1255
+ title: 'WebSearchStepDetails',
1256
+ description: 'Web search step details wrapper class',
1257
+ properties: {
1258
+ search_keywords: {
1259
+ type: 'array',
1260
+ title: 'Search Keywords',
1261
+ items: {
1262
+ type: 'string',
1263
+ },
1264
+ },
1265
+ search_results: {
1266
+ type: 'array',
1267
+ title: 'Search Results',
1268
+ items: {
1269
+ $ref: '#/$defs/api_public_search_result',
1270
+ },
1271
+ },
1272
+ },
1273
+ required: ['search_keywords', 'search_results'],
1274
+ },
1275
+ },
1276
+ required: ['thought', 'type'],
1277
+ },
1278
+ },
1279
+ tool_calls: {
1280
+ type: 'array',
1281
+ title: 'Tool Calls',
1282
+ items: {
1283
+ type: 'object',
1284
+ title: 'ToolCall',
1285
+ properties: {
1286
+ id: {
1287
+ type: 'string',
1288
+ title: 'Id',
1289
+ },
1290
+ function: {
1291
+ type: 'object',
1292
+ title: 'ToolCallFunction',
1293
+ properties: {
1294
+ arguments: {
1295
+ type: 'string',
1296
+ title: 'Arguments',
1297
+ },
1298
+ name: {
1299
+ type: 'string',
1300
+ title: 'Name',
1301
+ },
1302
+ },
1303
+ },
1304
+ type: {
1305
+ type: 'string',
1306
+ title: 'Type',
1307
+ enum: ['function'],
1308
+ },
1309
+ },
1310
+ },
1311
+ },
1312
+ },
1313
+ required: ['content', 'role'],
1314
+ },
1315
+ api_public_search_result: {
1316
+ type: 'object',
1317
+ title: 'ApiPublicSearchResult',
1318
+ properties: {
1319
+ title: {
1320
+ type: 'string',
1321
+ title: 'Title',
1322
+ },
1323
+ url: {
1324
+ type: 'string',
1325
+ title: 'Url',
1326
+ },
1327
+ date: {
1328
+ type: 'string',
1329
+ title: 'Date',
1330
+ },
1331
+ last_updated: {
1332
+ type: 'string',
1333
+ title: 'Last Updated',
1334
+ },
1335
+ snippet: {
1336
+ type: 'string',
1337
+ title: 'Snippet',
1338
+ },
1339
+ source: {
1340
+ type: 'string',
1341
+ title: 'Source',
1342
+ enum: ['web', 'attachment'],
1343
+ },
1344
+ },
1345
+ required: ['title', 'url'],
1346
+ },
1347
+ },
1348
+ },
1349
+ annotations: {},
1350
+ };
1351
+ const handler = async (client, args) => {
1352
+ const body = args;
1353
+ return (0, types_1.asTextContentResult)(await client.chat.completions.create(body));
1354
+ };
1355
+ exports.handler = handler;
1356
+ exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
1357
+ //# sourceMappingURL=create-chat-completions.js.map