@zenmux/rosetta-ai 1.0.3 → 1.0.5
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.
|
@@ -150,7 +150,7 @@ class MessagesToResponsesConverter {
|
|
|
150
150
|
reasoning_tokens: reasoningTokens,
|
|
151
151
|
},
|
|
152
152
|
prompt_tokens_details: {
|
|
153
|
-
...u.
|
|
153
|
+
...u.input_tokens_details,
|
|
154
154
|
cached_tokens: cachedTokens,
|
|
155
155
|
...(webSearchCount > 0 ? { web_search: webSearchCount } : {}),
|
|
156
156
|
},
|
|
@@ -349,13 +349,18 @@ class ResponsesToChatCompletionConverter {
|
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
for (const item of input) {
|
|
352
|
-
if ("role" in item && "content" in item &&
|
|
352
|
+
if ("role" in item && "content" in item && !("type" in item)) {
|
|
353
|
+
// EasyInputMessage: { role, content } with no `type` field.
|
|
354
|
+
// content may be a string or an array of input parts.
|
|
353
355
|
flushToolCalls();
|
|
354
356
|
const role = item.role;
|
|
355
357
|
if (role === "user" || role === "system" || role === "developer" || role === "assistant") {
|
|
358
|
+
const content = typeof item.content === "string"
|
|
359
|
+
? item.content
|
|
360
|
+
: this.convertInputContent(item.content);
|
|
356
361
|
messages.push({
|
|
357
362
|
role,
|
|
358
|
-
content
|
|
363
|
+
content,
|
|
359
364
|
});
|
|
360
365
|
}
|
|
361
366
|
continue;
|