@zenmux/rosetta-ai 1.0.20 → 1.0.22

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.
package/README.md CHANGED
@@ -298,7 +298,7 @@ for await (const chunk of converter.convertStream(responsesStream)) {
298
298
  | `tools` (function) | `tools` (custom) |
299
299
  | `tool_choice` (auto/required/none/named) | `tool_choice` (auto/any/none/tool) |
300
300
  | `parallel_tool_calls` | `tool_choice.disable_parallel_tool_use` |
301
- | `response_format` (json_schema/json_object) | `output_config.format` |
301
+ | `response_format` (json_schema) | `output_config.format` |
302
302
  | `reasoning_effort` | `thinking` (enabled/disabled/adaptive) |
303
303
  | `user` | `metadata.user_id` |
304
304
  | `service_tier` | `service_tier` |
@@ -66,7 +66,10 @@ class ChatCompletionToMessagesConverter {
66
66
  result.tool_choice = { type: "auto", disable_parallel_tool_use: true };
67
67
  }
68
68
  if (params.response_format) {
69
- result.output_config = this.convertResponseFormat(params.response_format);
69
+ const outputConfig = this.convertResponseFormat(params.response_format);
70
+ if (outputConfig !== undefined) {
71
+ result.output_config = outputConfig;
72
+ }
70
73
  }
71
74
  if (params.reasoning_effort != null) {
72
75
  result.thinking = this.convertReasoningEffort(params.reasoning_effort);
@@ -620,12 +623,9 @@ class ChatCompletionToMessagesConverter {
620
623
  };
621
624
  }
622
625
  if (format.type === "json_object") {
623
- return {
624
- format: {
625
- type: "json_schema",
626
- schema: { type: "object" },
627
- },
628
- };
626
+ // Messages has no lossless equivalent for Chat Completions JSON object mode.
627
+ // Omitting output_config preserves compatibility instead of emitting an invalid strict schema.
628
+ return undefined;
629
629
  }
630
630
  // text format — no output_config needed, return empty
631
631
  return {};
@@ -832,7 +832,9 @@ class ResponsesToChatCompletionConverter {
832
832
  if (typed.type === "message") {
833
833
  flushToolCalls();
834
834
  if (typed.role === "user" || typed.role === "system" || typed.role === "developer") {
835
- const content = this.convertInputContent(typed.content);
835
+ const content = typeof typed.content === "string"
836
+ ? typed.content
837
+ : this.convertInputContent(typed.content);
836
838
  messages.push({
837
839
  role: typed.role,
838
840
  content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenmux/rosetta-ai",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Universal translator between AI provider protocols",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",