@kenkaiiii/gg-ai 4.6.1 → 4.6.3
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/dist/index.cjs +25 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -475,6 +475,29 @@ function isRawThinking(part) {
|
|
|
475
475
|
const t = part.data.type;
|
|
476
476
|
return t === "thinking" || t === "redacted_thinking";
|
|
477
477
|
}
|
|
478
|
+
var ANTHROPIC_INPUT_BLOCK_TYPES = /* @__PURE__ */ new Set([
|
|
479
|
+
"bash_code_execution_tool_result",
|
|
480
|
+
"code_execution_tool_result",
|
|
481
|
+
"connector_text",
|
|
482
|
+
"container_upload",
|
|
483
|
+
"document",
|
|
484
|
+
"image",
|
|
485
|
+
"mid_conv_system",
|
|
486
|
+
"redacted_thinking",
|
|
487
|
+
"search_result",
|
|
488
|
+
"server_tool_use",
|
|
489
|
+
"text",
|
|
490
|
+
"text_editor_code_execution_tool_result",
|
|
491
|
+
"thinking",
|
|
492
|
+
"tool_result",
|
|
493
|
+
"tool_search_tool_result",
|
|
494
|
+
"tool_use",
|
|
495
|
+
"web_fetch_tool_result",
|
|
496
|
+
"web_search_tool_result"
|
|
497
|
+
]);
|
|
498
|
+
function isAnthropicCompatibleRaw(part) {
|
|
499
|
+
return ANTHROPIC_INPUT_BLOCK_TYPES.has(part.data.type);
|
|
500
|
+
}
|
|
478
501
|
function isPositionSensitiveThinking(part) {
|
|
479
502
|
if (part.type === "thinking") return hasValidThinkingSignature(part);
|
|
480
503
|
return isRawThinking(part);
|
|
@@ -501,7 +524,8 @@ function toAnthropicAssistantPart(part, idMap) {
|
|
|
501
524
|
};
|
|
502
525
|
if (part.type === "server_tool_result")
|
|
503
526
|
return part.data;
|
|
504
|
-
if (part.type === "raw")
|
|
527
|
+
if (part.type === "raw")
|
|
528
|
+
return isAnthropicCompatibleRaw(part) ? part.data : null;
|
|
505
529
|
return null;
|
|
506
530
|
}
|
|
507
531
|
function toAnthropicAssistantContent(content, preserveThinking, idMap) {
|