promptfoo 0.120.21 → 0.120.23
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/src/{ListApp-ChupNNB3.js → ListApp-55OAHww3.js} +1 -1
- package/dist/src/{accounts-CjU7QSnv.js → accounts-BMHY0nF5.js} +5 -5
- package/dist/src/{accounts-DYMHC4iY.js → accounts-CYqHD7X1.js} +4 -4
- package/dist/src/{accounts-uWRxEv-D.cjs → accounts-TGrHBZU9.cjs} +4 -4
- package/dist/src/{agentic-utils-BMbQVVd4.js → agentic-utils-BcSgvBPs.js} +2 -2
- package/dist/src/{agents-BJxm0Kcs.cjs → agents-BW4zv9Ig.cjs} +3 -3
- package/dist/src/{agents-DABC7ROH.js → agents-BbG-lpzK.js} +6 -6
- package/dist/src/{agents-DGQULdoA.js → agents-CUB87CA8.js} +5 -5
- package/dist/src/{agents-CJ4BY_QU.js → agents-ClpNGuau.js} +7 -7
- package/dist/src/{agents-CzCD5974.cjs → agents-d76o9WLl.cjs} +6 -6
- package/dist/src/{agents-BNSS1kSZ.js → agents-v7_Jh18K.js} +3 -3
- package/dist/src/{aimlapi-CnBWjM7x.js → aimlapi-BBN3jHiV.js} +11 -11
- package/dist/src/{aimlapi-ABHUqmBg.cjs → aimlapi-DWjl0adX.cjs} +11 -11
- package/dist/src/{aimlapi-B2qJXUsC.js → aimlapi-E-FZoqH0.js} +14 -14
- package/dist/src/app/assets/index-CbpQqvt4.css +1 -0
- package/dist/src/app/assets/{index-BVE859O5.js → index-DoWPf01I.js} +71 -71
- package/dist/src/app/index.html +2 -2
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-BT9aSeWg.js → audio-B0lJd7ce.js} +4 -4
- package/dist/src/{audio-CSrI_LFf.js → audio-CwbC4E6I.js} +3 -3
- package/dist/src/{audio-DSV364HB.cjs → audio-TfpCt0uC.cjs} +3 -3
- package/dist/src/{base-NFXflrMy.js → base-BHLggB84.js} +2 -2
- package/dist/src/{base-CRrQ15eu.cjs → base-B_pJcCDc.cjs} +2 -2
- package/dist/src/{base-d8hHSpEx.js → base-DRgXuujd.js} +2 -2
- package/dist/src/{blobs-Dznj-8xW.js → blobs-BHstP0Ep.js} +2 -2
- package/dist/src/{blobs-D-Neij7m.cjs → blobs-BPAqMoU_.cjs} +2 -2
- package/dist/src/{blobs-DC2sBLv8.js → blobs-Bey6TGVi.js} +2 -2
- package/dist/src/{cache-xb4oZe27.js → cache-BTdTl56j.js} +2 -2
- package/dist/src/{cache-DYJRe0Jt.cjs → cache-BnrNlhzE.cjs} +2 -2
- package/dist/src/{cache-aKR8pp5y.js → cache-C5LeIjZl.js} +2 -2
- package/dist/src/{cache-CMvgAnSi.js → cache-CsW_9RgN.js} +2 -2
- package/dist/src/cache-Da_mTEGH.cjs +6 -0
- package/dist/src/{cache-scuP1IRq.js → cache-DfI0xG_n.js} +3 -3
- package/dist/src/{chat-BbgGuvwu.js → chat-BIj6_WPH.js} +10 -10
- package/dist/src/{chat-CfJU9hHo.cjs → chat-B_-w6xgb.cjs} +10 -10
- package/dist/src/{chat-Du_GyqZe.js → chat-BktepvuQ.js} +13 -13
- package/dist/src/{chat-DyjTngG2.js → chat-CiakYWhZ.js} +10 -10
- package/dist/src/{chat-BH8Fxyap.js → chat-D5l2blZK.js} +8 -8
- package/dist/src/{chat-Biz16BQv.cjs → chat-QHQ-K-Fi.cjs} +8 -8
- package/dist/src/{chatkit-BpumZ2Dz.js → chatkit-DlOZ-eNb.js} +3 -3
- package/dist/src/{chatkit-D9AWcI4P.js → chatkit-IWIuhxFE.js} +3 -3
- package/dist/src/{chatkit-Wzo9zOq7.cjs → chatkit-yeVtURUi.cjs} +3 -3
- package/dist/src/{claude-agent-sdk-CL5NzJEu.js → claude-agent-sdk-BZ0GjlPY.js} +11 -11
- package/dist/src/{claude-agent-sdk-BW-YEYQi.cjs → claude-agent-sdk-D3AZJyZ7.cjs} +8 -8
- package/dist/src/{claude-agent-sdk-CdRG6b7t.js → claude-agent-sdk-wvsRgO29.js} +8 -8
- package/dist/src/{cloud-UwfmA0Ne.js → cloud-BKfo1A2t.js} +2 -2
- package/dist/src/{cloud-1cbcFXE9.js → cloud-DPowlnHl.js} +1 -1
- package/dist/src/{cloudflare-ai-D2Wlbus6.cjs → cloudflare-ai-CzAtX1Wg.cjs} +11 -11
- package/dist/src/{cloudflare-ai-BB77BUMD.js → cloudflare-ai-D-IEjw5k.js} +11 -11
- package/dist/src/{cloudflare-ai-DXTxK3ou.js → cloudflare-ai-DxHmIJbZ.js} +14 -14
- package/dist/src/{cloudflare-gateway-D5IjGRjZ.cjs → cloudflare-gateway-CIfquW2o.cjs} +12 -12
- package/dist/src/{cloudflare-gateway-Tn2OEgYQ.js → cloudflare-gateway-DkjC8LZF.js} +12 -12
- package/dist/src/{cloudflare-gateway-DeZRwitI.js → cloudflare-gateway-DwJVgNWf.js} +15 -15
- package/dist/src/{codex-sdk-CKEQpQax.js → codex-sdk-BC5qbCjh.js} +3 -3
- package/dist/src/{codex-sdk-CDN8f3P9.js → codex-sdk-CBpm53B8.js} +2 -2
- package/dist/src/{codex-sdk-0QyM_fUf.cjs → codex-sdk-Cf5_CQch.cjs} +2 -2
- package/dist/src/{cometapi-CUq-lrPh.js → cometapi-6jLBOp4e.js} +15 -15
- package/dist/src/{cometapi-Bu_LOIac.js → cometapi-8HSWR5q_.js} +12 -12
- package/dist/src/{cometapi-RP8h5O2f.cjs → cometapi-iJEkEgpT.cjs} +12 -12
- package/dist/src/{completion-Dw-9jqz1.cjs → completion-C03fIkcR.cjs} +5 -5
- package/dist/src/{completion-H4ncr2bK.js → completion-CrKHW9hy.js} +5 -5
- package/dist/src/{completion-BTZ42lqL.js → completion-LTi0SiAy.js} +5 -5
- package/dist/src/{docker-kvFgJqkg.js → docker-Bf2VQOX5.js} +14 -14
- package/dist/src/{docker-NrVUpeWw.cjs → docker-BxmP6sGO.cjs} +11 -11
- package/dist/src/{docker-B8zxQ12-.js → docker-DHazKolQ.js} +11 -11
- package/dist/src/{esm-Bwuh5HXW.js → esm-Lh6czAFT.js} +1 -1
- package/dist/src/{eval-TAOD_pvN.js → eval-4sIXLVZZ.js} +31 -19
- package/dist/src/eval-s_E4q6a8.js +16 -0
- package/dist/src/{evalResult-DnYa1RLp.js → evalResult-CRyeHpst.js} +6 -6
- package/dist/src/{evalResult-CFSvp3Zh.cjs → evalResult-CSucevrC.cjs} +7 -7
- package/dist/src/evalResult-DBhbtqZn.js +11 -0
- package/dist/src/evalResult-DKn_nY-a.js +13 -0
- package/dist/src/{evalResult-CnAP64o9.js → evalResult-DNXvhaKp.js} +6 -6
- package/dist/src/evalResult-DrPpo-zg.cjs +11 -0
- package/dist/src/{evaluator-q2_--POi.js → evaluator-BDY-i4ky.js} +29 -30
- package/dist/src/evaluator-CiDt-6H3.js +37 -0
- package/dist/src/{extractor-D_1s-Thr.js → extractor-HnP0pHfO.js} +81 -4
- package/dist/src/{extractor-B9uQA-6-.js → extractor-WvMabjRY.js} +81 -4
- package/dist/src/{extractor-DjxI7POm.cjs → extractor-wSeR47-c.cjs} +86 -3
- package/dist/src/{fetch-Cb-qQ7Hm.js → fetch-8fmzVUH3.js} +2 -2
- package/dist/src/{fetch-BIPrzD39.js → fetch-BMKSarK_.js} +11 -5
- package/dist/src/{fetch-MdGxb6Bv.cjs → fetch-BgYKpAJ7.cjs} +25 -7
- package/dist/src/{fetch-Cbz8ESXD.js → fetch-CE0K47nJ.js} +1 -1
- package/dist/src/{fetch-TcCC0nEJ.js → fetch-DKQm7iwv.js} +11 -5
- package/dist/src/fetch-GeRV0LDI.cjs +4 -0
- package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-CzcPkiKZ.js} +1 -1
- package/dist/src/{formatDuration-CGa0ZDQ8.js → formatDuration-CCiZ-wBY.js} +1 -1
- package/dist/src/{genaiTracer-zK0Mtd_D.cjs → genaiTracer-BQ8AmajD.cjs} +1 -1
- package/dist/src/{genaiTracer-CNawybn-.js → genaiTracer-Ce19n68P.js} +1 -1
- package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-foKtbVa2.js} +1 -1
- package/dist/src/{graders-DycNkUZ_.js → graders-CEF_ce6x.js} +32 -26
- package/dist/src/graders-CzoftmVg.js +35 -0
- package/dist/src/{graders-C9Ni3pNQ.cjs → graders-DOFEkq6l.cjs} +34 -28
- package/dist/src/graders-DuTWgLQF.cjs +32 -0
- package/dist/src/graders-ZhEpUtuK.js +33 -0
- package/dist/src/{graders-CG50NgEB.js → graders-jFPLMexK.js} +36 -30
- package/dist/src/{image-CxD58J63.js → image-0RV3qqTK.js} +6 -6
- package/dist/src/{image-CHGpqpC6.js → image-9Thqn5aj.js} +3 -3
- package/dist/src/{image-BmMQZgoF.js → image-BJJW-zOa.js} +4 -4
- package/dist/src/{image-CPL1masV.cjs → image-BVyYHTQG.cjs} +3 -3
- package/dist/src/{image-Dg-oq_2F.js → image-Dd0EQRYU.js} +6 -6
- package/dist/src/{image-CpQ-fJt3.cjs → image-VWd0wZmz.cjs} +6 -6
- package/dist/src/index.cjs +177 -105
- package/dist/src/index.js +173 -101
- package/dist/src/{interactiveCheck-BZbMvE6i.js → interactiveCheck-CjK2R4rB.js} +1 -1
- package/dist/src/{knowledgeBase-Dy1Ln178.cjs → knowledgeBase-BKA28wUv.cjs} +7 -7
- package/dist/src/{knowledgeBase-BXvPbeXF.js → knowledgeBase-D0nOGqRF.js} +7 -7
- package/dist/src/{knowledgeBase-Csr92Wc4.js → knowledgeBase-aBIYgE4B.js} +8 -8
- package/dist/src/{litellm-Dcc3mt1B.js → litellm-BiXCNyII.js} +11 -11
- package/dist/src/{litellm-CR8i8YRn.js → litellm-QSopB7EE.js} +14 -14
- package/dist/src/{litellm-QthJT0fA.cjs → litellm-vZYPcEUQ.cjs} +11 -11
- package/dist/src/{luma-ray-DpAL4igs.cjs → luma-ray-CRKJx6ue.cjs} +10 -11
- package/dist/src/{luma-ray-vv5ggMvl.js → luma-ray-DmnPkNon.js} +10 -11
- package/dist/src/{luma-ray-DbAhu9zC.js → luma-ray-Dvnqlb9n.js} +9 -10
- package/dist/src/main.js +166 -106
- package/dist/src/{messages-DkV1dizA.js → messages-BaxI3gI5.js} +10 -10
- package/dist/src/{messages-D4Cu-Nxe.cjs → messages-CvFzyCty.cjs} +10 -10
- package/dist/src/{messages-9ik4NuJ_.js → messages-DT1yyWfS.js} +10 -10
- package/dist/src/{meteor-DLCdreag.js → meteor-0cLf9TIn.js} +1 -1
- package/dist/src/{meteor-Dj8cTkU_.js → meteor-CBciquOS.js} +1 -1
- package/dist/src/{meteor-odmwVbyG.cjs → meteor-DRuEfzuQ.cjs} +1 -1
- package/dist/src/{nova-reel-B1c4YdE8.js → nova-reel-CnN4D-bY.js} +10 -11
- package/dist/src/{nova-reel-Bs903nib.cjs → nova-reel-XAkfcmhf.cjs} +10 -11
- package/dist/src/{nova-reel-mMroVw7W.js → nova-reel-YEEqZu4z.js} +9 -10
- package/dist/src/{nova-sonic-BLgglDkA.js → nova-sonic-Ci-VR-K3.js} +6 -6
- package/dist/src/{nova-sonic-rZe65fKE.js → nova-sonic-Cjfvm57T.js} +7 -7
- package/dist/src/{nova-sonic-BylXGNj-.cjs → nova-sonic-brE_2yrZ.cjs} +6 -6
- package/dist/src/{openai-eZz8QsxY.cjs → openai-BjpdxIOG.cjs} +1 -1
- package/dist/src/{openai-CQozD_Ef.js → openai-CitF-gEN.js} +1 -1
- package/dist/src/{openai-D_5h8sBa.js → openai-Cv9pEKxp.js} +1 -1
- package/dist/src/{opencode-sdk-G-dBq9xe.js → opencode-sdk-BkXJb52a.js} +4 -4
- package/dist/src/{opencode-sdk-B3o0jNxx.cjs → opencode-sdk-CrlvqSy2.cjs} +4 -4
- package/dist/src/{opencode-sdk-lf_9VEhj.js → opencode-sdk-DRMuqbLx.js} +6 -6
- package/dist/src/{otlpReceiver-CBZNmyZi.js → otlpReceiver-BCKiiwct.js} +5 -5
- package/dist/src/{otlpReceiver-CO1TzzW1.js → otlpReceiver-BTVVyjnA.js} +4 -4
- package/dist/src/{otlpReceiver-COmdVimi.cjs → otlpReceiver-DXqKPf2U.cjs} +4 -4
- package/dist/src/{providerRegistry-5UB8YVkk.js → providerRegistry-BdKWcUa8.js} +1 -1
- package/dist/src/{providerRegistry-gU7gOAJI.js → providerRegistry-D32Lt9vp.js} +1 -1
- package/dist/src/{providerRegistry-DFXamjVO.cjs → providerRegistry-HGQd2MF6.cjs} +1 -1
- package/dist/src/{providers-Bz0U4NGd.cjs → providers-BF4aullZ.cjs} +114 -132
- package/dist/src/providers-BmFckJq8.cjs +31 -0
- package/dist/src/{providers-CHciOV4f.js → providers-BtbT8bDb.js} +77 -95
- package/dist/src/{providers-D8qKkVu_.js → providers-CYssBaa_.js} +82 -100
- package/dist/src/providers-DaDZ1iQw.js +31 -0
- package/dist/src/providers-Ds-h-S1b.js +33 -0
- package/dist/src/{pythonUtils-mprm8p4h.js → pythonUtils-B9JA-gsC.js} +2 -2
- package/dist/src/{quiverai-DnlaJG8H.js → quiverai-BiDa0kiF.js} +10 -10
- package/dist/src/{quiverai-3rtm1glP.js → quiverai-DTtLknat.js} +13 -13
- package/dist/src/{quiverai-BIveJ-Ql.cjs → quiverai-z8oPMSUZ.cjs} +10 -10
- package/dist/src/{render-D5t2ogwP.js → render-D2710HbA.js} +2 -2
- package/dist/src/rubyUtils-BLd6EE1u.cjs +5 -0
- package/dist/src/{rubyUtils-D1DBBgSr.js → rubyUtils-CVELPvUH.js} +2 -2
- package/dist/src/{rubyUtils-Cus5EGPX.js → rubyUtils-Dn6MGcsk.js} +2 -2
- package/dist/src/{rubyUtils-CI4Y5f08.js → rubyUtils-LBsk3zIm.js} +1 -1
- package/dist/src/{rubyUtils-CWkecmDB.js → rubyUtils-_t9Gmf7U.js} +1 -1
- package/dist/src/{rubyUtils-DCci_Y0f.cjs → rubyUtils-rnCVDgH-.cjs} +1 -1
- package/dist/src/{sagemaker-BvwRP8TL.js → sagemaker-D5f6K309.js} +11 -11
- package/dist/src/{sagemaker-BsttQmAf.cjs → sagemaker-DwJOnUlQ.cjs} +11 -11
- package/dist/src/{sagemaker-B4hvJgkV.js → sagemaker-dygdRScC.js} +17 -17
- package/dist/src/{scanner-CPosIITM.js → scanner-D__U7qyj.js} +9 -9
- package/dist/src/server/index.js +265 -129
- package/dist/src/server-B0dYFkhY.cjs +6 -0
- package/dist/src/{server-ByLwfSDf.cjs → server-BRPZ0ZqY.cjs} +3 -3
- package/dist/src/{server-Bb83s34G.js → server-BZJ_IEiK.js} +4 -4
- package/dist/src/{server-BKdsd70B.js → server-Bo3rtriL.js} +3 -3
- package/dist/src/server-DZYvmL1z.js +6 -0
- package/dist/src/server-DlTe_Yz5.js +8 -0
- package/dist/src/{signal-B8hvvb8w.js → signal-C9qT0qiq.js} +2 -2
- package/dist/src/{slack-BblBpsIz.cjs → slack-D1F9Y7CH.cjs} +1 -1
- package/dist/src/{slack-D-bNCtTa.js → slack-DkAF58Tr.js} +1 -1
- package/dist/src/{slack-Ba3gil_6.js → slack-Ed1yyt_j.js} +1 -1
- package/dist/src/{store-W4yZqv_e.js → store-BpNCvdGu.js} +2 -2
- package/dist/src/store-BvASVHpa.cjs +6 -0
- package/dist/src/{store-l9-mIRC-.cjs → store-BwsF10Db.cjs} +2 -2
- package/dist/src/store-CDxVyNyD.js +6 -0
- package/dist/src/store-CXxKOQ8V.js +7 -0
- package/dist/src/{store-CaNRmI5T.js → store-Dm8qSYzq.js} +2 -2
- package/dist/src/{tables-DZWWveaJ.js → tables-B0wvxP8N.js} +2 -2
- package/dist/src/{tables-BCcp2r48.js → tables-CMOPSC5_.js} +2 -2
- package/dist/src/{tables-D_VmN-ui.cjs → tables-D_nKFrHt.cjs} +2 -2
- package/dist/src/{telemetry-DrSTNTH-.cjs → telemetry-B9G9VzVT.cjs} +3 -3
- package/dist/src/telemetry-CGO4vCCz.js +8 -0
- package/dist/src/telemetry-CXarb10F.cjs +6 -0
- package/dist/src/telemetry-DKtQFHz8.js +6 -0
- package/dist/src/{telemetry-CmGyDaxF.js → telemetry-DMGVtU7z.js} +3 -3
- package/dist/src/{telemetry-CB8ltkOD.js → telemetry-oV0dEJ2S.js} +3 -3
- package/dist/src/{text-C1cXk9ij.js → text-DuYSUYPB.js} +1 -1
- package/dist/src/{text-Dm78AVGG.js → text-Dx0GJOCN.js} +1 -1
- package/dist/src/{text-DF2hMKdg.cjs → text-PYISqVm1.cjs} +1 -1
- package/dist/src/{tokenUsageUtils-DFp2VFtG.cjs → tokenUsageUtils-BtZd3sP7.cjs} +1 -1
- package/dist/src/{tokenUsageUtils-C9fIWtvn.js → tokenUsageUtils-DoinwgKF.js} +1 -1
- package/dist/src/{tokenUsageUtils-BQVp2uKF.js → tokenUsageUtils-cFdLMERB.js} +1 -1
- package/dist/src/{transcription-BExRps8_.js → transcription-C5sJed5S.js} +7 -7
- package/dist/src/{transcription-B4GbFkhb.cjs → transcription-DEiYnjqG.cjs} +7 -7
- package/dist/src/{transcription-CpuRKcIu.js → transcription-Dcv2GYgI.js} +10 -10
- package/dist/src/{transform-BzepVlkX.js → transform-BFPYuBaW.js} +4 -4
- package/dist/src/{transform-BwedQA8W.js → transform-Cpk3BVib.js} +3 -3
- package/dist/src/{transform-B-AYIQmM.js → transform-DWBbTh_M.js} +3 -3
- package/dist/src/{transform-1g7fEAge.js → transform-DZI2t8-9.js} +3 -3
- package/dist/src/{transform-B5HUD86U.cjs → transform-DeVdMzaA.cjs} +3 -3
- package/dist/src/{transformersAvailability-B5gZ2aG-.cjs → transformersAvailability-BaoWHpu1.cjs} +1 -1
- package/dist/src/{transformersAvailability-BHP0aLcv.js → transformersAvailability-DtpwoeFC.js} +1 -1
- package/dist/src/{transformersAvailability-CA173HU7.js → transformersAvailability-O2YaCv9Z.js} +1 -1
- package/dist/src/{types-n3ttAnOa.js → types-BZz0C6rq.js} +3 -18
- package/dist/src/{types-DAmPdu4_.cjs → types-Cixl-wRO.cjs} +1 -22
- package/dist/src/{types-BlspLqbN.js → types-l7snZgzv.js} +2 -17
- package/dist/src/{util-Cd2vI7ii.js → util-BR59kcWy.js} +3 -3
- package/dist/src/{util-BnF-xRPi.js → util-BjTDLTac.js} +3 -3
- package/dist/src/{util-CwsTKPXi.js → util-CSvDts2m.js} +3 -3
- package/dist/src/{util-KE6uFWHG.cjs → util-CfLcBZEA.cjs} +3 -3
- package/dist/src/{util-BXjq8vOq.js → util-Czrn_1en.js} +3 -3
- package/dist/src/{util-BT0p5c9X.cjs → util-Dxwavk84.cjs} +3 -3
- package/dist/src/{util-DX58t30T.js → util-GpiGNWSj.js} +17 -5
- package/dist/src/{util-B-Yo0qzc.cjs → util-RfCZM4TD.cjs} +22 -4
- package/dist/src/{util-CyzW5ayt.js → util-UxC1pDDt.js} +20 -8
- package/dist/src/{utils-HdRSruG0.js → utils-2CdNTp-a.js} +2 -2
- package/dist/src/{utils-BSpcJB4B.cjs → utils-6lWwNARy.cjs} +2 -2
- package/dist/src/{utils-BWOFfOel.js → utils-BMIgqY6C.js} +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -29
- package/dist/src/app/assets/index-CFq6nz43.css +0 -1
- package/dist/src/cache-BZYapLG-.cjs +0 -6
- package/dist/src/eval-g5SH3NBa.js +0 -16
- package/dist/src/evalResult-Bt2fmj0V.js +0 -9
- package/dist/src/evalResult-DRNH7Jui.js +0 -10
- package/dist/src/evalResult-DqLWyktN.cjs +0 -9
- package/dist/src/evaluator-DIenqH86.js +0 -37
- package/dist/src/fetch-gmneHrJc.cjs +0 -4
- package/dist/src/graders-BHcgLz2P.js +0 -35
- package/dist/src/graders-BjBhwJOb.cjs +0 -32
- package/dist/src/graders-DEjGX1uY.js +0 -33
- package/dist/src/providers-BBGwMMzj.js +0 -33
- package/dist/src/providers-BR5P_qep.cjs +0 -31
- package/dist/src/providers-CDib9hVp.js +0 -31
- package/dist/src/rubyUtils-DZo4ik6p.cjs +0 -5
- package/dist/src/server-B5aIhzYk.cjs +0 -6
- package/dist/src/server-DJCw85s0.js +0 -8
- package/dist/src/server-DKj0QIm9.js +0 -6
- package/dist/src/store-Bo9FEBPO.js +0 -7
- package/dist/src/store-CqHttBql.js +0 -6
- package/dist/src/store-fsxOJl5O.cjs +0 -6
- package/dist/src/telemetry-B2uJOvMA.js +0 -8
- package/dist/src/telemetry-TZ0v6oGo.cjs +0 -6
- package/dist/src/telemetry-rP_n_bnZ.js +0 -6
- package/dist/src/time-CRRzn6vA.js +0 -9
- package/dist/src/time-CbtsO5_a.cjs +0 -21
- package/dist/src/time-CoOwN3kQ.js +0 -10
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { C as getEnvString, E as isCI, O as cliState_default, S as getEnvInt, T as getMaxEvalTimeMs, _ as summarizeEvaluateResultForLogging, b as getEnvBool, f as extractJsonObjects, g as safeJsonStringify, o as logger_default, p as getAjv, w as getEvalTimeoutMs } from "./logger-Bzi5o47S.js";
|
|
3
|
-
import {
|
|
3
|
+
import { C as DEFAULT_MAX_CONCURRENCY, N as VERSION, P as FILE_METADATA_KEY, _ as parseChatPrompt, c as sleep, m as isPromptfooSampleTarget, n as fetchWithRetries } from "./fetch-DKQm7iwv.js";
|
|
4
4
|
import { t as invariant } from "./invariant-DT20jrBd.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { r as
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { a as getActualPromptWithFallback, r as updateSignalFile } from "./signal-B8hvvb8w.js";
|
|
5
|
+
import { r as telemetry_default } from "./telemetry-oV0dEJ2S.js";
|
|
6
|
+
import { d as isGradingResult, p as isApiProvider, s as ResultFailureReason } from "./types-BZz0C6rq.js";
|
|
7
|
+
import { c as promptYesNo } from "./server-BZJ_IEiK.js";
|
|
8
|
+
import { A as renderPrompt, E as isBasicRefusal, F as TokenUsageTracker, I as createRateLimitRegistry, K as VertexChatProvider, L as createProviderRateLimitOptions, M as isPackagePath, N as loadFromPackage, P as redteamProviderManager, j as runExtensionHook, k as collectFileMetadata, q as AIStudioChatProvider, u as GoogleLiveProvider, v as checkExfilTracking, w as getSessionId } from "./providers-CYssBaa_.js";
|
|
9
|
+
import { o as getCache } from "./cache-BTdTl56j.js";
|
|
10
|
+
import { i as isJavascriptFile } from "./fileExtensions-CzcPkiKZ.js";
|
|
11
|
+
import { E as parseFileUrl, F as isAnthropicProvider, I as isGoogleProvider, L as isOpenAiProvider, R as isProviderAllowed, T as loadFunction, g as maybeLoadToolsFromExternalFile, w as getNunjucksEngine } from "./util-UxC1pDDt.js";
|
|
12
|
+
import { r as runPython } from "./pythonUtils-B9JA-gsC.js";
|
|
13
|
+
import { n as transform, r as getProcessShim, t as TransformInputType } from "./transform-BFPYuBaW.js";
|
|
14
|
+
import { $ as matchesSearchRubric, B as getAndCheckProvider, G as matchesContextFaithfulness, H as matchesAnswerRelevance, J as matchesFactuality, K as matchesContextRecall, Q as matchesPiScore, R as callProviderWithContext, U as matchesClassification, V as loadRubricPrompt, W as matchesClosedQa, X as matchesLlmRubric, Y as matchesGEval, Z as matchesModeration, at as DefaultSuggestionsProvider, dt as getFinalTest, et as matchesSelectBest, ft as loadFromJavaScriptFile, it as getDefaultProviders, lt as SUGGEST_PROMPTS_SYSTEM_MESSAGE, mt as resolveContext, n as getGraderById, nt as selectMaxScore, pt as processFileReference, q as matchesContextRelevance, tt as matchesSimilarity, ut as coerceString, z as fail } from "./graders-jFPLMexK.js";
|
|
15
|
+
import { i as generateIdFromPrompt } from "./utils-2CdNTp-a.js";
|
|
16
|
+
import { t as extractAndStoreBinaryData } from "./extractor-HnP0pHfO.js";
|
|
17
|
+
import { t as OpenAiChatCompletionProvider } from "./chat-BIj6_WPH.js";
|
|
18
|
+
import { a as createEmptyTokenUsage, i as createEmptyAssertions, n as accumulateResponseTokenUsage, o as normalizeTokenUsage, r as accumulateTokenUsage, t as accumulateAssertionTokenUsage } from "./tokenUsageUtils-DoinwgKF.js";
|
|
19
|
+
import { f as validateFunctionCall } from "./transform-DWBbTh_M.js";
|
|
20
|
+
import { l as validateFunctionCall$1 } from "./util-CSvDts2m.js";
|
|
21
|
+
import { n as getTraceStore } from "./store-Dm8qSYzq.js";
|
|
22
|
+
import { t as providerRegistry } from "./providerRegistry-D32Lt9vp.js";
|
|
23
|
+
import { n as runRuby } from "./rubyUtils-Dn6MGcsk.js";
|
|
24
|
+
import { a as getActualPromptWithFallback, r as updateSignalFile } from "./signal-C9qT0qiq.js";
|
|
26
25
|
import chalk from "chalk";
|
|
27
26
|
import fs, { createWriteStream } from "fs";
|
|
28
27
|
import path from "path";
|
|
@@ -260,7 +259,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
260
259
|
telemetry_default.record("feature_used", { feature: "tracing" });
|
|
261
260
|
try {
|
|
262
261
|
logger_default.debug("[EvaluatorTracing] Tracing configuration detected, starting OTLP receiver");
|
|
263
|
-
const { startOTLPReceiver } = await import("./otlpReceiver-
|
|
262
|
+
const { startOTLPReceiver } = await import("./otlpReceiver-BCKiiwct.js");
|
|
264
263
|
const port = testSuite.tracing.otlp.http.port || 4318;
|
|
265
264
|
const host = testSuite.tracing.otlp.http.host || "127.0.0.1";
|
|
266
265
|
logger_default.debug(`[EvaluatorTracing] Starting OTLP receiver on ${host}:${port}`);
|
|
@@ -283,7 +282,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
283
282
|
async function stopOtlpReceiverIfNeeded() {
|
|
284
283
|
if (otlpReceiverStarted) try {
|
|
285
284
|
logger_default.debug("[EvaluatorTracing] Stopping OTLP receiver");
|
|
286
|
-
const { stopOTLPReceiver } = await import("./otlpReceiver-
|
|
285
|
+
const { stopOTLPReceiver } = await import("./otlpReceiver-BCKiiwct.js");
|
|
287
286
|
await stopOTLPReceiver();
|
|
288
287
|
otlpReceiverStarted = false;
|
|
289
288
|
logger_default.info("[EvaluatorTracing] OTLP receiver stopped successfully");
|
|
@@ -318,7 +317,7 @@ async function generateTraceContextIfNeeded(test, evaluateOptions, testIdx, prom
|
|
|
318
317
|
}
|
|
319
318
|
if (!tracingEnabled) return null;
|
|
320
319
|
logger_default.debug("[EvaluatorTracing] Importing trace store");
|
|
321
|
-
const { getTraceStore } = await import("./store-
|
|
320
|
+
const { getTraceStore } = await import("./store-CXxKOQ8V.js");
|
|
322
321
|
const traceStore = getTraceStore();
|
|
323
322
|
const traceId = generateTraceId();
|
|
324
323
|
const spanId = generateSpanId();
|
|
@@ -2686,7 +2685,7 @@ const ASSERTION_HANDLERS = {
|
|
|
2686
2685
|
"llm-rubric": handleLlmRubric,
|
|
2687
2686
|
meteor: async (params) => {
|
|
2688
2687
|
try {
|
|
2689
|
-
const { handleMeteorAssertion } = await import("./meteor-
|
|
2688
|
+
const { handleMeteorAssertion } = await import("./meteor-0cLf9TIn.js");
|
|
2690
2689
|
return handleMeteorAssertion(params);
|
|
2691
2690
|
} catch (error) {
|
|
2692
2691
|
if (error instanceof Error && (error.message.includes("Cannot find module") || error.message.includes("natural\" package is required"))) return {
|
|
@@ -2816,7 +2815,7 @@ async function runAssertion({ prompt, provider, assertion, test, vars, latencyMs
|
|
|
2816
2815
|
};
|
|
2817
2816
|
}
|
|
2818
2817
|
else if (filePath.endsWith(".rb")) try {
|
|
2819
|
-
const { runRuby } = await import("./rubyUtils-
|
|
2818
|
+
const { runRuby } = await import("./rubyUtils-CVELPvUH.js");
|
|
2820
2819
|
valueFromScript = await runRuby(filePath, functionName || "get_assert", [output, context]);
|
|
2821
2820
|
logger_default.debug(`Ruby script ${filePath} output: ${valueFromScript}`);
|
|
2822
2821
|
} catch (error) {
|
|
@@ -4158,7 +4157,7 @@ var Evaluator = class {
|
|
|
4158
4157
|
const defaultProvider = testSuite.defaultTest.provider;
|
|
4159
4158
|
if (isApiProvider(defaultProvider)) testCase.provider = defaultProvider;
|
|
4160
4159
|
else if (typeof defaultProvider === "object" && defaultProvider.id) {
|
|
4161
|
-
const { loadApiProvider } = await import("./providers-
|
|
4160
|
+
const { loadApiProvider } = await import("./providers-Ds-h-S1b.js");
|
|
4162
4161
|
testCase.provider = await loadApiProvider(typeof defaultProvider.id === "function" ? defaultProvider.id() : defaultProvider.id, { options: defaultProvider });
|
|
4163
4162
|
} else testCase.provider = defaultProvider;
|
|
4164
4163
|
}
|
|
@@ -4233,7 +4232,7 @@ var Evaluator = class {
|
|
|
4233
4232
|
if (evalOption.test.assert?.some((a) => a.type === "max-score")) rowsWithMaxScoreAssertion.add(evalOption.testIdx);
|
|
4234
4233
|
}
|
|
4235
4234
|
if (cliState_default.resume && this.evalRecord.persisted) try {
|
|
4236
|
-
const { default: EvalResult } = await import("./evalResult-
|
|
4235
|
+
const { default: EvalResult } = await import("./evalResult-DKn_nY-a.js");
|
|
4237
4236
|
const completedPairs = await EvalResult.getCompletedIndexPairs(this.evalRecord.id, { excludeErrors: cliState_default.retryMode });
|
|
4238
4237
|
const originalCount = runEvalOptions.length;
|
|
4239
4238
|
for (let i = runEvalOptions.length - 1; i >= 0; i--) {
|
|
@@ -4778,4 +4777,4 @@ function evaluate(testSuite, evalRecord, options) {
|
|
|
4778
4777
|
|
|
4779
4778
|
//#endregion
|
|
4780
4779
|
export { runEval as a, readAssertions as c, isAllowedPrompt as i, renderMetricName as l, formatVarsForDisplay as n, doesPromptRefMatch as o, generateVarCombinations as r, assertions_default as s, evaluate as t, runAssertions as u };
|
|
4781
|
-
//# sourceMappingURL=evaluator-
|
|
4780
|
+
//# sourceMappingURL=evaluator-BDY-i4ky.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./chunk-DHDDz29n.js";
|
|
3
|
+
import "./logger-Bzi5o47S.js";
|
|
4
|
+
import "./fetch-DKQm7iwv.js";
|
|
5
|
+
import "./accounts-BMHY0nF5.js";
|
|
6
|
+
import "./cloud-BKfo1A2t.js";
|
|
7
|
+
import "./telemetry-oV0dEJ2S.js";
|
|
8
|
+
import "./types-BZz0C6rq.js";
|
|
9
|
+
import "./server-BZJ_IEiK.js";
|
|
10
|
+
import "./providers-CYssBaa_.js";
|
|
11
|
+
import "./cache-BTdTl56j.js";
|
|
12
|
+
import "./util-UxC1pDDt.js";
|
|
13
|
+
import "./esm-Lh6czAFT.js";
|
|
14
|
+
import "./pythonUtils-B9JA-gsC.js";
|
|
15
|
+
import "./transform-BFPYuBaW.js";
|
|
16
|
+
import "./graders-jFPLMexK.js";
|
|
17
|
+
import "./utils-2CdNTp-a.js";
|
|
18
|
+
import "./extractor-HnP0pHfO.js";
|
|
19
|
+
import "./genaiTracer-foKtbVa2.js";
|
|
20
|
+
import "./chat-BIj6_WPH.js";
|
|
21
|
+
import "./transform-DWBbTh_M.js";
|
|
22
|
+
import "./messages-DT1yyWfS.js";
|
|
23
|
+
import "./util-BR59kcWy.js";
|
|
24
|
+
import "./openai-Cv9pEKxp.js";
|
|
25
|
+
import "./util-CSvDts2m.js";
|
|
26
|
+
import "./completion-LTi0SiAy.js";
|
|
27
|
+
import "./blobs-Bey6TGVi.js";
|
|
28
|
+
import "./tables-B0wvxP8N.js";
|
|
29
|
+
import "./store-Dm8qSYzq.js";
|
|
30
|
+
import "./base-DRgXuujd.js";
|
|
31
|
+
import "./image-0RV3qqTK.js";
|
|
32
|
+
import "./providerRegistry-D32Lt9vp.js";
|
|
33
|
+
import "./rubyUtils-Dn6MGcsk.js";
|
|
34
|
+
import { a as runEval, i as isAllowedPrompt, n as formatVarsForDisplay, r as generateVarCombinations, t as evaluate } from "./evaluator-BDY-i4ky.js";
|
|
35
|
+
import "./signal-C9qT0qiq.js";
|
|
36
|
+
|
|
37
|
+
export { evaluate };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { b as getEnvBool, o as logger_default } from "./logger-Bzi5o47S.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as isLoggedIntoCloud } from "./accounts-BMHY0nF5.js";
|
|
4
|
+
import { i as cloudConfig } from "./cloud-BKfo1A2t.js";
|
|
5
|
+
import { a as BLOB_MAX_SIZE, i as storeBlob, o as BLOB_MIN_SIZE, r as recordBlobReference } from "./blobs-Bey6TGVi.js";
|
|
4
6
|
import { createHash } from "crypto";
|
|
5
7
|
|
|
6
8
|
//#region src/util/createHash.ts
|
|
@@ -14,6 +16,68 @@ function randomSequence(length = 3) {
|
|
|
14
16
|
return result;
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/blobs/remoteUpload.ts
|
|
21
|
+
function buildRemoteUrl() {
|
|
22
|
+
const baseUrl = cloudConfig.getApiHost();
|
|
23
|
+
const apiKey = cloudConfig.getApiKey();
|
|
24
|
+
if (!baseUrl || !apiKey || !isLoggedIntoCloud()) return null;
|
|
25
|
+
try {
|
|
26
|
+
return new URL("/api/blobs", baseUrl).toString();
|
|
27
|
+
} catch (error) {
|
|
28
|
+
logger_default.debug("[RemoteBlob] Invalid remote blob URL", {
|
|
29
|
+
error: error instanceof Error ? error.message : String(error),
|
|
30
|
+
baseUrl
|
|
31
|
+
});
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function shouldAttemptRemoteBlobUpload() {
|
|
36
|
+
return buildRemoteUrl() !== null;
|
|
37
|
+
}
|
|
38
|
+
async function uploadBlobRemote(buffer, mimeType, context) {
|
|
39
|
+
const url = buildRemoteUrl();
|
|
40
|
+
const apiKey = cloudConfig.getApiKey();
|
|
41
|
+
if (!url || !apiKey) return null;
|
|
42
|
+
try {
|
|
43
|
+
const { fetchWithProxy } = await import("./fetch-8fmzVUH3.js");
|
|
44
|
+
const response = await fetchWithProxy(url, {
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: {
|
|
47
|
+
"Content-Type": "application/json",
|
|
48
|
+
Authorization: `Bearer ${apiKey}`
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify({
|
|
51
|
+
data: buffer.toString("base64"),
|
|
52
|
+
mimeType,
|
|
53
|
+
context
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
if (response.status === 404 || response.status === 400) {
|
|
57
|
+
logger_default.debug("[RemoteBlob] Remote blob upload unavailable", { status: response.status });
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
const text = await response.text();
|
|
62
|
+
logger_default.debug("[RemoteBlob] Failed to upload blob", {
|
|
63
|
+
status: response.status,
|
|
64
|
+
statusText: response.statusText,
|
|
65
|
+
body: text
|
|
66
|
+
});
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const data = await response.json();
|
|
70
|
+
if (!data?.ref?.hash) {
|
|
71
|
+
logger_default.debug("[RemoteBlob] Remote upload returned malformed response");
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return data;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
logger_default.debug("[RemoteBlob] Error uploading blob", { error: error instanceof Error ? error.message : String(error) });
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
17
81
|
//#endregion
|
|
18
82
|
//#region src/blobs/extractor.ts
|
|
19
83
|
const BLOB_URI_REGEX = /^promptfoo:\/\/blob\/([a-f0-9]{64})$/i;
|
|
@@ -88,11 +152,24 @@ async function maybeStore(base64OrDataUrl, defaultMimeType, context, location, k
|
|
|
88
152
|
const parsed = parseBinary(base64OrDataUrl, defaultMimeType);
|
|
89
153
|
if (!parsed || !shouldExternalize(parsed.buffer)) return null;
|
|
90
154
|
if (!isBlobStorageEnabled()) return null;
|
|
91
|
-
const
|
|
155
|
+
const mimeType = parsed.mimeType || "application/octet-stream";
|
|
156
|
+
const { ref } = await storeBlob(parsed.buffer, mimeType, {
|
|
92
157
|
...context,
|
|
93
158
|
location,
|
|
94
159
|
kind
|
|
95
160
|
});
|
|
161
|
+
if (shouldAttemptRemoteBlobUpload()) uploadBlobRemote(parsed.buffer, mimeType, {
|
|
162
|
+
evalId: context.evalId,
|
|
163
|
+
testIdx: context.testIdx,
|
|
164
|
+
promptIdx: context.promptIdx,
|
|
165
|
+
location,
|
|
166
|
+
kind
|
|
167
|
+
}).catch((error) => {
|
|
168
|
+
logger_default.debug("[BlobExtractor] Cloud upload failed (non-fatal)", {
|
|
169
|
+
error: error instanceof Error ? error.message : String(error),
|
|
170
|
+
hash: ref.hash
|
|
171
|
+
});
|
|
172
|
+
});
|
|
96
173
|
return ref;
|
|
97
174
|
}
|
|
98
175
|
async function externalizeDataUrls(value, context, location) {
|
|
@@ -292,5 +369,5 @@ async function recordExistingBlobReferences(value, context, location) {
|
|
|
292
369
|
}
|
|
293
370
|
|
|
294
371
|
//#endregion
|
|
295
|
-
export { sha256 as i, isBlobStorageEnabled as n,
|
|
296
|
-
//# sourceMappingURL=extractor-
|
|
372
|
+
export { sha256 as a, randomSequence as i, isBlobStorageEnabled as n, shouldAttemptRemoteBlobUpload as r, extractAndStoreBinaryData as t };
|
|
373
|
+
//# sourceMappingURL=extractor-HnP0pHfO.js.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { _ as getEnvBool, i as logger_default } from "./logger-q5I8CByj.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as cloudConfig } from "./fetch-BMKSarK_.js";
|
|
3
|
+
import { o as isLoggedIntoCloud } from "./accounts-CYqHD7X1.js";
|
|
4
|
+
import { a as BLOB_MIN_SIZE, i as BLOB_MAX_SIZE, n as recordBlobReference, r as storeBlob } from "./blobs-BHstP0Ep.js";
|
|
3
5
|
import { createHash } from "crypto";
|
|
4
6
|
|
|
5
7
|
//#region src/util/createHash.ts
|
|
@@ -13,6 +15,68 @@ function randomSequence(length = 3) {
|
|
|
13
15
|
return result;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/blobs/remoteUpload.ts
|
|
20
|
+
function buildRemoteUrl() {
|
|
21
|
+
const baseUrl = cloudConfig.getApiHost();
|
|
22
|
+
const apiKey = cloudConfig.getApiKey();
|
|
23
|
+
if (!baseUrl || !apiKey || !isLoggedIntoCloud()) return null;
|
|
24
|
+
try {
|
|
25
|
+
return new URL("/api/blobs", baseUrl).toString();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
logger_default.debug("[RemoteBlob] Invalid remote blob URL", {
|
|
28
|
+
error: error instanceof Error ? error.message : String(error),
|
|
29
|
+
baseUrl
|
|
30
|
+
});
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function shouldAttemptRemoteBlobUpload() {
|
|
35
|
+
return buildRemoteUrl() !== null;
|
|
36
|
+
}
|
|
37
|
+
async function uploadBlobRemote(buffer, mimeType, context) {
|
|
38
|
+
const url = buildRemoteUrl();
|
|
39
|
+
const apiKey = cloudConfig.getApiKey();
|
|
40
|
+
if (!url || !apiKey) return null;
|
|
41
|
+
try {
|
|
42
|
+
const { fetchWithProxy } = await import("./fetch-CE0K47nJ.js");
|
|
43
|
+
const response = await fetchWithProxy(url, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
Authorization: `Bearer ${apiKey}`
|
|
48
|
+
},
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
data: buffer.toString("base64"),
|
|
51
|
+
mimeType,
|
|
52
|
+
context
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
if (response.status === 404 || response.status === 400) {
|
|
56
|
+
logger_default.debug("[RemoteBlob] Remote blob upload unavailable", { status: response.status });
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const text = await response.text();
|
|
61
|
+
logger_default.debug("[RemoteBlob] Failed to upload blob", {
|
|
62
|
+
status: response.status,
|
|
63
|
+
statusText: response.statusText,
|
|
64
|
+
body: text
|
|
65
|
+
});
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const data = await response.json();
|
|
69
|
+
if (!data?.ref?.hash) {
|
|
70
|
+
logger_default.debug("[RemoteBlob] Remote upload returned malformed response");
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return data;
|
|
74
|
+
} catch (error) {
|
|
75
|
+
logger_default.debug("[RemoteBlob] Error uploading blob", { error: error instanceof Error ? error.message : String(error) });
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
16
80
|
//#endregion
|
|
17
81
|
//#region src/blobs/extractor.ts
|
|
18
82
|
const BLOB_URI_REGEX = /^promptfoo:\/\/blob\/([a-f0-9]{64})$/i;
|
|
@@ -87,11 +151,24 @@ async function maybeStore(base64OrDataUrl, defaultMimeType, context, location, k
|
|
|
87
151
|
const parsed = parseBinary(base64OrDataUrl, defaultMimeType);
|
|
88
152
|
if (!parsed || !shouldExternalize(parsed.buffer)) return null;
|
|
89
153
|
if (!isBlobStorageEnabled()) return null;
|
|
90
|
-
const
|
|
154
|
+
const mimeType = parsed.mimeType || "application/octet-stream";
|
|
155
|
+
const { ref } = await storeBlob(parsed.buffer, mimeType, {
|
|
91
156
|
...context,
|
|
92
157
|
location,
|
|
93
158
|
kind
|
|
94
159
|
});
|
|
160
|
+
if (shouldAttemptRemoteBlobUpload()) uploadBlobRemote(parsed.buffer, mimeType, {
|
|
161
|
+
evalId: context.evalId,
|
|
162
|
+
testIdx: context.testIdx,
|
|
163
|
+
promptIdx: context.promptIdx,
|
|
164
|
+
location,
|
|
165
|
+
kind
|
|
166
|
+
}).catch((error) => {
|
|
167
|
+
logger_default.debug("[BlobExtractor] Cloud upload failed (non-fatal)", {
|
|
168
|
+
error: error instanceof Error ? error.message : String(error),
|
|
169
|
+
hash: ref.hash
|
|
170
|
+
});
|
|
171
|
+
});
|
|
95
172
|
return ref;
|
|
96
173
|
}
|
|
97
174
|
async function externalizeDataUrls(value, context, location) {
|
|
@@ -291,5 +368,5 @@ async function recordExistingBlobReferences(value, context, location) {
|
|
|
291
368
|
}
|
|
292
369
|
|
|
293
370
|
//#endregion
|
|
294
|
-
export { sha256 as i, isBlobStorageEnabled as n,
|
|
295
|
-
//# sourceMappingURL=extractor-
|
|
371
|
+
export { sha256 as a, randomSequence as i, isBlobStorageEnabled as n, shouldAttemptRemoteBlobUpload as r, extractAndStoreBinaryData as t };
|
|
372
|
+
//# sourceMappingURL=extractor-WvMabjRY.js.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const require_logger = require('./logger-CMp-NS-e.cjs');
|
|
2
|
-
const
|
|
2
|
+
const require_fetch = require('./fetch-BgYKpAJ7.cjs');
|
|
3
|
+
const require_accounts = require('./accounts-TGrHBZU9.cjs');
|
|
4
|
+
const require_blobs = require('./blobs-BPAqMoU_.cjs');
|
|
3
5
|
let crypto = require("crypto");
|
|
4
6
|
|
|
5
7
|
//#region src/util/createHash.ts
|
|
@@ -13,6 +15,68 @@ function randomSequence(length = 3) {
|
|
|
13
15
|
return result;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/blobs/remoteUpload.ts
|
|
20
|
+
function buildRemoteUrl() {
|
|
21
|
+
const baseUrl = require_fetch.cloudConfig.getApiHost();
|
|
22
|
+
const apiKey = require_fetch.cloudConfig.getApiKey();
|
|
23
|
+
if (!baseUrl || !apiKey || !require_accounts.isLoggedIntoCloud()) return null;
|
|
24
|
+
try {
|
|
25
|
+
return new URL("/api/blobs", baseUrl).toString();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
require_logger.logger_default.debug("[RemoteBlob] Invalid remote blob URL", {
|
|
28
|
+
error: error instanceof Error ? error.message : String(error),
|
|
29
|
+
baseUrl
|
|
30
|
+
});
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function shouldAttemptRemoteBlobUpload() {
|
|
35
|
+
return buildRemoteUrl() !== null;
|
|
36
|
+
}
|
|
37
|
+
async function uploadBlobRemote(buffer, mimeType, context) {
|
|
38
|
+
const url = buildRemoteUrl();
|
|
39
|
+
const apiKey = require_fetch.cloudConfig.getApiKey();
|
|
40
|
+
if (!url || !apiKey) return null;
|
|
41
|
+
try {
|
|
42
|
+
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-GeRV0LDI.cjs"));
|
|
43
|
+
const response = await fetchWithProxy(url, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
Authorization: `Bearer ${apiKey}`
|
|
48
|
+
},
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
data: buffer.toString("base64"),
|
|
51
|
+
mimeType,
|
|
52
|
+
context
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
if (response.status === 404 || response.status === 400) {
|
|
56
|
+
require_logger.logger_default.debug("[RemoteBlob] Remote blob upload unavailable", { status: response.status });
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const text = await response.text();
|
|
61
|
+
require_logger.logger_default.debug("[RemoteBlob] Failed to upload blob", {
|
|
62
|
+
status: response.status,
|
|
63
|
+
statusText: response.statusText,
|
|
64
|
+
body: text
|
|
65
|
+
});
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const data = await response.json();
|
|
69
|
+
if (!data?.ref?.hash) {
|
|
70
|
+
require_logger.logger_default.debug("[RemoteBlob] Remote upload returned malformed response");
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return data;
|
|
74
|
+
} catch (error) {
|
|
75
|
+
require_logger.logger_default.debug("[RemoteBlob] Error uploading blob", { error: error instanceof Error ? error.message : String(error) });
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
16
80
|
//#endregion
|
|
17
81
|
//#region src/blobs/extractor.ts
|
|
18
82
|
const BLOB_URI_REGEX = /^promptfoo:\/\/blob\/([a-f0-9]{64})$/i;
|
|
@@ -87,11 +151,24 @@ async function maybeStore(base64OrDataUrl, defaultMimeType, context, location, k
|
|
|
87
151
|
const parsed = parseBinary(base64OrDataUrl, defaultMimeType);
|
|
88
152
|
if (!parsed || !shouldExternalize(parsed.buffer)) return null;
|
|
89
153
|
if (!isBlobStorageEnabled()) return null;
|
|
90
|
-
const
|
|
154
|
+
const mimeType = parsed.mimeType || "application/octet-stream";
|
|
155
|
+
const { ref } = await require_blobs.storeBlob(parsed.buffer, mimeType, {
|
|
91
156
|
...context,
|
|
92
157
|
location,
|
|
93
158
|
kind
|
|
94
159
|
});
|
|
160
|
+
if (shouldAttemptRemoteBlobUpload()) uploadBlobRemote(parsed.buffer, mimeType, {
|
|
161
|
+
evalId: context.evalId,
|
|
162
|
+
testIdx: context.testIdx,
|
|
163
|
+
promptIdx: context.promptIdx,
|
|
164
|
+
location,
|
|
165
|
+
kind
|
|
166
|
+
}).catch((error) => {
|
|
167
|
+
require_logger.logger_default.debug("[BlobExtractor] Cloud upload failed (non-fatal)", {
|
|
168
|
+
error: error instanceof Error ? error.message : String(error),
|
|
169
|
+
hash: ref.hash
|
|
170
|
+
});
|
|
171
|
+
});
|
|
95
172
|
return ref;
|
|
96
173
|
}
|
|
97
174
|
async function externalizeDataUrls(value, context, location) {
|
|
@@ -315,4 +392,10 @@ Object.defineProperty(exports, 'sha256', {
|
|
|
315
392
|
return sha256;
|
|
316
393
|
}
|
|
317
394
|
});
|
|
318
|
-
|
|
395
|
+
Object.defineProperty(exports, 'shouldAttemptRemoteBlobUpload', {
|
|
396
|
+
enumerable: true,
|
|
397
|
+
get: function () {
|
|
398
|
+
return shouldAttemptRemoteBlobUpload;
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
//# sourceMappingURL=extractor-wSeR47-c.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./logger-Bzi5o47S.js";
|
|
3
|
-
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-
|
|
4
|
-
import "./cloud-
|
|
3
|
+
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-DKQm7iwv.js";
|
|
4
|
+
import "./cloud-BKfo1A2t.js";
|
|
5
5
|
|
|
6
6
|
export { fetchWithProxy };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger_default, r as logRequestResponse, w as cliState_default, y as getEnvInt } from "./logger-q5I8CByj.js";
|
|
2
2
|
import { t as invariant } from "./invariant-1pAf2CD1.js";
|
|
3
|
-
import { n as sleep } from "./time-CRRzn6vA.js";
|
|
4
3
|
import * as fs$1 from "fs";
|
|
5
4
|
import * as path$1 from "path";
|
|
6
5
|
import path from "path";
|
|
@@ -25,7 +24,7 @@ const HUMAN_ASSERTION_TYPE = "human";
|
|
|
25
24
|
* Application version from package.json.
|
|
26
25
|
* Injected at build time, or read from npm environment in development.
|
|
27
26
|
*/
|
|
28
|
-
const VERSION = "0.120.
|
|
27
|
+
const VERSION = "0.120.23";
|
|
29
28
|
/**
|
|
30
29
|
* PostHog analytics key.
|
|
31
30
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
@@ -292,6 +291,13 @@ function transformTools(tools, format) {
|
|
|
292
291
|
}
|
|
293
292
|
}
|
|
294
293
|
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/util/time.ts
|
|
296
|
+
function getCurrentTimestamp() {
|
|
297
|
+
return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
298
|
+
}
|
|
299
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
300
|
+
|
|
295
301
|
//#endregion
|
|
296
302
|
//#region src/globalConfig/globalConfig.ts
|
|
297
303
|
/**
|
|
@@ -409,7 +415,7 @@ var CloudConfig = class {
|
|
|
409
415
|
}
|
|
410
416
|
async validateAndSetApiToken(token, apiHost) {
|
|
411
417
|
try {
|
|
412
|
-
const { fetchWithProxy } = await import("./fetch-
|
|
418
|
+
const { fetchWithProxy } = await import("./fetch-CE0K47nJ.js");
|
|
413
419
|
const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
|
|
414
420
|
if (!response.ok) {
|
|
415
421
|
const errorMessage = await response.text();
|
|
@@ -707,5 +713,5 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
707
713
|
}
|
|
708
714
|
|
|
709
715
|
//#endregion
|
|
710
|
-
export {
|
|
711
|
-
//# sourceMappingURL=fetch-
|
|
716
|
+
export { EVENTS_ENDPOINT as A, toTitleCase as C, CONSENT_ENDPOINT as D, CLOUD_PROVIDER_PREFIX as E, getShareViewBaseUrl as F, POSTHOG_KEY as I, VERSION as L, TERMINAL_MAX_WIDTH as M, getDefaultShareViewBaseUrl as N, DEFAULT_MAX_CONCURRENCY as O, getShareApiBaseUrl as P, FILE_METADATA_KEY as R, parseChatPrompt as S, transformTools as T, isOpenAIToolArray as _, isRateLimited as a, openaiToolChoiceToBedrock as b, cloudConfig as c, writeGlobalConfigPartial as d, getCurrentTimestamp as f, calculateCost as g, REQUEST_TIMEOUT_MS as h, handleRateLimit as i, R_ENDPOINT as j, DEFAULT_QUERY_LIMIT as k, readGlobalConfig as l, LONG_RUNNING_MODEL_TIMEOUT_MS as m, fetchWithRetries as n, isTransientError as o, sleep as p, fetchWithTimeout as r, CloudConfig as s, fetchWithProxy as t, writeGlobalConfig as u, isOpenAIToolChoice as v, transformToolChoice as w, openaiToolsToBedrock as x, isPromptfooSampleTarget as y, HUMAN_ASSERTION_TYPE as z };
|
|
717
|
+
//# sourceMappingURL=fetch-BMKSarK_.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const require_logger = require('./logger-CMp-NS-e.cjs');
|
|
2
2
|
const require_invariant = require('./invariant-CKcJAQ6M.cjs');
|
|
3
|
-
const require_time = require('./time-CbtsO5_a.cjs');
|
|
4
3
|
let fs = require("fs");
|
|
5
4
|
fs = require_logger.__toESM(fs);
|
|
6
5
|
let path = require("path");
|
|
@@ -28,7 +27,7 @@ const HUMAN_ASSERTION_TYPE = "human";
|
|
|
28
27
|
* Application version from package.json.
|
|
29
28
|
* Injected at build time, or read from npm environment in development.
|
|
30
29
|
*/
|
|
31
|
-
const VERSION = "0.120.
|
|
30
|
+
const VERSION = "0.120.23";
|
|
32
31
|
/**
|
|
33
32
|
* PostHog analytics key.
|
|
34
33
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
@@ -295,6 +294,13 @@ function transformTools(tools, format) {
|
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
296
|
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/util/time.ts
|
|
299
|
+
function getCurrentTimestamp() {
|
|
300
|
+
return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
301
|
+
}
|
|
302
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
303
|
+
|
|
298
304
|
//#endregion
|
|
299
305
|
//#region src/globalConfig/globalConfig.ts
|
|
300
306
|
/**
|
|
@@ -412,7 +418,7 @@ var CloudConfig = class {
|
|
|
412
418
|
}
|
|
413
419
|
async validateAndSetApiToken(token, apiHost) {
|
|
414
420
|
try {
|
|
415
|
-
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-
|
|
421
|
+
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-GeRV0LDI.cjs"));
|
|
416
422
|
const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
|
|
417
423
|
if (!response.ok) {
|
|
418
424
|
const errorMessage = await response.text();
|
|
@@ -606,7 +612,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
606
612
|
if (!options.disableTransientRetries && isTransientError(response) && attempt < maxTransientRetries) {
|
|
607
613
|
const backoffMs = Math.pow(2, attempt) * 1e3;
|
|
608
614
|
require_logger.logger_default.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
|
|
609
|
-
await
|
|
615
|
+
await sleep(backoffMs);
|
|
610
616
|
continue;
|
|
611
617
|
}
|
|
612
618
|
return response;
|
|
@@ -656,7 +662,7 @@ async function handleRateLimit(response) {
|
|
|
656
662
|
waitTime = Math.max(resetTime.getTime() - now.getTime() + 1e3, 0);
|
|
657
663
|
} else if (retryAfter) waitTime = Number.parseInt(retryAfter) * 1e3;
|
|
658
664
|
require_logger.logger_default.debug(`Rate limited, waiting ${waitTime}ms before retry`);
|
|
659
|
-
await
|
|
665
|
+
await sleep(waitTime);
|
|
660
666
|
}
|
|
661
667
|
/**
|
|
662
668
|
* Check if a response indicates a transient server error that should be retried.
|
|
@@ -702,7 +708,7 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
702
708
|
if (typedError.code) errorMessage += ` (Code: ${typedError.code})`;
|
|
703
709
|
} else errorMessage = String(error);
|
|
704
710
|
require_logger.logger_default.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
|
|
705
|
-
if (i < maxRetries) await
|
|
711
|
+
if (i < maxRetries) await sleep(Math.pow(2, i) * (backoff + 1e3 * Math.random()));
|
|
706
712
|
lastErrorMessage = errorMessage;
|
|
707
713
|
}
|
|
708
714
|
}
|
|
@@ -824,6 +830,12 @@ Object.defineProperty(exports, 'fetchWithTimeout', {
|
|
|
824
830
|
return fetchWithTimeout;
|
|
825
831
|
}
|
|
826
832
|
});
|
|
833
|
+
Object.defineProperty(exports, 'getCurrentTimestamp', {
|
|
834
|
+
enumerable: true,
|
|
835
|
+
get: function () {
|
|
836
|
+
return getCurrentTimestamp;
|
|
837
|
+
}
|
|
838
|
+
});
|
|
827
839
|
Object.defineProperty(exports, 'getDefaultShareViewBaseUrl', {
|
|
828
840
|
enumerable: true,
|
|
829
841
|
get: function () {
|
|
@@ -902,6 +914,12 @@ Object.defineProperty(exports, 'readGlobalConfig', {
|
|
|
902
914
|
return readGlobalConfig;
|
|
903
915
|
}
|
|
904
916
|
});
|
|
917
|
+
Object.defineProperty(exports, 'sleep', {
|
|
918
|
+
enumerable: true,
|
|
919
|
+
get: function () {
|
|
920
|
+
return sleep;
|
|
921
|
+
}
|
|
922
|
+
});
|
|
905
923
|
Object.defineProperty(exports, 'toTitleCase', {
|
|
906
924
|
enumerable: true,
|
|
907
925
|
get: function () {
|
|
@@ -932,4 +950,4 @@ Object.defineProperty(exports, 'writeGlobalConfigPartial', {
|
|
|
932
950
|
return writeGlobalConfigPartial;
|
|
933
951
|
}
|
|
934
952
|
});
|
|
935
|
-
//# sourceMappingURL=fetch-
|
|
953
|
+
//# sourceMappingURL=fetch-BgYKpAJ7.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger-q5I8CByj.js";
|
|
2
|
-
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-
|
|
2
|
+
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-BMKSarK_.js";
|
|
3
3
|
|
|
4
4
|
export { fetchWithProxy };
|