@zenmux/rosetta-ai 0.0.2

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 (54) hide show
  1. package/README.md +399 -0
  2. package/dist/chat-completions/gemini.d.ts +25 -0
  3. package/dist/chat-completions/gemini.d.ts.map +1 -0
  4. package/dist/chat-completions/gemini.js +537 -0
  5. package/dist/chat-completions/gemini.js.map +1 -0
  6. package/dist/chat-completions/messages.d.ts +30 -0
  7. package/dist/chat-completions/messages.d.ts.map +1 -0
  8. package/dist/chat-completions/messages.js +548 -0
  9. package/dist/chat-completions/messages.js.map +1 -0
  10. package/dist/chat-completions/responses.d.ts +33 -0
  11. package/dist/chat-completions/responses.d.ts.map +1 -0
  12. package/dist/chat-completions/responses.js +580 -0
  13. package/dist/chat-completions/responses.js.map +1 -0
  14. package/dist/gemini/chat-completions.d.ts +19 -0
  15. package/dist/gemini/chat-completions.d.ts.map +1 -0
  16. package/dist/gemini/chat-completions.js +417 -0
  17. package/dist/gemini/chat-completions.js.map +1 -0
  18. package/dist/gemini/messages.d.ts +20 -0
  19. package/dist/gemini/messages.d.ts.map +1 -0
  20. package/dist/gemini/messages.js +404 -0
  21. package/dist/gemini/messages.js.map +1 -0
  22. package/dist/gemini/responses.d.ts +20 -0
  23. package/dist/gemini/responses.d.ts.map +1 -0
  24. package/dist/gemini/responses.js +400 -0
  25. package/dist/gemini/responses.js.map +1 -0
  26. package/dist/index.d.ts +12 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +28 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/messages/chat-completions.d.ts +25 -0
  31. package/dist/messages/chat-completions.d.ts.map +1 -0
  32. package/dist/messages/chat-completions.js +598 -0
  33. package/dist/messages/chat-completions.js.map +1 -0
  34. package/dist/messages/gemini.d.ts +22 -0
  35. package/dist/messages/gemini.d.ts.map +1 -0
  36. package/dist/messages/gemini.js +544 -0
  37. package/dist/messages/gemini.js.map +1 -0
  38. package/dist/messages/responses.d.ts +19 -0
  39. package/dist/messages/responses.d.ts.map +1 -0
  40. package/dist/messages/responses.js +503 -0
  41. package/dist/messages/responses.js.map +1 -0
  42. package/dist/responses/chat-completions.d.ts +23 -0
  43. package/dist/responses/chat-completions.d.ts.map +1 -0
  44. package/dist/responses/chat-completions.js +611 -0
  45. package/dist/responses/chat-completions.js.map +1 -0
  46. package/dist/responses/gemini.d.ts +26 -0
  47. package/dist/responses/gemini.d.ts.map +1 -0
  48. package/dist/responses/gemini.js +654 -0
  49. package/dist/responses/gemini.js.map +1 -0
  50. package/dist/responses/messages.d.ts +26 -0
  51. package/dist/responses/messages.d.ts.map +1 -0
  52. package/dist/responses/messages.js +656 -0
  53. package/dist/responses/messages.js.map +1 -0
  54. package/package.json +63 -0
