@zenmux/rosetta-ai 1.0.9 → 1.0.10

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.
@@ -369,7 +369,7 @@ class ResponsesToChatCompletionConverter {
369
369
  if (!state.current || state.current.type !== "reasoning") {
370
370
  // Close any other open item before starting reasoning.
371
371
  events.push(...this.closeCurrent());
372
- const itemId = `rs_${choice.index}_${state.id}`;
372
+ const itemId = `rs_${state.id}`;
373
373
  state.current = {
374
374
  type: "reasoning",
375
375
  itemId,
@@ -433,7 +433,7 @@ class ResponsesToChatCompletionConverter {
433
433
  // matching the legacy converter's output_index math.
434
434
  const outputIndex = state.outputIndex + state.toolCallCount - 1;
435
435
  if (isCustom) {
436
- const itemId = `ct_${choice.index}_${state.id}`;
436
+ const itemId = `ct_${state.id}`;
437
437
  state.current = {
438
438
  type: "custom_tool_call",
439
439
  itemId,
@@ -457,7 +457,7 @@ class ResponsesToChatCompletionConverter {
457
457
  });
458
458
  }
459
459
  else {
460
- const itemId = `fc_${choice.index}_${state.id}`;
460
+ const itemId = `fc_${state.id}`;
461
461
  state.current = {
462
462
  type: "function_call",
463
463
  itemId,
@@ -586,7 +586,7 @@ class ResponsesToChatCompletionConverter {
586
586
  /** Open a message output item and its first content part. */
587
587
  openMessage(state, kind, events) {
588
588
  state.messageStarted = true;
589
- const itemId = `msg_0_${state.id}`;
589
+ const itemId = `msg_${state.id}`;
590
590
  const msgOutputIndex = state.outputIndex + state.toolCallCount;
591
591
  state.current = {
592
592
  type: "message",
@@ -1126,8 +1126,10 @@ class ResponsesToChatCompletionConverter {
1126
1126
  resp.safety_identifier =
1127
1127
  echoed.safety_identifier != null ? echoed.safety_identifier : null;
1128
1128
  resp.service_tier = echoed.service_tier != null ? echoed.service_tier : "default";
1129
- if (this.requestParams?.prompt_cache_key !== undefined)
1130
- resp.prompt_cache_key = this.requestParams.prompt_cache_key;
1129
+ resp.prompt_cache_key =
1130
+ this.requestParams?.prompt_cache_key !== undefined
1131
+ ? this.requestParams.prompt_cache_key
1132
+ : null;
1131
1133
  resp.prompt_cache_retention =
1132
1134
  this.requestParams?.prompt_cache_retention !== undefined
1133
1135
  ? this.requestParams.prompt_cache_retention
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenmux/rosetta-ai",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Universal translator between AI provider protocols",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",