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