@@ -0,0 +1,656 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponsesToMessagesConverter = void 0;
4
+ const DEFAULT_MAX_TOKENS = 4096;
5
+ class ResponsesToMessagesConverter {
6
+ streamState;
7
+ constructor() {
8
+ this.streamState = this.createStreamState();
9
+ }
10
+ // --- Request conversion (Responses → Messages, forward) ---
11
+ convertRequest(params) {
12
+ const systemBlocks = [];
13
+ const messages = [];
14
+ if (params.instructions) {
15
+ systemBlocks.push(params.instructions);
16
+ }
17
+ this.convertInput(systemBlocks, messages, params.input);
18
+ const result = {
19
+ model: params.model,
20
+ max_tokens: params.max_output_tokens ?? DEFAULT_MAX_TOKENS,
21
+ messages,
22
+ };
23
+ if (systemBlocks.length > 0) {
24
+ result.system = systemBlocks.join("\n");
25
+ }
26
+ if (params.temperature != null) {
27
+ result.temperature = params.temperature;
28
+ }
29
+ if (params.top_p != null) {
30
+ result.top_p = params.top_p;
31
+ }
32
+ if (params.tools) {
33
+ result.tools = this.convertTools(params.tools);
34
+ }
35
+ if (params.tool_choice != null) {
36
+ result.tool_choice = this.convertToolChoice(params.tool_choice, params.parallel_tool_calls);
37
+ }
38
+ if (params.reasoning) {
39
+ result.thinking = this.convertReasoning(params.reasoning);
40
+ }
41
+ if (params.text?.format?.type === "json_schema") {
42
+ const fmt = params.text.format;
43
+ result.output_config = {
44
+ format: {
45
+ type: "json_schema",
46
+ schema: fmt.schema ?? {},
47
+ },
48
+ };
49
+ }
50
+ if (params.metadata) {
51
+ const userId = typeof params.metadata === "object"
52
+ ? params.metadata.user_id
53
+ : undefined;
54
+ if (userId) {
55
+ result.metadata = { user_id: userId };
56
+ }
57
+ }
58
+ if (params.service_tier != null) {
59
+ const tier = params.service_tier;
60
+ if (tier === "auto" || tier === "standard_only") {
61
+ result.service_tier = tier;
62
+ }
63
+ }
64
+ if (params.stream === true) {
65
+ result.stream = true;
66
+ }
67
+ return result;
68
+ }
69
+ // --- Response conversion (Messages → Responses, backward) ---
70
+ convertResponse(message) {
71
+ const output = [];
72
+ for (const block of message.content) {
73
+ if (block.type === "thinking") {
74
+ output.push({
75
+ type: "reasoning",
76
+ id: `rs_${this.generateId()}`,
77
+ summary: [{ type: "summary_text", text: block.thinking }],
78
+ });
79
+ }
80
+ }
81
+ for (const block of message.content) {
82
+ if (block.type === "tool_use" || block.type === "server_tool_use") {
83
+ output.push({
84
+ type: "function_call",
85
+ id: `fc_${this.generateId()}`,
86
+ call_id: block.id,
87
+ name: block.name,
88
+ arguments: JSON.stringify(block.input),
89
+ status: "completed",
90
+ });
91
+ }
92
+ }
93
+ const textParts = [];
94
+ for (const block of message.content) {
95
+ if (block.type === "text") {
96
+ textParts.push(block.text);
97
+ }
98
+ }
99
+ if (textParts.length > 0) {
100
+ output.push({
101
+ type: "message",
102
+ id: `msg_${this.generateId()}`,
103
+ role: "assistant",
104
+ status: "completed",
105
+ content: [
106
+ {
107
+ type: "output_text",
108
+ text: textParts.join(""),
109
+ annotations: [],
110
+ logprobs: null,
111
+ },
112
+ ],
113
+ });
114
+ }
115
+ if (output.length === 0) {
116
+ output.push({
117
+ type: "message",
118
+ id: `msg_${this.generateId()}`,
119
+ role: "assistant",
120
+ status: "completed",
121
+ content: [
122
+ {
123
+ type: "output_text",
124
+ text: "",
125
+ annotations: [],
126
+ logprobs: null,
127
+ },
128
+ ],
129
+ });
130
+ }
131
+ const status = this.stopReasonToStatus(message.stop_reason, message.content);
132
+ const usage = message.usage;
133
+ return {
134
+ id: message.id,
135
+ object: "response",
136
+ created_at: Math.floor(Date.now() / 1000),
137
+ model: message.model,
138
+ output,
139
+ status,
140
+ error: null,
141
+ incomplete_details: status === "incomplete" ? { reason: "max_output_tokens" } : null,
142
+ instructions: null,
143
+ metadata: {},
144
+ temperature: null,
145
+ top_p: null,
146
+ max_output_tokens: null,
147
+ previous_response_id: null,
148
+ parallel_tool_calls: true,
149
+ tool_choice: "auto",
150
+ tools: [],
151
+ text: { format: { type: "text" } },
152
+ reasoning: null,
153
+ truncation: null,
154
+ user: undefined,
155
+ usage: {
156
+ input_tokens: usage.input_tokens,
157
+ output_tokens: usage.output_tokens,
158
+ total_tokens: usage.input_tokens + usage.output_tokens,
159
+ input_tokens_details: {
160
+ cached_tokens: usage.cache_read_input_tokens ?? 0,
161
+ },
162
+ output_tokens_details: {
163
+ reasoning_tokens: 0,
164
+ },
165
+ },
166
+ };
167
+ }
168
+ // --- Stream conversion (Messages → Responses, backward) ---
169
+ async *convertStream(stream) {
170
+ for await (const event of stream) {
171
+ const events = this.convertStreamEvent(event);
172
+ for (const e of events) {
173
+ yield e;
174
+ }
175
+ }
176
+ }
177
+ convertStreamEvent(event) {
178
+ const state = this.streamState;
179
+ const events = [];
180
+ switch (event.type) {
181
+ case "message_start": {
182
+ const msg = event.message;
183
+ state.id = msg.id;
184
+ state.model = msg.model;
185
+ state.inputTokens = msg.usage.input_tokens;
186
+ state.cacheReadTokens = msg.usage.cache_read_input_tokens ?? 0;
187
+ state.cacheCreationTokens = msg.usage.cache_creation_input_tokens ?? 0;
188
+ const skeleton = this.makeSkeletonResponse();
189
+ events.push({
190
+ type: "response.created",
191
+ response: skeleton,
192
+ sequence_number: state.seq++,
193
+ });
194
+ events.push({
195
+ type: "response.in_progress",
196
+ response: skeleton,
197
+ sequence_number: state.seq++,
198
+ });
199
+ break;
200
+ }
201
+ case "content_block_start": {
202
+ const block = event.content_block;
203
+ if (block.type === "thinking") {
204
+ state.reasoningStarted = true;
205
+ events.push({
206
+ type: "response.output_item.added",
207
+ item: {
208
+ type: "reasoning",
209
+ id: `rs_${this.generateId()}`,
210
+ summary: [],
211
+ },
212
+ output_index: state.outputIndex,
213
+ sequence_number: state.seq++,
214
+ });
215
+ events.push({
216
+ type: "response.reasoning_summary_part.added",
217
+ item_id: `rs_${this.generateId()}`,
218
+ output_index: state.outputIndex,
219
+ summary_index: 0,
220
+ part: { type: "summary_text", text: "" },
221
+ sequence_number: state.seq++,
222
+ });
223
+ }
224
+ else if (block.type === "tool_use" || block.type === "server_tool_use") {
225
+ if (state.toolCallCount === 0 && state.reasoningStarted) {
226
+ state.outputIndex++;
227
+ }
228
+ state.toolCallCount++;
229
+ const toolOutputIndex = state.outputIndex + state.toolCallCount - 1;
230
+ events.push({
231
+ type: "response.output_item.added",
232
+ item: {
233
+ type: "function_call",
234
+ id: `fc_${this.generateId()}`,
235
+ call_id: block.id,
236
+ name: block.name,
237
+ arguments: "",
238
+ status: "in_progress",
239
+ },
240
+ output_index: toolOutputIndex,
241
+ sequence_number: state.seq++,
242
+ });
243
+ }
244
+ else if (block.type === "text") {
245
+ if (!state.textMessageStarted) {
246
+ state.textMessageStarted = true;
247
+ const msgOutputIndex = state.outputIndex + (state.reasoningStarted ? 1 : 0) + state.toolCallCount;
248
+ events.push({
249
+ type: "response.output_item.added",
250
+ item: {
251
+ type: "message",
252
+ id: `msg_${this.generateId()}`,
253
+ role: "assistant",
254
+ status: "in_progress",
255
+ content: [],
256
+ },
257
+ output_index: msgOutputIndex,
258
+ sequence_number: state.seq++,
259
+ });
260
+ events.push({
261
+ type: "response.content_part.added",
262
+ item_id: `msg_${this.generateId()}`,
263
+ output_index: msgOutputIndex,
264
+ content_index: 0,
265
+ part: { type: "output_text", text: "", annotations: [] },
266
+ sequence_number: state.seq++,
267
+ });
268
+ }
269
+ }
270
+ else if (block.type === "web_search_tool_result") {
271
+ state.webSearchCount++;
272
+ }
273
+ break;
274
+ }
275
+ case "content_block_delta": {
276
+ const delta = event.delta;
277
+ if (delta.type === "thinking_delta") {
278
+ events.push({
279
+ type: "response.reasoning_summary_text.delta",
280
+ item_id: `rs_${this.generateId()}`,
281
+ output_index: state.outputIndex,
282
+ summary_index: 0,
283
+ delta: delta.thinking,
284
+ sequence_number: state.seq++,
285
+ });
286
+ }
287
+ else if (delta.type === "input_json_delta") {
288
+ const toolOutputIndex = state.outputIndex + (state.reasoningStarted ? 1 : 0) + state.toolCallCount - 1;
289
+ events.push({
290
+ type: "response.function_call_arguments.delta",
291
+ item_id: `fc_${this.generateId()}`,
292
+ output_index: toolOutputIndex,
293
+ delta: delta.partial_json,
294
+ sequence_number: state.seq++,
295
+ });
296
+ }
297
+ else if (delta.type === "text_delta") {
298
+ const msgOutputIndex = state.outputIndex + (state.reasoningStarted ? 1 : 0) + state.toolCallCount;
299
+ events.push({
300
+ type: "response.output_text.delta",
301
+ item_id: `msg_${this.generateId()}`,
302
+ output_index: msgOutputIndex,
303
+ content_index: 0,
304
+ delta: delta.text,
305
+ sequence_number: state.seq++,
306
+ });
307
+ }
308
+ break;
309
+ }
310
+ case "content_block_stop": {
311
+ break;
312
+ }
313
+ case "message_delta": {
314
+ const usage = event.usage;
315
+ state.outputTokens = usage.output_tokens;
316
+ if (usage.input_tokens != null) {
317
+ state.inputTokens = usage.input_tokens;
318
+ }
319
+ state.stopReason = event.delta.stop_reason;
320
+ state.webSearchCount = usage.server_tool_use?.web_search_requests ?? state.webSearchCount;
321
+ break;
322
+ }
323
+ case "message_stop": {
324
+ const status = this.stopReasonToStatus(state.stopReason, undefined);
325
+ const resp = this.makeSkeletonResponse();
326
+ resp.status = status;
327
+ resp.usage = {
328
+ input_tokens: state.inputTokens,
329
+ output_tokens: state.outputTokens,
330
+ total_tokens: state.inputTokens + state.outputTokens,
331
+ input_tokens_details: {
332
+ cached_tokens: state.cacheReadTokens,
333
+ },
334
+ output_tokens_details: {
335
+ reasoning_tokens: 0,
336
+ },
337
+ };
338
+ if (status === "incomplete") {
339
+ events.push({
340
+ type: "response.incomplete",
341
+ response: resp,
342
+ sequence_number: state.seq++,
343
+ });
344
+ }
345
+ else {
346
+ events.push({
347
+ type: "response.completed",
348
+ response: resp,
349
+ sequence_number: state.seq++,
350
+ });
351
+ }
352
+ break;
353
+ }
354
+ }
355
+ return events;
356
+ }
357
+ // --- Private: request helpers ---
358
+ convertInput(systemBlocks, messages, input) {
359
+ if (typeof input === "string") {
360
+ messages.push({
361
+ role: "user",
362
+ content: [{ type: "text", text: input }],
363
+ });
364
+ return;
365
+ }
366
+ const pendingToolUses = [];
367
+ const flushToolUses = () => {
368
+ if (pendingToolUses.length > 0) {
369
+ messages.push({
370
+ role: "assistant",
371
+ content: [...pendingToolUses],
372
+ });
373
+ pendingToolUses.length = 0;
374
+ }
375
+ };
376
+ for (const item of input) {
377
+ const typed = item;
378
+ if (typed.type === "message") {
379
+ flushToolUses();
380
+ if (typed.role === "system" || typed.role === "developer") {
381
+ const text = this.extractText(typed.content);
382
+ if (text)
383
+ systemBlocks.push(text);
384
+ }
385
+ else if (typed.role === "user") {
386
+ const content = this.convertInputContent(typed.content);
387
+ messages.push({ role: "user", content });
388
+ }
389
+ else if (typed.role === "assistant") {
390
+ const blocks = [];
391
+ if (Array.isArray(typed.content)) {
392
+ for (const part of typed.content) {
393
+ if (part.type === "output_text") {
394
+ blocks.push({ type: "text", text: part.text });
395
+ }
396
+ }
397
+ }
398
+ if (blocks.length > 0) {
399
+ messages.push({ role: "assistant", content: blocks });
400
+ }
401
+ }
402
+ }
403
+ else if (typed.type === "function_call") {
404
+ let parsedInput;
405
+ try {
406
+ parsedInput = JSON.parse(typed.arguments);
407
+ }
408
+ catch {
409
+ parsedInput = {};
410
+ }
411
+ pendingToolUses.push({
412
+ type: "tool_use",
413
+ id: typed.call_id,
414
+ name: typed.name,
415
+ input: parsedInput,
416
+ });
417
+ }
418
+ else if (typed.type === "function_call_output") {
419
+ flushToolUses();
420
+ const toolResult = {
421
+ type: "tool_result",
422
+ tool_use_id: typed.call_id,
423
+ content: [{ type: "text", text: typed.output ?? "" }],
424
+ };
425
+ const last = messages[messages.length - 1];
426
+ if (last && last.role === "user" && Array.isArray(last.content)) {
427
+ const lastContent = last.content;
428
+ if (lastContent.length > 0 && lastContent[0].type === "tool_result") {
429
+ lastContent.push(toolResult);
430
+ continue;
431
+ }
432
+ }
433
+ messages.push({ role: "user", content: [toolResult] });
434
+ }
435
+ else if ("role" in typed && "content" in typed && typeof typed.content === "string") {
436
+ flushToolUses();
437
+ const role = typed.role;
438
+ if (role === "system" || role === "developer") {
439
+ systemBlocks.push(typed.content);
440
+ }
441
+ else if (role === "user") {
442
+ messages.push({ role: "user", content: [{ type: "text", text: typed.content }] });
443
+ }
444
+ else if (role === "assistant") {
445
+ messages.push({ role: "assistant", content: [{ type: "text", text: typed.content }] });
446
+ }
447
+ }
448
+ }
449
+ flushToolUses();
450
+ }
451
+ extractText(content) {
452
+ if (typeof content === "string")
453
+ return content;
454
+ if (Array.isArray(content)) {
455
+ return content
456
+ .filter((p) => p.type === "input_text")
457
+ .map((p) => p.text)
458
+ .join("\n");
459
+ }
460
+ return "";
461
+ }
462
+ convertInputContent(content) {
463
+ if (typeof content === "string") {
464
+ return [{ type: "text", text: content }];
465
+ }
466
+ if (!Array.isArray(content))
467
+ return [{ type: "text", text: "" }];
468
+ const blocks = [];
469
+ for (const part of content) {
470
+ if (part.type === "input_text") {
471
+ blocks.push({ type: "text", text: part.text });
472
+ }
473
+ else if (part.type === "input_image") {
474
+ blocks.push(this.convertInputImage(part));
475
+ }
476
+ else if (part.type === "input_file") {
477
+ blocks.push(this.convertInputFile(part));
478
+ }
479
+ }
480
+ return blocks.length > 0 ? blocks : [{ type: "text", text: "" }];
481
+ }
482
+ convertInputImage(part) {
483
+ const url = part.image_url || "";
484
+ const dataUriMatch = url.match(/^data:(image\/[a-z+]+);base64,(.+)$/);
485
+ if (dataUriMatch) {
486
+ return {
487
+ type: "image",
488
+ source: {
489
+ type: "base64",
490
+ media_type: dataUriMatch[1],
491
+ data: dataUriMatch[2],
492
+ },
493
+ };
494
+ }
495
+ return {
496
+ type: "image",
497
+ source: { type: "url", url },
498
+ };
499
+ }
500
+ convertInputFile(part) {
501
+ const data = part.file_data || part.file_url || "";
502
+ const dataUriMatch = data.match(/^data:([^;]+);base64,(.+)$/);
503
+ if (dataUriMatch) {
504
+ return {
505
+ type: "document",
506
+ source: {
507
+ type: "base64",
508
+ media_type: dataUriMatch[1],
509
+ data: dataUriMatch[2],
510
+ },
511
+ };
512
+ }
513
+ if (data.startsWith("http")) {
514
+ return {
515
+ type: "document",
516
+ source: { type: "url", url: data },
517
+ };
518
+ }
519
+ return {
520
+ type: "document",
521
+ source: { type: "text", data, media_type: "text/plain" },
522
+ };
523
+ }
524
+ convertTools(tools) {
525
+ if (!tools)
526
+ return [];
527
+ const result = [];
528
+ for (const t of tools) {
529
+ const tt = t;
530
+ if (tt.type === "function") {
531
+ result.push({
532
+ name: tt.name,
533
+ description: tt.description,
534
+ input_schema: (tt.parameters ?? { type: "object" }),
535
+ });
536
+ }
537
+ else if (this.isWebSearch(tt)) {
538
+ result.push({ type: "web_search_20250305" });
539
+ }
540
+ }
541
+ return result;
542
+ }
543
+ isWebSearch(tool) {
544
+ const t = tool.type;
545
+ return (t === "web_search" ||
546
+ t === "web_search_2025_08_26" ||
547
+ t === "web_search_preview" ||
548
+ t === "web_search_preview_2025_03_11");
549
+ }
550
+ convertToolChoice(choice, parallelToolCalls) {
551
+ const disableParallel = parallelToolCalls === false ? true : undefined;
552
+ if (typeof choice === "string") {
553
+ switch (choice) {
554
+ case "auto":
555
+ return disableParallel
556
+ ? { type: "auto", disable_parallel_tool_use: true }
557
+ : { type: "auto" };
558
+ case "required":
559
+ return disableParallel
560
+ ? { type: "any", disable_parallel_tool_use: true }
561
+ : { type: "any" };
562
+ case "none":
563
+ return { type: "none" };
564
+ default:
565
+ return { type: "auto" };
566
+ }
567
+ }
568
+ if (typeof choice === "object" && choice !== null) {
569
+ if (choice.type === "function" && choice.name) {
570
+ return disableParallel
571
+ ? { type: "tool", name: choice.name, disable_parallel_tool_use: true }
572
+ : { type: "tool", name: choice.name };
573
+ }
574
+ }
575
+ return { type: "auto" };
576
+ }
577
+ convertReasoning(reasoning) {
578
+ if (!reasoning || !reasoning.effort) {
579
+ return { type: "disabled" };
580
+ }
581
+ const budgetMap = {
582
+ low: 2048,
583
+ medium: 5120,
584
+ high: 10240,
585
+ };
586
+ const budget = budgetMap[reasoning.effort] ?? 10240;
587
+ return { type: "enabled", budget_tokens: budget };
588
+ }
589
+ // --- Private: response helpers ---
590
+ stopReasonToStatus(stopReason, content) {
591
+ if (content) {
592
+ const hasToolCall = content.some(b => b.type === "tool_use" || b.type === "server_tool_use");
593
+ if (hasToolCall)
594
+ return "completed";
595
+ }
596
+ switch (stopReason) {
597
+ case "end_turn":
598
+ case "stop_sequence":
599
+ case "tool_use":
600
+ return "completed";
601
+ case "max_tokens":
602
+ return "incomplete";
603
+ case "refusal":
604
+ return "failed";
605
+ default:
606
+ return "completed";
607
+ }
608
+ }
609
+ generateId() {
610
+ return Math.random().toString(36).substring(2, 15);
611
+ }
612
+ // --- Private: stream helpers ---
613
+ createStreamState() {
614
+ return {
615
+ id: "",
616
+ model: "",
617
+ seq: 0,
618
+ outputIndex: 0,
619
+ reasoningStarted: false,
620
+ toolCallCount: 0,
621
+ textMessageStarted: false,
622
+ inputTokens: 0,
623
+ outputTokens: 0,
624
+ cacheReadTokens: 0,
625
+ cacheCreationTokens: 0,
626
+ webSearchCount: 0,
627
+ stopReason: null,
628
+ };
629
+ }
630
+ makeSkeletonResponse() {
631
+ return {
632
+ id: this.streamState.id,
633
+ object: "response",
634
+ created_at: Math.floor(Date.now() / 1000),
635
+ model: this.streamState.model,
636
+ output: [],
637
+ status: "in_progress",
638
+ error: null,
639
+ incomplete_details: null,
640
+ instructions: null,
641
+ metadata: {},
642
+ temperature: null,
643
+ top_p: null,
644
+ max_output_tokens: null,
645
+ previous_response_id: null,
646
+ parallel_tool_calls: true,
647
+ tool_choice: "auto",
648
+ tools: [],
649
+ text: { format: { type: "text" } },
650
+ reasoning: null,
651
+ truncation: null,
652
+ user: undefined,
653
+ };
654
+ }
655
+ }
656
+ exports.ResponsesToMessagesConverter = ResponsesToMessagesConverter;