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