alchemylab-opencode 2.0.1 → 2.0.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/NODE_COMPAT.md +8 -1
- package/dist/20260127222353_familiar_lady_ursula-YYOFSQD5.js +18 -0
- package/dist/20260211171708_add_project_commands-3GKQTPBZ.js +18 -0
- package/dist/20260213144116_wakeful_the_professor-ROO7OAVL.js +18 -0
- package/dist/20260225215848_workspace-V2OZTNFF.js +18 -0
- package/dist/20260227213759_add_session_workspace_id-GVDWAXKM.js +18 -0
- package/dist/20260228203230_blue_harpoon-Z5QP2II5.js +18 -0
- package/dist/20260303231226_add_workspace_fields-QOVAFN7W.js +18 -0
- package/dist/20260309230000_move_org_to_state-RQURSDZD.js +18 -0
- package/dist/20260312043431_session_message_cursor-VBISKDXL.js +18 -0
- package/dist/20260323234822_events-PILJHLNA.js +18 -0
- package/dist/20260410174513_workspace-name-63YCZ5NS.js +18 -0
- package/dist/20260413175956_chief_energizer-NMAZYGDO.js +18 -0
- package/dist/20260423070820_add_icon_url_override-RAJCVNEP.js +18 -0
- package/dist/20260427172553_slow_nightmare-ULYYZLR4.js +18 -0
- package/dist/20260428004200_add_session_path-U4WO2TGE.js +18 -0
- package/dist/20260501142318_next_venus-6BCYATSC.js +18 -0
- package/dist/20260504145000_add_sync_owner-RGVHV6LN.js +18 -0
- package/dist/20260507164347_add_workspace_time-GE6UHNPM.js +18 -0
- package/dist/{20260510033149_session_usage-UGBVOXZB.js → 20260510033149_session_usage-7XHCFVKY.js} +5 -1
- package/dist/20260511000411_data_migration_state-2EGZKFLB.js +18 -0
- package/dist/20260511173437_session-metadata-K322YY33.js +18 -0
- package/dist/20260601010001_normalize_storage_paths-VZDTY366.js +18 -0
- package/dist/{20260225215848_workspace-ZMSOZSPA.js → 20260601202201_amazing_prowler-YT6PLK3L.js} +5 -1
- package/dist/{20260228203230_blue_harpoon-IW3Z4TQZ.js → 20260602002951_lowly_union_jack-6VLQTBVB.js} +5 -1
- package/dist/20260602182828_add_project_directories-TVSRD25A.js +18 -0
- package/dist/20260603001617_session_message_projection_indexes-PHKTF6HK.js +18 -0
- package/dist/{20260622170816_reset_v2_session_state-5JPHJTZG.js → 20260603040000_session_message_projection_order-7RTV2POG.js} +5 -1
- package/dist/20260603141458_session_input_inbox-RSBWABG7.js +18 -0
- package/dist/20260603160727_jittery_ezekiel_stane-DXBLLRVV.js +18 -0
- package/dist/20260604172448_event_sourced_session_input-H6Z3JEBD.js +18 -0
- package/dist/20260605003541_add_session_context_snapshot-6FDPM2TK.js +18 -0
- package/dist/20260605042240_add_context_epoch_agent-C2OF2UKR.js +18 -0
- package/dist/20260611035744_credential-YNZ47FSH.js +18 -0
- package/dist/20260611192811_lush_chimera-E357VI6P.js +18 -0
- package/dist/20260612174303_project_dir_strategy-VUGGK42O.js +18 -0
- package/dist/20260622142730_simplify_session_context_epoch-UYGXZ5BX.js +18 -0
- package/dist/20260622170816_reset_v2_session_state-EILLPCJQ.js +18 -0
- package/dist/20260622202450_simplify_session_input-Y65GDGBO.js +18 -0
- package/dist/NodeSdk-AGMQWBHH.js +18 -0
- package/dist/anthropic-45OFTLAW.js +18 -0
- package/dist/anthropic-ND6UHXWL.js +18 -0
- package/dist/app-runtime-ZWWQ4JTM.js +18 -0
- package/dist/chunk-2MRHL4B2.js +18 -0
- package/dist/chunk-2XWBNI3L.js +1490 -0
- package/dist/chunk-4MBUHJHY.js +22 -0
- package/dist/chunk-6MAPFAXY.js +190 -0
- package/dist/chunk-7XX6TY62.js +259 -0
- package/dist/chunk-ANF3QA3Z.js +48 -0
- package/dist/chunk-AUB2TEYJ.js +55 -0
- package/dist/chunk-AZUMH3TO.js +18 -0
- package/dist/chunk-BQ4IEPN3.js +19 -0
- package/dist/chunk-CYRZU5QM.js +33 -0
- package/dist/chunk-DGJQZN2Q.js +18 -0
- package/dist/chunk-DO2UZ6NY.js +18 -0
- package/dist/chunk-DZ6G4VSD.js +19 -0
- package/dist/chunk-EK6FQQHY.js +20 -0
- package/dist/chunk-ELPXQ32J.js +90 -0
- package/dist/chunk-F5PY52BY.js +18 -0
- package/dist/chunk-FGLPSSRK.js +19 -0
- package/dist/chunk-FV7U6PVP.js +18 -0
- package/dist/chunk-FYYAOZPU.js +18 -0
- package/dist/chunk-GDWO6EXN.js +22 -0
- package/dist/chunk-GW3ZRKAI.js +20 -0
- package/dist/chunk-IQSFXWDQ.js +18 -0
- package/dist/chunk-IYUSBBGY.js +35 -0
- package/dist/chunk-JPOFLMNH.js +18 -0
- package/dist/{chunk-VURLSDCB.js → chunk-K5LKDIVU.js} +4 -0
- package/dist/chunk-KS4WLVK5.js +19 -0
- package/dist/chunk-L3CE2Y3L.js +55 -0
- package/dist/chunk-LIXP4TPL.js +18 -0
- package/dist/chunk-LSC4RT5V.js +36 -0
- package/dist/chunk-M5A6NFHQ.js +28 -0
- package/dist/chunk-M6E6KNLV.js +30 -0
- package/dist/chunk-MLFZXUGQ.js +18 -0
- package/dist/chunk-NDI67DRG.js +31 -0
- package/dist/chunk-OCWGUTZJ.js +36 -0
- package/dist/chunk-OGDRUXMJ.js +18 -0
- package/dist/chunk-OGJKLJC7.js +29 -0
- package/dist/chunk-P5RLCJUV.js +18 -0
- package/dist/chunk-Q3WIUQXB.js +18 -0
- package/dist/{20260227213759_add_session_workspace_id-ROENWPKA.js → chunk-QCRIXKIC.js} +5 -1
- package/dist/chunk-QD24DLUD.js +18 -0
- package/dist/chunk-R2GWBJEP.js +18 -0
- package/dist/chunk-RIA6SDOY.js +780 -0
- package/dist/chunk-RPAXSOGH.js +18 -0
- package/dist/chunk-TK5R7QUN.js +18 -0
- package/dist/chunk-TNQWZFIZ.js +28 -0
- package/dist/chunk-UCLPBO4I.js +18 -0
- package/dist/chunk-V6FDDNGV.js +117 -0
- package/dist/chunk-V6HERYFV.js +18 -0
- package/dist/chunk-V7XKKJ7X.js +24 -0
- package/dist/chunk-VHDYUBBS.js +23 -0
- package/dist/chunk-VWLJXTZ5.js +18 -0
- package/dist/chunk-VXAPFOIL.js +22 -0
- package/dist/chunk-WKZYINC7.js +29 -0
- package/dist/chunk-WL33KE3H.js +920 -0
- package/dist/chunk-WPMP2ZFE.js +40 -0
- package/dist/chunk-WRTNIOI3.js +18 -0
- package/dist/chunk-WZ4237YY.js +19 -0
- package/dist/chunk-X5F46HR5.js +18 -0
- package/dist/chunk-XPS7TQZG.js +22 -0
- package/dist/chunk-XSKT4AXR.js +878 -0
- package/dist/chunk-YJPP6IQ3.js +23 -0
- package/dist/chunk-ZYQWFC55.js +22 -0
- package/dist/code-mode-H3HRSD24.js +502 -0
- package/dist/copilot-provider-QVMLQZZC.js +18 -0
- package/dist/dist-5NQOHNPL.js +18 -0
- package/dist/dist-7CT3XCNN.js +32 -0
- package/dist/dist-CL46WFZG.js +18 -0
- package/dist/dist-HXJTF22W.js +32 -0
- package/dist/dist-JFXI53ZF.js +22 -0
- package/dist/dist-KBYKWVT5.js +22 -0
- package/dist/dist-KGNO5AP7.js +35 -0
- package/dist/dist-KTNLTEHB.js +18 -0
- package/dist/dist-KZ5R5QM5.js +24 -0
- package/dist/{20260605042240_add_context_epoch_agent-W6IQYZXE.js → dist-LOXU6IEM.js} +5 -1
- package/dist/dist-NLXUYBW7.js +32 -0
- package/dist/dist-O4DF72J2.js +22 -0
- package/dist/dist-PH4MEGVR.js +22 -0
- package/dist/{20260511000411_data_migration_state-FB4LBFSE.js → dist-QJPOJCLB.js} +5 -1
- package/dist/dist-QYH62TCJ.js +22 -0
- package/dist/{20260303231226_add_workspace_fields-OUVZMNAG.js → dist-RIC4WKHC.js} +5 -1
- package/dist/dist-T776XKTM.js +22 -0
- package/dist/dist-TCE5MKZQ.js +23 -0
- package/dist/dist-TH2Q44RX.js +50 -0
- package/dist/dist-VV5FV5RT.js +101 -0
- package/dist/dist-WZJ3LNRG.js +28 -0
- package/dist/dist-XAFENVUS.js +22 -0
- package/dist/dist-XPFB35TX.js +32 -0
- package/dist/dist-es-43ZM44MP.js +18 -0
- package/dist/dist-es-CH2YKBKX.js +18 -0
- package/dist/{20260428004200_add_session_path-LGW75WYA.js → dist-es-DHCTZZ2E.js} +5 -1
- package/dist/dist-es-EVVG3KDV.js +26 -0
- package/dist/dist-es-HRCONNGK.js +18 -0
- package/dist/dist-es-L2GU465G.js +18 -0
- package/dist/dist-es-RGEIM2BP.js +18 -0
- package/dist/dist-es-RZ25XEH6.js +18 -0
- package/dist/dist-es-SITTNOGV.js +18 -0
- package/dist/esm-NN5W7YCL.js +18 -0
- package/dist/esm-XWJSHYHG.js +18 -0
- package/dist/getMachineId-bsd-L5I5TZ5I.js +18 -0
- package/dist/getMachineId-darwin-YB7KG37W.js +19 -0
- package/dist/getMachineId-linux-EL47KXX7.js +18 -0
- package/dist/getMachineId-unsupported-QOWPEBPN.js +18 -0
- package/dist/getMachineId-win-HCRYRDFJ.js +18 -0
- package/dist/lib-7VH6D2QJ.js +199 -0
- package/dist/loadCognitoIdentity-EWT55EI7.js +18 -0
- package/dist/loadSso-AGOUE6RL.js +18 -0
- package/dist/{20260213144116_wakeful_the_professor-ZVDD54AK.js → loadSts-RH5L3PIX.js} +5 -1
- package/dist/mantle-IJXDXT4M.js +25 -0
- package/dist/mime-types-GSWEOYZ5.js +18 -0
- package/dist/multipart-parser-KZWMKXA4.js +19 -0
- package/dist/{20260211171708_add_project_commands-GDOHPDPF.js → open-7KXTRM37.js} +5 -1
- package/dist/openai-ZOJI6I5R.js +18 -0
- package/dist/p-map-CYL6ILJW.js +18 -0
- package/dist/photon-W56QZY4L.js +18 -0
- package/dist/{20260423070820_add_icon_url_override-X5SHFGTI.js → pkce-VT4ITJTB.js} +5 -1
- package/dist/{pty.node-Y3N2XKYG.js → pty.node-IWULXXG6.js} +5 -1
- package/dist/run.js +5 -1
- package/dist/serve.js +143 -1
- package/dist/server-XRUYBM7W.js +21 -0
- package/dist/session-4BXV4JJH.js +18 -0
- package/dist/signin-DKBWDEYP.js +18 -0
- package/dist/src-JODD73WX.js +18 -0
- package/dist/src-QJHT5SCV.js +18 -0
- package/dist/src-SMM4U63G.js +18 -0
- package/dist/src-WDYKISPD.js +20 -0
- package/dist/sso-oidc-S3P64MCY.js +18 -0
- package/dist/sts-RG44NMOQ.js +18 -0
- package/dist/token-2V62AM3G.js +18 -0
- package/dist/token-util-VXONHEUD.js +18 -0
- package/dist/unified-W3ZKZ4HG.js +18 -0
- package/dist/worktree-B2LROS2B.js +18 -0
- package/package.json +40 -40
- package/postinstall.cjs +4 -2
- package/dist/20260127222353_familiar_lady_ursula-KV747FJX.js +0 -14
- package/dist/20260309230000_move_org_to_state-NOXAPU5V.js +0 -14
- package/dist/20260312043431_session_message_cursor-DJ4T3T4R.js +0 -14
- package/dist/20260323234822_events-72GIKJ2A.js +0 -14
- package/dist/20260410174513_workspace-name-JXSWFBJN.js +0 -14
- package/dist/20260413175956_chief_energizer-4HEWZ6U3.js +0 -14
- package/dist/20260427172553_slow_nightmare-PS5T2AH2.js +0 -14
- package/dist/20260501142318_next_venus-J3TLVXZ6.js +0 -14
- package/dist/20260504145000_add_sync_owner-3R52GB4C.js +0 -14
- package/dist/20260507164347_add_workspace_time-JHDRCZAR.js +0 -14
- package/dist/20260511173437_session-metadata-T2XHGWHS.js +0 -14
- package/dist/20260601010001_normalize_storage_paths-5MAY5GT3.js +0 -14
- package/dist/20260601202201_amazing_prowler-PET224YG.js +0 -14
- package/dist/20260602002951_lowly_union_jack-PG6XDMGL.js +0 -14
- package/dist/20260602182828_add_project_directories-ZCH2ACGG.js +0 -14
- package/dist/20260603001617_session_message_projection_indexes-XVLJTUF2.js +0 -14
- package/dist/20260603040000_session_message_projection_order-XG6RACZQ.js +0 -14
- package/dist/20260603141458_session_input_inbox-K2VQ7V6E.js +0 -14
- package/dist/20260603160727_jittery_ezekiel_stane-WKJLRDO7.js +0 -14
- package/dist/20260604172448_event_sourced_session_input-NTXOECR7.js +0 -14
- package/dist/20260605003541_add_session_context_snapshot-DXMQEXMT.js +0 -14
- package/dist/20260611035744_credential-XTMSYTJD.js +0 -14
- package/dist/20260611192811_lush_chimera-XPLIQMJD.js +0 -14
- package/dist/20260612174303_project_dir_strategy-FR2NGQKK.js +0 -14
- package/dist/20260622142730_simplify_session_context_epoch-NTQZR3RE.js +0 -14
- package/dist/20260622202450_simplify_session_input-2EXF2HMV.js +0 -14
- package/dist/app-runtime-HQBOCDV5.js +0 -14
- package/dist/chunk-4FEBIOI5.js +0 -865
- package/dist/chunk-4K2RXRZL.js +0 -14
- package/dist/chunk-4RFMKEKM.js +0 -1455
- package/dist/chunk-BM2C7NHL.js +0 -41
- package/dist/chunk-MKEMZFJI.js +0 -393
- package/dist/chunk-OMDJ6ZZ2.js +0 -684
- package/dist/chunk-OWMG4NNF.js +0 -186
- package/dist/chunk-QRABYJKL.js +0 -14
- package/dist/chunk-RHIWAYN5.js +0 -14
- package/dist/chunk-Z5TLIUAI.js +0 -28
- package/dist/code-mode-7BQJUARW.js +0 -40
- package/dist/copilot-provider-TX4YFKJZ.js +0 -14
- package/dist/photon-VQS5F5BI.js +0 -14
- package/dist/server-BFUQR7MX.js +0 -17
- package/dist/session-6RNXZNG6.js +0 -14
- package/dist/worktree-QHQHX3SG.js +0 -14
- package/patches/@ai-sdk%2Famazon-bedrock@4.0.166.patch +0 -164
- package/patches/@ai-sdk%2Fanthropic@3.0.111.patch +0 -528
- package/patches/@ai-sdk%2Fgoogle@3.0.73.patch +0 -69
- package/patches/@ai-sdk%2Fgroq@3.0.31.patch +0 -79
- package/patches/@ai-sdk%2Fmistral@3.0.51.patch +0 -714
- package/patches/@ai-sdk%2Fopenai-compatible@2.0.41.patch +0 -39
- package/patches/@ai-sdk%2Fopenai@3.0.88.patch +0 -280
- package/patches/@ai-sdk%2Fxai@3.0.139.patch +0 -296
- package/patches/@modelcontextprotocol%2Fsdk@1.29.0.patch +0 -647
- package/patches/@npmcli%2Fagent@4.0.2.patch +0 -13
- package/patches/effect@4.0.0-beta.83.patch +0 -57
- package/patches/gcp-metadata@8.1.2.patch +0 -14
- package/patches/pacote@21.5.0.patch +0 -18
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/index.js b/dist/index.js
|
|
2
|
-
index dca128d3a790378c51a24a16d92585178343b278..da75f9d64acd2b607abd15079ce2d03b7a8d675a 100644
|
|
3
|
-
--- a/dist/index.js
|
|
4
|
-
+++ b/dist/index.js
|
|
5
|
-
@@ -696,7 +696,7 @@ var OpenAICompatibleChatLanguageModel = class {
|
|
6
|
-
finishReason = { unified: "error", raw: void 0 };
|
|
7
|
-
controller.enqueue({
|
|
8
|
-
type: "error",
|
|
9
|
-
- error: chunk.value.error.message
|
|
10
|
-
+ error: chunk.value.error
|
|
11
|
-
});
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
15
|
-
index 3b1e1b6bdec5032e3b4fa5ffbcc8cdf3dfe1cc40..eaffc446f80552ea0b26573b89daa4dfc7776e6e 100644
|
|
16
|
-
--- a/dist/index.mjs
|
|
17
|
-
+++ b/dist/index.mjs
|
|
18
|
-
@@ -683,7 +683,7 @@ var OpenAICompatibleChatLanguageModel = class {
|
|
19
|
-
finishReason = { unified: "error", raw: void 0 };
|
|
20
|
-
controller.enqueue({
|
|
21
|
-
type: "error",
|
|
22
|
-
- error: chunk.value.error.message
|
|
23
|
-
+ error: chunk.value.error
|
|
24
|
-
});
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
diff --git a/src/chat/openai-compatible-chat-language-model.ts b/src/chat/openai-compatible-chat-language-model.ts
|
|
28
|
-
index 8c622db23c2d9a7373701f5a1b0c2ba109e24602..643c3db68a6043e097edc1122e0eb53fd13495c5 100644
|
|
29
|
-
--- a/src/chat/openai-compatible-chat-language-model.ts
|
|
30
|
-
+++ b/src/chat/openai-compatible-chat-language-model.ts
|
|
31
|
-
@@ -442,7 +442,7 @@ export class OpenAICompatibleChatLanguageModel implements LanguageModelV3 {
|
|
32
|
-
finishReason = { unified: 'error', raw: undefined };
|
|
33
|
-
controller.enqueue({
|
|
34
|
-
type: 'error',
|
|
35
|
-
- error: chunk.value.error.message,
|
|
36
|
-
+ error: chunk.value.error,
|
|
37
|
-
});
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/index.js b/dist/index.js
|
|
2
|
-
index 5fc82d7ca0f5fba1da3b24c15bb714f51b5aa178..e1a3e2c97774af3a5688c7052bd9a07d692fcc8f 100644
|
|
3
|
-
--- a/dist/index.js
|
|
4
|
-
+++ b/dist/index.js
|
|
5
|
-
@@ -1035,22 +1035,6 @@ var OpenAIChatLanguageModel = class {
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
- if (openaiOptions.serviceTier === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
10
|
-
- warnings.push({
|
|
11
|
-
- type: "unsupported",
|
|
12
|
-
- feature: "serviceTier",
|
|
13
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
14
|
-
- });
|
|
15
|
-
- baseArgs.service_tier = void 0;
|
|
16
|
-
- }
|
|
17
|
-
- if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
18
|
-
- warnings.push({
|
|
19
|
-
- type: "unsupported",
|
|
20
|
-
- feature: "serviceTier",
|
|
21
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
22
|
-
- });
|
|
23
|
-
- baseArgs.service_tier = void 0;
|
|
24
|
-
- }
|
|
25
|
-
const {
|
|
26
|
-
tools: openaiTools2,
|
|
27
|
-
toolChoice: openaiToolChoice,
|
|
28
|
-
@@ -5454,22 +5438,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
33
|
-
- warnings.push({
|
|
34
|
-
- type: "unsupported",
|
|
35
|
-
- feature: "serviceTier",
|
|
36
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
37
|
-
- });
|
|
38
|
-
- delete baseArgs.service_tier;
|
|
39
|
-
- }
|
|
40
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
41
|
-
- warnings.push({
|
|
42
|
-
- type: "unsupported",
|
|
43
|
-
- feature: "serviceTier",
|
|
44
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
45
|
-
- });
|
|
46
|
-
- delete baseArgs.service_tier;
|
|
47
|
-
- }
|
|
48
|
-
const shellToolEnvType = (_k = (_j = (_i = tools == null ? void 0 : tools.find(
|
|
49
|
-
(tool) => tool.type === "provider" && tool.id === "openai.shell"
|
|
50
|
-
)) == null ? void 0 : _i.args) == null ? void 0 : _j.environment) == null ? void 0 : _k.type;
|
|
51
|
-
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
52
|
-
index 589c4f76955bee692b8af36ea1d9a15121695d4a..6838ea0a362c8fe774527bb1126b8031ebfd3fab 100644
|
|
53
|
-
--- a/dist/index.mjs
|
|
54
|
-
+++ b/dist/index.mjs
|
|
55
|
-
@@ -1031,22 +1031,6 @@ var OpenAIChatLanguageModel = class {
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
- if (openaiOptions.serviceTier === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
60
|
-
- warnings.push({
|
|
61
|
-
- type: "unsupported",
|
|
62
|
-
- feature: "serviceTier",
|
|
63
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
64
|
-
- });
|
|
65
|
-
- baseArgs.service_tier = void 0;
|
|
66
|
-
- }
|
|
67
|
-
- if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
68
|
-
- warnings.push({
|
|
69
|
-
- type: "unsupported",
|
|
70
|
-
- feature: "serviceTier",
|
|
71
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
72
|
-
- });
|
|
73
|
-
- baseArgs.service_tier = void 0;
|
|
74
|
-
- }
|
|
75
|
-
const {
|
|
76
|
-
tools: openaiTools2,
|
|
77
|
-
toolChoice: openaiToolChoice,
|
|
78
|
-
@@ -5557,22 +5541,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
83
|
-
- warnings.push({
|
|
84
|
-
- type: "unsupported",
|
|
85
|
-
- feature: "serviceTier",
|
|
86
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
87
|
-
- });
|
|
88
|
-
- delete baseArgs.service_tier;
|
|
89
|
-
- }
|
|
90
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
91
|
-
- warnings.push({
|
|
92
|
-
- type: "unsupported",
|
|
93
|
-
- feature: "serviceTier",
|
|
94
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
95
|
-
- });
|
|
96
|
-
- delete baseArgs.service_tier;
|
|
97
|
-
- }
|
|
98
|
-
const shellToolEnvType = (_k = (_j = (_i = tools == null ? void 0 : tools.find(
|
|
99
|
-
(tool) => tool.type === "provider" && tool.id === "openai.shell"
|
|
100
|
-
)) == null ? void 0 : _i.args) == null ? void 0 : _j.environment) == null ? void 0 : _k.type;
|
|
101
|
-
diff --git a/dist/internal/index.js b/dist/internal/index.js
|
|
102
|
-
index ad78b5df9359509091f4b8a1751dc34c03c74e32..ed92f56d8fe9c1442f741ef8d42d592ce9b28643 100644
|
|
103
|
-
--- a/dist/internal/index.js
|
|
104
|
-
+++ b/dist/internal/index.js
|
|
105
|
-
@@ -1070,22 +1070,6 @@ var OpenAIChatLanguageModel = class {
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
- if (openaiOptions.serviceTier === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
110
|
-
- warnings.push({
|
|
111
|
-
- type: "unsupported",
|
|
112
|
-
- feature: "serviceTier",
|
|
113
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
114
|
-
- });
|
|
115
|
-
- baseArgs.service_tier = void 0;
|
|
116
|
-
- }
|
|
117
|
-
- if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
118
|
-
- warnings.push({
|
|
119
|
-
- type: "unsupported",
|
|
120
|
-
- feature: "serviceTier",
|
|
121
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
122
|
-
- });
|
|
123
|
-
- baseArgs.service_tier = void 0;
|
|
124
|
-
- }
|
|
125
|
-
const {
|
|
126
|
-
tools: openaiTools,
|
|
127
|
-
toolChoice: openaiToolChoice,
|
|
128
|
-
@@ -5724,22 +5708,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
133
|
-
- warnings.push({
|
|
134
|
-
- type: "unsupported",
|
|
135
|
-
- feature: "serviceTier",
|
|
136
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
137
|
-
- });
|
|
138
|
-
- delete baseArgs.service_tier;
|
|
139
|
-
- }
|
|
140
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
141
|
-
- warnings.push({
|
|
142
|
-
- type: "unsupported",
|
|
143
|
-
- feature: "serviceTier",
|
|
144
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
145
|
-
- });
|
|
146
|
-
- delete baseArgs.service_tier;
|
|
147
|
-
- }
|
|
148
|
-
const shellToolEnvType = (_k = (_j = (_i = tools == null ? void 0 : tools.find(
|
|
149
|
-
(tool) => tool.type === "provider" && tool.id === "openai.shell"
|
|
150
|
-
)) == null ? void 0 : _i.args) == null ? void 0 : _j.environment) == null ? void 0 : _k.type;
|
|
151
|
-
diff --git a/dist/internal/index.mjs b/dist/internal/index.mjs
|
|
152
|
-
index db7d6741c9ea615d577ea07722b469c144066268..f6b41b2832d2c8392072e0ecc1612e9e18b1b48e 100644
|
|
153
|
-
--- a/dist/internal/index.mjs
|
|
154
|
-
+++ b/dist/internal/index.mjs
|
|
155
|
-
@@ -1023,22 +1023,6 @@ var OpenAIChatLanguageModel = class {
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
- if (openaiOptions.serviceTier === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
160
|
-
- warnings.push({
|
|
161
|
-
- type: "unsupported",
|
|
162
|
-
- feature: "serviceTier",
|
|
163
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
164
|
-
- });
|
|
165
|
-
- baseArgs.service_tier = void 0;
|
|
166
|
-
- }
|
|
167
|
-
- if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
168
|
-
- warnings.push({
|
|
169
|
-
- type: "unsupported",
|
|
170
|
-
- feature: "serviceTier",
|
|
171
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
172
|
-
- });
|
|
173
|
-
- baseArgs.service_tier = void 0;
|
|
174
|
-
- }
|
|
175
|
-
const {
|
|
176
|
-
tools: openaiTools,
|
|
177
|
-
toolChoice: openaiToolChoice,
|
|
178
|
-
@@ -5802,22 +5786,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelCapabilities.supportsFlexProcessing) {
|
|
183
|
-
- warnings.push({
|
|
184
|
-
- type: "unsupported",
|
|
185
|
-
- feature: "serviceTier",
|
|
186
|
-
- details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
187
|
-
- });
|
|
188
|
-
- delete baseArgs.service_tier;
|
|
189
|
-
- }
|
|
190
|
-
- if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
191
|
-
- warnings.push({
|
|
192
|
-
- type: "unsupported",
|
|
193
|
-
- feature: "serviceTier",
|
|
194
|
-
- details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
195
|
-
- });
|
|
196
|
-
- delete baseArgs.service_tier;
|
|
197
|
-
- }
|
|
198
|
-
const shellToolEnvType = (_k = (_j = (_i = tools == null ? void 0 : tools.find(
|
|
199
|
-
(tool) => tool.type === "provider" && tool.id === "openai.shell"
|
|
200
|
-
)) == null ? void 0 : _i.args) == null ? void 0 : _j.environment) == null ? void 0 : _k.type;
|
|
201
|
-
diff --git a/src/chat/openai-chat-language-model.ts b/src/chat/openai-chat-language-model.ts
|
|
202
|
-
index 009a58deea236c2be03adc5cd03f98ed9050fd7b..a606675d82fc72a0bab8d52ac99866100e7ffb1d 100644
|
|
203
|
-
--- a/src/chat/openai-chat-language-model.ts
|
|
204
|
-
+++ b/src/chat/openai-chat-language-model.ts
|
|
205
|
-
@@ -267,34 +267,6 @@ export class OpenAIChatLanguageModel implements LanguageModelV3 {
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
- // Validate flex processing support
|
|
210
|
-
- if (
|
|
211
|
-
- openaiOptions.serviceTier === 'flex' &&
|
|
212
|
-
- !modelCapabilities.supportsFlexProcessing
|
|
213
|
-
- ) {
|
|
214
|
-
- warnings.push({
|
|
215
|
-
- type: 'unsupported',
|
|
216
|
-
- feature: 'serviceTier',
|
|
217
|
-
- details:
|
|
218
|
-
- 'flex processing is only available for o3, o4-mini, and gpt-5 models',
|
|
219
|
-
- });
|
|
220
|
-
- baseArgs.service_tier = undefined;
|
|
221
|
-
- }
|
|
222
|
-
-
|
|
223
|
-
- // Validate priority processing support
|
|
224
|
-
- if (
|
|
225
|
-
- openaiOptions.serviceTier === 'priority' &&
|
|
226
|
-
- !modelCapabilities.supportsPriorityProcessing
|
|
227
|
-
- ) {
|
|
228
|
-
- warnings.push({
|
|
229
|
-
- type: 'unsupported',
|
|
230
|
-
- feature: 'serviceTier',
|
|
231
|
-
- details:
|
|
232
|
-
- 'priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported',
|
|
233
|
-
- });
|
|
234
|
-
- baseArgs.service_tier = undefined;
|
|
235
|
-
- }
|
|
236
|
-
-
|
|
237
|
-
const {
|
|
238
|
-
tools: openaiTools,
|
|
239
|
-
toolChoice: openaiToolChoice,
|
|
240
|
-
diff --git a/src/responses/openai-responses-language-model.ts b/src/responses/openai-responses-language-model.ts
|
|
241
|
-
index 926e7ec713480353b969901f19c5d1d8cc883dab..ed457ce8f07a60ed48c47a3cbf11b2a7c6cf6415 100644
|
|
242
|
-
--- a/src/responses/openai-responses-language-model.ts
|
|
243
|
-
+++ b/src/responses/openai-responses-language-model.ts
|
|
244
|
-
@@ -433,36 +433,6 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
- // Validate flex processing support
|
|
249
|
-
- if (
|
|
250
|
-
- openaiOptions?.serviceTier === 'flex' &&
|
|
251
|
-
- !modelCapabilities.supportsFlexProcessing
|
|
252
|
-
- ) {
|
|
253
|
-
- warnings.push({
|
|
254
|
-
- type: 'unsupported',
|
|
255
|
-
- feature: 'serviceTier',
|
|
256
|
-
- details:
|
|
257
|
-
- 'flex processing is only available for o3, o4-mini, and gpt-5 models',
|
|
258
|
-
- });
|
|
259
|
-
- // Remove from args if not supported
|
|
260
|
-
- delete (baseArgs as any).service_tier;
|
|
261
|
-
- }
|
|
262
|
-
-
|
|
263
|
-
- // Validate priority processing support
|
|
264
|
-
- if (
|
|
265
|
-
- openaiOptions?.serviceTier === 'priority' &&
|
|
266
|
-
- !modelCapabilities.supportsPriorityProcessing
|
|
267
|
-
- ) {
|
|
268
|
-
- warnings.push({
|
|
269
|
-
- type: 'unsupported',
|
|
270
|
-
- feature: 'serviceTier',
|
|
271
|
-
- details:
|
|
272
|
-
- 'priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported',
|
|
273
|
-
- });
|
|
274
|
-
- // Remove from args if not supported
|
|
275
|
-
- delete (baseArgs as any).service_tier;
|
|
276
|
-
- }
|
|
277
|
-
-
|
|
278
|
-
const shellToolEnvType = (
|
|
279
|
-
tools?.find(
|
|
280
|
-
tool => tool.type === 'provider' && tool.id === 'openai.shell',
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/index.d.mts b/dist/index.d.mts
|
|
2
|
-
index e9c9916..b2cefd4 100644
|
|
3
|
-
--- a/dist/index.d.mts
|
|
4
|
-
+++ b/dist/index.d.mts
|
|
5
|
-
@@ -5,13 +5,7 @@ import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
6
|
-
|
|
7
|
-
type XaiChatModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
8
|
-
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
9
|
-
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
10
|
-
- none: "none";
|
|
11
|
-
- low: "low";
|
|
12
|
-
- medium: "medium";
|
|
13
|
-
- high: "high";
|
|
14
|
-
- xhigh: "xhigh";
|
|
15
|
-
- }>>;
|
|
16
|
-
+ reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
17
|
-
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
-
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
20
|
-
@@ -82,13 +76,7 @@ type XaiResponsesModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | 'grok-4.3' | '
|
|
21
|
-
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
22
|
-
*/
|
|
23
|
-
declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
24
|
-
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
25
|
-
- none: "none";
|
|
26
|
-
- low: "low";
|
|
27
|
-
- medium: "medium";
|
|
28
|
-
- high: "high";
|
|
29
|
-
- xhigh: "xhigh";
|
|
30
|
-
- }>>;
|
|
31
|
-
+ reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
32
|
-
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
-
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
34
|
-
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
35
|
-
@@ -97,6 +85,7 @@ declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
36
|
-
}>>;
|
|
37
|
-
store: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
previousResponseId: z.ZodOptional<z.ZodString>;
|
|
39
|
-
+ promptCacheKey: z.ZodOptional<z.ZodString>;
|
|
40
|
-
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
41
|
-
"file_search_call.results": "file_search_call.results";
|
|
42
|
-
}>>>>;
|
|
43
|
-
diff --git a/dist/index.d.ts b/dist/index.d.ts
|
|
44
|
-
index e9c9916..b2cefd4 100644
|
|
45
|
-
--- a/dist/index.d.ts
|
|
46
|
-
+++ b/dist/index.d.ts
|
|
47
|
-
@@ -5,13 +5,7 @@ import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
48
|
-
|
|
49
|
-
type XaiChatModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
50
|
-
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
51
|
-
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
- none: "none";
|
|
53
|
-
- low: "low";
|
|
54
|
-
- medium: "medium";
|
|
55
|
-
- high: "high";
|
|
56
|
-
- xhigh: "xhigh";
|
|
57
|
-
- }>>;
|
|
58
|
-
+ reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
59
|
-
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
@@ -82,13 +76,7 @@ type XaiResponsesModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | 'grok-4.3' | '
|
|
63
|
-
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
64
|
-
*/
|
|
65
|
-
declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
66
|
-
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
67
|
-
- none: "none";
|
|
68
|
-
- low: "low";
|
|
69
|
-
- medium: "medium";
|
|
70
|
-
- high: "high";
|
|
71
|
-
- xhigh: "xhigh";
|
|
72
|
-
- }>>;
|
|
73
|
-
+ reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
74
|
-
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
-
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
77
|
-
@@ -97,6 +85,7 @@ declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
78
|
-
}>>;
|
|
79
|
-
store: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
previousResponseId: z.ZodOptional<z.ZodString>;
|
|
81
|
-
+ promptCacheKey: z.ZodOptional<z.ZodString>;
|
|
82
|
-
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
83
|
-
"file_search_call.results": "file_search_call.results";
|
|
84
|
-
}>>>>;
|
|
85
|
-
diff --git a/dist/index.js b/dist/index.js
|
|
86
|
-
index d5eb865..13ad9ca 100644
|
|
87
|
-
--- a/dist/index.js
|
|
88
|
-
+++ b/dist/index.js
|
|
89
|
-
@@ -274,7 +274,7 @@ var searchSourceSchema = import_v42.z.discriminatedUnion("type", [
|
|
90
|
-
rssSourceSchema
|
|
91
|
-
]);
|
|
92
|
-
var xaiLanguageModelChatOptions = import_v42.z.object({
|
|
93
|
-
- reasoningEffort: import_v42.z.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
94
|
-
+ reasoningEffort: import_v42.z.string().optional(),
|
|
95
|
-
logprobs: import_v42.z.boolean().optional(),
|
|
96
|
-
topLogprobs: import_v42.z.number().int().min(0).max(8).optional(),
|
|
97
|
-
serviceTier: import_v42.z.enum(["default", "priority"]).optional(),
|
|
98
|
-
@@ -1162,6 +1162,14 @@ async function convertToXaiResponsesInput({
|
|
99
|
-
type: "input_file",
|
|
100
|
-
file_url: block.data.toString()
|
|
101
|
-
});
|
|
102
|
-
+ } else if (block.mediaType === "application/pdf") {
|
|
103
|
-
+ contentParts.push({
|
|
104
|
-
+ type: "input_file",
|
|
105
|
-
+ ...typeof block.data === "string" && block.data.startsWith("file-") ? { file_id: block.data } : {
|
|
106
|
-
+ filename: block.filename ?? "file",
|
|
107
|
-
+ file_data: `data:application/pdf;base64,${(0, import_provider_utils5.convertToBase64)(block.data)}`
|
|
108
|
-
+ }
|
|
109
|
-
+ });
|
|
110
|
-
} else {
|
|
111
|
-
throw new import_provider4.UnsupportedFunctionalityError({
|
|
112
|
-
functionality: `file part media type ${block.mediaType} as inline data (xAI Responses requires a URL or a Files API reference for non-image files)`
|
|
113
|
-
@@ -1846,7 +1854,7 @@ var xaiLanguageModelResponsesOptions = import_v48.z.object({
|
|
114
|
-
* models support reasoning effort; see xAI's docs for the values each model
|
|
115
|
-
* accepts. `xhigh` is currently only supported by `grok-4.6`.
|
|
116
|
-
*/
|
|
117
|
-
- reasoningEffort: import_v48.z.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
118
|
-
+ reasoningEffort: import_v48.z.string().optional(),
|
|
119
|
-
logprobs: import_v48.z.boolean().optional(),
|
|
120
|
-
topLogprobs: import_v48.z.number().int().min(0).max(8).optional(),
|
|
121
|
-
serviceTier: import_v48.z.enum(["default", "priority"]).optional(),
|
|
122
|
-
@@ -1861,6 +1869,10 @@ var xaiLanguageModelResponsesOptions = import_v48.z.object({
|
|
123
|
-
* The ID of the previous response from the model.
|
|
124
|
-
*/
|
|
125
|
-
previousResponseId: import_v48.z.string().optional(),
|
|
126
|
-
+ /**
|
|
127
|
-
+ * A stable key used by xAI to improve prompt cache routing.
|
|
128
|
-
+ */
|
|
129
|
-
+ promptCacheKey: import_v48.z.string().optional(),
|
|
130
|
-
/**
|
|
131
|
-
* Specify additional output data to include in the model response.
|
|
132
|
-
* Example values: 'file_search_call.results'.
|
|
133
|
-
@@ -2288,6 +2300,9 @@ var XaiResponsesLanguageModel = class {
|
|
134
|
-
...options.previousResponseId != null && {
|
|
135
|
-
previous_response_id: options.previousResponseId
|
|
136
|
-
},
|
|
137
|
-
+ ...options.promptCacheKey != null && {
|
|
138
|
-
+ prompt_cache_key: options.promptCacheKey
|
|
139
|
-
+ },
|
|
140
|
-
...options.serviceTier != null && {
|
|
141
|
-
service_tier: options.serviceTier
|
|
142
|
-
}
|
|
143
|
-
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
144
|
-
index 1b24818..afb67cc 100644
|
|
145
|
-
--- a/dist/index.mjs
|
|
146
|
-
+++ b/dist/index.mjs
|
|
147
|
-
@@ -258,7 +258,7 @@ var searchSourceSchema = z2.discriminatedUnion("type", [
|
|
148
|
-
rssSourceSchema
|
|
149
|
-
]);
|
|
150
|
-
var xaiLanguageModelChatOptions = z2.object({
|
|
151
|
-
- reasoningEffort: z2.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
152
|
-
+ reasoningEffort: z2.string().optional(),
|
|
153
|
-
logprobs: z2.boolean().optional(),
|
|
154
|
-
topLogprobs: z2.number().int().min(0).max(8).optional(),
|
|
155
|
-
serviceTier: z2.enum(["default", "priority"]).optional(),
|
|
156
|
-
@@ -1165,6 +1165,14 @@ async function convertToXaiResponsesInput({
|
|
157
|
-
type: "input_file",
|
|
158
|
-
file_url: block.data.toString()
|
|
159
|
-
});
|
|
160
|
-
+ } else if (block.mediaType === "application/pdf") {
|
|
161
|
-
+ contentParts.push({
|
|
162
|
-
+ type: "input_file",
|
|
163
|
-
+ ...typeof block.data === "string" && block.data.startsWith("file-") ? { file_id: block.data } : {
|
|
164
|
-
+ filename: block.filename ?? "file",
|
|
165
|
-
+ file_data: `data:application/pdf;base64,${convertToBase642(block.data)}`
|
|
166
|
-
+ }
|
|
167
|
-
+ });
|
|
168
|
-
} else {
|
|
169
|
-
throw new UnsupportedFunctionalityError3({
|
|
170
|
-
functionality: `file part media type ${block.mediaType} as inline data (xAI Responses requires a URL or a Files API reference for non-image files)`
|
|
171
|
-
@@ -1849,7 +1857,7 @@ var xaiLanguageModelResponsesOptions = z8.object({
|
|
172
|
-
* models support reasoning effort; see xAI's docs for the values each model
|
|
173
|
-
* accepts. `xhigh` is currently only supported by `grok-4.6`.
|
|
174
|
-
*/
|
|
175
|
-
- reasoningEffort: z8.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
176
|
-
+ reasoningEffort: z8.string().optional(),
|
|
177
|
-
logprobs: z8.boolean().optional(),
|
|
178
|
-
topLogprobs: z8.number().int().min(0).max(8).optional(),
|
|
179
|
-
serviceTier: z8.enum(["default", "priority"]).optional(),
|
|
180
|
-
@@ -1864,6 +1872,10 @@ var xaiLanguageModelResponsesOptions = z8.object({
|
|
181
|
-
* The ID of the previous response from the model.
|
|
182
|
-
*/
|
|
183
|
-
previousResponseId: z8.string().optional(),
|
|
184
|
-
+ /**
|
|
185
|
-
+ * A stable key used by xAI to improve prompt cache routing.
|
|
186
|
-
+ */
|
|
187
|
-
+ promptCacheKey: z8.string().optional(),
|
|
188
|
-
/**
|
|
189
|
-
* Specify additional output data to include in the model response.
|
|
190
|
-
* Example values: 'file_search_call.results'.
|
|
191
|
-
@@ -2309,6 +2321,9 @@ var XaiResponsesLanguageModel = class {
|
|
192
|
-
...options.previousResponseId != null && {
|
|
193
|
-
previous_response_id: options.previousResponseId
|
|
194
|
-
},
|
|
195
|
-
+ ...options.promptCacheKey != null && {
|
|
196
|
-
+ prompt_cache_key: options.promptCacheKey
|
|
197
|
-
+ },
|
|
198
|
-
...options.serviceTier != null && {
|
|
199
|
-
service_tier: options.serviceTier
|
|
200
|
-
}
|
|
201
|
-
diff --git a/src/responses/convert-to-xai-responses-input.ts b/src/responses/convert-to-xai-responses-input.ts
|
|
202
|
-
index 21af0cd..9b477ef 100644
|
|
203
|
-
--- a/src/responses/convert-to-xai-responses-input.ts
|
|
204
|
-
+++ b/src/responses/convert-to-xai-responses-input.ts
|
|
205
|
-
@@ -78,6 +78,17 @@ export async function convertToXaiResponsesInput({
|
|
206
|
-
type: 'input_file',
|
|
207
|
-
file_url: block.data.toString(),
|
|
208
|
-
});
|
|
209
|
-
+ } else if (block.mediaType === 'application/pdf') {
|
|
210
|
-
+ contentParts.push({
|
|
211
|
-
+ type: 'input_file',
|
|
212
|
-
+ ...(typeof block.data === 'string' &&
|
|
213
|
-
+ block.data.startsWith('file-')
|
|
214
|
-
+ ? { file_id: block.data }
|
|
215
|
-
+ : {
|
|
216
|
-
+ filename: block.filename ?? 'file',
|
|
217
|
-
+ file_data: `data:application/pdf;base64,${convertToBase64(block.data)}`,
|
|
218
|
-
+ }),
|
|
219
|
-
+ });
|
|
220
|
-
} else {
|
|
221
|
-
throw new UnsupportedFunctionalityError({
|
|
222
|
-
functionality: `file part media type ${block.mediaType} as inline data (xAI Responses requires a URL or a Files API reference for non-image files)`,
|
|
223
|
-
diff --git a/src/responses/xai-responses-api.ts b/src/responses/xai-responses-api.ts
|
|
224
|
-
index 0bc0f91..aa3857a 100644
|
|
225
|
-
--- a/src/responses/xai-responses-api.ts
|
|
226
|
-
+++ b/src/responses/xai-responses-api.ts
|
|
227
|
-
@@ -31,7 +31,13 @@ export type XaiResponsesUserMessageContentPart =
|
|
228
|
-
image_url: string;
|
|
229
|
-
detail?: 'low' | 'high' | 'auto';
|
|
230
|
-
}
|
|
231
|
-
- | { type: 'input_file'; file_url: string };
|
|
232
|
-
+ | {
|
|
233
|
-
+ type: 'input_file';
|
|
234
|
-
+ file_url?: string;
|
|
235
|
-
+ file_id?: string;
|
|
236
|
-
+ file_data?: string;
|
|
237
|
-
+ filename?: string;
|
|
238
|
-
+ };
|
|
239
|
-
|
|
240
|
-
export type XaiResponsesUserMessage = {
|
|
241
|
-
role: 'user';
|
|
242
|
-
diff --git a/src/responses/xai-responses-language-model.ts b/src/responses/xai-responses-language-model.ts
|
|
243
|
-
index 06d6e5a..98a2d39 100644
|
|
244
|
-
--- a/src/responses/xai-responses-language-model.ts
|
|
245
|
-
+++ b/src/responses/xai-responses-language-model.ts
|
|
246
|
-
@@ -201,6 +201,9 @@ export class XaiResponsesLanguageModel implements LanguageModelV3 {
|
|
247
|
-
...(options.previousResponseId != null && {
|
|
248
|
-
previous_response_id: options.previousResponseId,
|
|
249
|
-
}),
|
|
250
|
-
+ ...(options.promptCacheKey != null && {
|
|
251
|
-
+ prompt_cache_key: options.promptCacheKey,
|
|
252
|
-
+ }),
|
|
253
|
-
...(options.serviceTier != null && {
|
|
254
|
-
service_tier: options.serviceTier,
|
|
255
|
-
}),
|
|
256
|
-
diff --git a/src/responses/xai-responses-options.ts b/src/responses/xai-responses-options.ts
|
|
257
|
-
index 6d52f46..9577200 100644
|
|
258
|
-
--- a/src/responses/xai-responses-options.ts
|
|
259
|
-
+++ b/src/responses/xai-responses-options.ts
|
|
260
|
-
@@ -22,9 +22,7 @@ export const xaiLanguageModelResponsesOptions = z.object({
|
|
261
|
-
* models support reasoning effort; see xAI's docs for the values each model
|
|
262
|
-
* accepts. `xhigh` is currently only supported by `grok-4.6`.
|
|
263
|
-
*/
|
|
264
|
-
- reasoningEffort: z
|
|
265
|
-
- .enum(['none', 'low', 'medium', 'high', 'xhigh'])
|
|
266
|
-
- .optional(),
|
|
267
|
-
+ reasoningEffort: z.string().optional(),
|
|
268
|
-
logprobs: z.boolean().optional(),
|
|
269
|
-
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
270
|
-
serviceTier: z.enum(['default', 'priority']).optional(),
|
|
271
|
-
@@ -39,6 +37,10 @@ export const xaiLanguageModelResponsesOptions = z.object({
|
|
272
|
-
* The ID of the previous response from the model.
|
|
273
|
-
*/
|
|
274
|
-
previousResponseId: z.string().optional(),
|
|
275
|
-
+ /**
|
|
276
|
-
+ * A stable key used by xAI to improve prompt cache routing.
|
|
277
|
-
+ */
|
|
278
|
-
+ promptCacheKey: z.string().optional(),
|
|
279
|
-
/**
|
|
280
|
-
* Specify additional output data to include in the model response.
|
|
281
|
-
* Example values: 'file_search_call.results'.
|
|
282
|
-
diff --git a/src/xai-chat-options.ts b/src/xai-chat-options.ts
|
|
283
|
-
index f3f1237..adb6ada 100644
|
|
284
|
-
--- a/src/xai-chat-options.ts
|
|
285
|
-
+++ b/src/xai-chat-options.ts
|
|
286
|
-
@@ -54,9 +54,7 @@ const searchSourceSchema = z.discriminatedUnion('type', [
|
|
287
|
-
|
|
288
|
-
// xai-specific provider options
|
|
289
|
-
export const xaiLanguageModelChatOptions = z.object({
|
|
290
|
-
- reasoningEffort: z
|
|
291
|
-
- .enum(['none', 'low', 'medium', 'high', 'xhigh'])
|
|
292
|
-
- .optional(),
|
|
293
|
-
+ reasoningEffort: z.string().optional(),
|
|
294
|
-
logprobs: z.boolean().optional(),
|
|
295
|
-
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
296
|
-
|