@langwatch/mcp-server 2.0.0 → 2.2.0

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.
Files changed (430) hide show
  1. package/.gitignore +7 -0
  2. package/.npmignore +41 -0
  3. package/CHANGELOG.md +280 -200
  4. package/CONTRIBUTING.md +10 -0
  5. package/README.md +82 -52
  6. package/dist/add-dashboard-widget-4ZC5UN73.js +50 -0
  7. package/dist/add-dashboard-widget-ACC6QYBG.js +49 -0
  8. package/dist/archive-project-KWFM3I5Z.js +19 -0
  9. package/dist/{archive-project-4EQGLBJJ.js → archive-project-SPVHXK6A.js} +4 -4
  10. package/dist/archive-run-plan-65QN3XRX.js +16 -0
  11. package/dist/archive-run-plan-Z4SYE6BP.js +15 -0
  12. package/dist/{archive-scenario-W6BXYDZ3.js → archive-scenario-A6QV5LOW.js} +4 -4
  13. package/dist/archive-scenario-FXEYQNEH.js +19 -0
  14. package/dist/archive-test-suite-5ADQ3KPQ.js +15 -0
  15. package/dist/archive-test-suite-NKZDZY3D.js +16 -0
  16. package/dist/assign-prompt-tag-5IUZXJ2T.js +23 -0
  17. package/dist/{assign-prompt-tag-VLXUWEKU.js → assign-prompt-tag-HBZLBIFD.js} +8 -4
  18. package/dist/{chunk-CDYQOY5U.js → chunk-3OCG3QPU.js} +7 -10
  19. package/dist/chunk-3YLN3ATJ.js +241 -0
  20. package/dist/chunk-5FNCQRCX.js +91 -0
  21. package/dist/chunk-6YZUOD34.js +55 -0
  22. package/dist/{chunk-WVI5CJ6S.js → chunk-7AQLPVFL.js} +2 -2
  23. package/dist/chunk-7VNSRCXO.js +129 -0
  24. package/dist/{chunk-7RHG56OH.js → chunk-B4J3PJLX.js} +11 -10
  25. package/dist/{chunk-ZXKLPC2E.js → chunk-BIIKE3EI.js} +1 -1
  26. package/dist/{chunk-37SMPMQS.js → chunk-DMM3JQ42.js} +7 -2
  27. package/dist/{chunk-NUFPTHKU.js → chunk-FOKVY3BK.js} +1 -1
  28. package/dist/{chunk-WT4PO4A3.js → chunk-H6WGMG2T.js} +10 -7
  29. package/dist/{chunk-TOXJQDIZ.js → chunk-HGELNIVY.js} +135 -51
  30. package/dist/{chunk-UJPXFA26.js → chunk-HHMNZAPD.js} +101 -74
  31. package/dist/{chunk-J42FWRJ2.js → chunk-I7ATIZED.js} +7 -7
  32. package/dist/{chunk-AQJO2EI5.js → chunk-ILZDO25L.js} +7 -10
  33. package/dist/{chunk-4QC7SA2L.js → chunk-J7PQKBLD.js} +884 -559
  34. package/dist/{chunk-YX3A3CFM.js → chunk-JRJPH75H.js} +7 -13
  35. package/dist/chunk-K2I7Z3LZ.js +28 -0
  36. package/dist/{chunk-5CCZFUXS.js → chunk-NKMTIHIJ.js} +6 -9
  37. package/dist/chunk-O7EMWEVJ.js +44 -0
  38. package/dist/chunk-PTDR56Z3.js +37 -0
  39. package/dist/chunk-RABYBFX5.js +43 -0
  40. package/dist/chunk-SUPUUC4W.js +64 -0
  41. package/dist/{chunk-SFB4MU6H.js → chunk-SXFC3FNH.js} +4 -4
  42. package/dist/chunk-U24EACC4.js +67 -0
  43. package/dist/chunk-UNJM3BIL.js +21 -0
  44. package/dist/{chunk-ZWIL4EFL.js → chunk-UTJCWXPZ.js} +4 -4
  45. package/dist/chunk-UWLE5T2F.js +312 -0
  46. package/dist/chunk-VMWJD732.js +57 -0
  47. package/dist/chunk-XUIJYNRJ.js +15 -0
  48. package/dist/chunk-Y34DHR5K.js +67 -0
  49. package/dist/chunk-YCARO42Z.js +516 -0
  50. package/dist/config-EAKW6F26.js +16 -0
  51. package/dist/config.cjs +109 -0
  52. package/dist/config.js +5 -4
  53. package/dist/{create-agent-7XHO6UIS.js → create-agent-AYZ3LB3V.js} +4 -4
  54. package/dist/create-agent-S5ZBCEFT.js +23 -0
  55. package/dist/create-annotation-LHNCLHYP.js +29 -0
  56. package/dist/{create-annotation-YQXRQC6A.js → create-annotation-VUSXULQK.js} +10 -5
  57. package/dist/{create-api-key-YUS36KBU.js → create-api-key-NNYKARMG.js} +5 -7
  58. package/dist/create-api-key-T4KSNPKB.js +24 -0
  59. package/dist/create-dashboard-DHVFMEU4.js +18 -0
  60. package/dist/{create-dashboard-4Z5JO5LB.js → create-dashboard-WTKKS5Z6.js} +4 -4
  61. package/dist/{create-dataset-E6NMSVX7.js → create-dataset-2MC4SD4O.js} +6 -6
  62. package/dist/create-dataset-LUP5PVDM.js +22 -0
  63. package/dist/create-dataset-records-NSKBZP3G.js +20 -0
  64. package/dist/{create-dataset-records-SKHPRD2K.js → create-dataset-records-W4GLN2FV.js} +5 -7
  65. package/dist/{create-evaluator-JXF5PF33.js → create-evaluator-643G6LXL.js} +4 -4
  66. package/dist/create-evaluator-HMTYO5SS.js +27 -0
  67. package/dist/create-mcp-server.cjs +9513 -0
  68. package/dist/create-mcp-server.js +2647 -5
  69. package/dist/create-project-6N7PIYRY.js +44 -0
  70. package/dist/{create-project-CS2CB57Y.js → create-project-KAIC46UY.js} +4 -4
  71. package/dist/{create-prompt-F5RMX3L3.js → create-prompt-E67LXIYT.js} +5 -7
  72. package/dist/create-prompt-PKJ7EDRR.js +37 -0
  73. package/dist/create-prompt-tag-4YO3FSJ3.js +17 -0
  74. package/dist/{create-prompt-tag-GMRWTEFR.js → create-prompt-tag-OPQUEXWB.js} +3 -3
  75. package/dist/create-scenario-5PJBMAXO.js +33 -0
  76. package/dist/{create-scenario-JDR2VB2H.js → create-scenario-UEM77OE7.js} +11 -4
  77. package/dist/create-test-suite-4IPXVSFQ.js +37 -0
  78. package/dist/create-test-suite-SZEPVXSE.js +36 -0
  79. package/dist/create-trigger-5HZSCRAN.js +49 -0
  80. package/dist/create-trigger-PRELMT6J.js +48 -0
  81. package/dist/delete-agent-JUIZWAXG.js +18 -0
  82. package/dist/{delete-agent-O3EEH4S5.js → delete-agent-QMEK3XHK.js} +4 -4
  83. package/dist/delete-annotation-HY3O2OGR.js +17 -0
  84. package/dist/{delete-annotation-XP6FQM7A.js → delete-annotation-VKIQWUYW.js} +4 -4
  85. package/dist/delete-dashboard-76N66XXL.js +18 -0
  86. package/dist/{delete-dashboard-RFUNYCNP.js → delete-dashboard-JVIVHNJM.js} +4 -4
  87. package/dist/delete-dataset-HQCR66MG.js +18 -0
  88. package/dist/{delete-dataset-3MJFRDLP.js → delete-dataset-WKRUW4FP.js} +5 -7
  89. package/dist/{delete-dataset-records-WPMU5GL5.js → delete-dataset-records-C2IQFFVQ.js} +5 -7
  90. package/dist/delete-dataset-records-SDUHQLLM.js +19 -0
  91. package/dist/delete-evaluator-4SNSCLEE.js +16 -0
  92. package/dist/delete-evaluator-QP3QHTLN.js +15 -0
  93. package/dist/delete-prompt-tag-NZ4JQMYG.js +17 -0
  94. package/dist/{delete-prompt-tag-KNMZVSPB.js → delete-prompt-tag-YYQ4VMAD.js} +3 -3
  95. package/dist/{delete-workflow-3NUXO46U.js → delete-workflow-5J46T73T.js} +4 -4
  96. package/dist/delete-workflow-JSWABL5F.js +17 -0
  97. package/dist/discover-evaluator-schema-UHWA5HVL.js +120 -0
  98. package/dist/discover-evaluator-schema-XKCLLCB3.js +118 -0
  99. package/dist/discover-scenario-schema-NOJY6S7E.js +137 -0
  100. package/dist/discover-scenario-schema-OOFIQKOG.js +139 -0
  101. package/dist/{discover-schema-L6QDPON3.js → discover-schema-55YJBFGQ.js} +181 -186
  102. package/dist/discover-schema-A33SLMXW.js +442 -0
  103. package/dist/get-agent-LJQX7OF4.js +69 -0
  104. package/dist/get-agent-OTIYUFZA.js +70 -0
  105. package/dist/get-analytics-DCS72353.js +80 -0
  106. package/dist/get-analytics-IQZKJHLW.js +79 -0
  107. package/dist/get-dashboard-5NYJEIX2.js +29 -0
  108. package/dist/{get-dashboard-KHBEGZGL.js → get-dashboard-QMTYDQAZ.js} +4 -4
  109. package/dist/get-dataset-ALSP7RTX.js +64 -0
  110. package/dist/get-dataset-X4B5JDG2.js +63 -0
  111. package/dist/{get-evaluator-ADMKVWYZ.js → get-evaluator-ISMC4LLI.js} +4 -4
  112. package/dist/get-evaluator-XEUZGZCH.js +47 -0
  113. package/dist/{get-project-RAK7URQJ.js → get-project-5VKROSDH.js} +4 -4
  114. package/dist/get-project-RM6FRCBK.js +26 -0
  115. package/dist/get-prompt-OWXJZHQQ.js +95 -0
  116. package/dist/get-prompt-W52DY36E.js +94 -0
  117. package/dist/get-run-plan-BE3M2AUX.js +59 -0
  118. package/dist/get-run-plan-RUXQ6PAX.js +58 -0
  119. package/dist/get-scenario-RNM7BAX2.js +37 -0
  120. package/dist/{get-scenario-ZTAJJL5T.js → get-scenario-YM4ODWW6.js} +8 -4
  121. package/dist/get-simulation-run-6GIATQE5.js +69 -0
  122. package/dist/{get-simulation-run-T2ZQWYH2.js → get-simulation-run-LCFSMPGQ.js} +33 -20
  123. package/dist/get-test-suite-GC2O7YH6.js +49 -0
  124. package/dist/get-test-suite-P5LJ6VLF.js +48 -0
  125. package/dist/get-trace-KBRVV4NN.js +45 -0
  126. package/dist/{get-trace-K7U234Q4.js → get-trace-SEF3FMR5.js} +11 -13
  127. package/dist/get-workflow-7PVED7JE.js +25 -0
  128. package/dist/{get-workflow-L5L2PSK3.js → get-workflow-YXULW4GC.js} +4 -4
  129. package/dist/{http-security-EU3CHTY7.js → http-security-DNLBNQZL.js} +2 -2
  130. package/dist/{http-server-YXHFPPGA.js → http-server-IR4QOS43.js} +4071 -342
  131. package/dist/index.js +60221 -38077
  132. package/dist/langwatch-api-annotations-6SA4OB4C.js +17 -0
  133. package/dist/{langwatch-api-annotations-FDAS6NQ7.js → langwatch-api-annotations-TBHLCQ5R.js} +4 -4
  134. package/dist/langwatch-api-dashboards-6EO2VVZW.js +17 -0
  135. package/dist/{langwatch-api-dashboards-JTVCS7ZJ.js → langwatch-api-dashboards-NHU5BZD7.js} +4 -4
  136. package/dist/langwatch-api-monitors-CBF3FGIM.js +47 -0
  137. package/dist/{langwatch-api-monitors-3J7UIQME.js → langwatch-api-monitors-YNWA2M5Y.js} +11 -16
  138. package/dist/langwatch-api-secrets-ADTOJELP.js +56 -0
  139. package/dist/langwatch-api-secrets-RNFO4LF2.js +55 -0
  140. package/dist/langwatch-api-triggers-KQDQC6L5.js +22 -0
  141. package/dist/langwatch-api-triggers-QS7HDIVW.js +23 -0
  142. package/dist/{langwatch-api-workflows-NBJX5KOG.js → langwatch-api-workflows-OKC4FXIF.js} +4 -4
  143. package/dist/langwatch-api-workflows-XGJE6SR5.js +15 -0
  144. package/dist/list-agents-HVYWEQMI.js +43 -0
  145. package/dist/list-agents-RBAOCF53.js +42 -0
  146. package/dist/list-annotations-HJH4NBLD.js +38 -0
  147. package/dist/{list-annotations-ZTVP4EEL.js → list-annotations-J4UAHSUN.js} +10 -5
  148. package/dist/{list-api-keys-CWD4UQT5.js → list-api-keys-7UTJRZDG.js} +10 -5
  149. package/dist/list-api-keys-A2PMV435.js +42 -0
  150. package/dist/list-dashboard-boards-OPWROHMG.js +33 -0
  151. package/dist/list-dashboard-boards-U2GJ7GC5.js +34 -0
  152. package/dist/{list-dashboards-PWG6P6KR.js → list-dashboards-ROSYFLDQ.js} +4 -4
  153. package/dist/list-dashboards-RQ635ZU7.js +32 -0
  154. package/dist/{list-dataset-records-IOE7LQXS.js → list-dataset-records-M5TKA6LK.js} +14 -10
  155. package/dist/list-dataset-records-WFM7F33C.js +43 -0
  156. package/dist/{list-datasets-ZT4JYUDT.js → list-datasets-B5X4P7BQ.js} +9 -13
  157. package/dist/list-datasets-THUKQHPX.js +56 -0
  158. package/dist/{list-evaluators-SJHC7VBH.js → list-evaluators-MYH2OVCI.js} +5 -7
  159. package/dist/list-evaluators-NLVWF6K7.js +32 -0
  160. package/dist/{list-model-providers-PPD2WPD2.js → list-model-providers-3JUGP4YI.js} +4 -4
  161. package/dist/list-model-providers-H3XKORFO.js +35 -0
  162. package/dist/{list-projects-K7QAIX2I.js → list-projects-6EJ5YYEW.js} +5 -7
  163. package/dist/list-projects-YNNSRMLC.js +40 -0
  164. package/dist/{list-prompt-tags-FOO6TNHB.js → list-prompt-tags-NVFQO6WX.js} +3 -3
  165. package/dist/list-prompt-tags-XUQTTAH4.js +23 -0
  166. package/dist/{list-prompts-SC2HAUFG.js → list-prompts-HSIMMHTF.js} +4 -6
  167. package/dist/list-prompts-IRI6AIXO.js +30 -0
  168. package/dist/list-run-plans-PX2XI6EK.js +46 -0
  169. package/dist/list-run-plans-QALLCN2K.js +45 -0
  170. package/dist/list-scenarios-QZRPVHS4.js +46 -0
  171. package/dist/list-scenarios-SSJQEMJP.js +45 -0
  172. package/dist/list-simulation-runs-KNOLGMDV.js +53 -0
  173. package/dist/{list-simulation-runs-KF5THG5H.js → list-simulation-runs-OEADLLQR.js} +19 -9
  174. package/dist/list-test-suites-ANAQBLDG.js +34 -0
  175. package/dist/list-test-suites-N4WVLBKK.js +35 -0
  176. package/dist/list-trigger-fires-JV3WFYYG.js +19 -0
  177. package/dist/list-trigger-fires-WTW4DVIW.js +20 -0
  178. package/dist/list-triggers-SQNIG35Q.js +45 -0
  179. package/dist/list-triggers-V4Y356AK.js +46 -0
  180. package/dist/{list-workflows-QSJWURCK.js → list-workflows-IMSX7SXU.js} +5 -7
  181. package/dist/list-workflows-ZHTX5LCL.js +33 -0
  182. package/dist/{rename-prompt-tag-EKWU5QF3.js → rename-prompt-tag-IQI7MHOI.js} +3 -3
  183. package/dist/rename-prompt-tag-PA2BRIE6.js +18 -0
  184. package/dist/rename-test-suite-4J7UX5S2.js +21 -0
  185. package/dist/rename-test-suite-NNVLMLKY.js +20 -0
  186. package/dist/report-issue-AS34ZMJF.js +898 -0
  187. package/dist/report-issue-DCZFLGDO.js +899 -0
  188. package/dist/rerun-run-plan-TG2V4WM4.js +22 -0
  189. package/dist/rerun-run-plan-ZI5OY3VA.js +21 -0
  190. package/dist/revoke-api-key-3J3ZA4UB.js +15 -0
  191. package/dist/{revoke-api-key-FTRTZMOF.js → revoke-api-key-SFMEFWJC.js} +4 -4
  192. package/dist/run-agent-W4VJP72Z.js +75 -0
  193. package/dist/run-agent-YNV6ZHW4.js +74 -0
  194. package/dist/run-plan-6C77GWG4.js +38 -0
  195. package/dist/run-plan-PAARQSI4.js +39 -0
  196. package/dist/run-query-KJDH544C.js +47 -0
  197. package/dist/run-query-T4QW2Z5O.js +46 -0
  198. package/dist/run-test-suite-SQJELEZX.js +26 -0
  199. package/dist/run-test-suite-STB6NUJM.js +25 -0
  200. package/dist/{run-workflow-QPXC627O.js → run-workflow-D6PQNBI6.js} +4 -4
  201. package/dist/{run-agent-6SM4XNA7.js → run-workflow-SP32SO5M.js} +10 -11
  202. package/dist/search-traces-HCBGOG6R.js +170 -0
  203. package/dist/search-traces-HSTQ6WTQ.js +171 -0
  204. package/dist/{set-model-provider-3WKT63ZN.js → set-model-provider-GF7NXUJA.js} +4 -4
  205. package/dist/set-model-provider-KDQ7C4EZ.js +33 -0
  206. package/dist/{update-agent-SMAEHLXH.js → update-agent-DWG43T2P.js} +4 -4
  207. package/dist/update-agent-MXNOBS4H.js +20 -0
  208. package/dist/update-dashboard-widget-CJKJLCDY.js +71 -0
  209. package/dist/update-dashboard-widget-CYQDS2NR.js +70 -0
  210. package/dist/update-dataset-DQH3OHOU.js +22 -0
  211. package/dist/{update-dataset-BDUK7TUO.js → update-dataset-SQZ6T4WX.js} +6 -6
  212. package/dist/{update-dataset-record-4ZSDRBSW.js → update-dataset-record-3AT4IPBC.js} +4 -4
  213. package/dist/update-dataset-record-7PLDGTMR.js +19 -0
  214. package/dist/update-evaluator-4LFTKFPT.js +24 -0
  215. package/dist/{update-evaluator-LS6TIBY7.js → update-evaluator-IGTX6PX4.js} +4 -4
  216. package/dist/{update-project-LKVYXENH.js → update-project-PLJIOZS6.js} +4 -4
  217. package/dist/update-project-QVHSJRUP.js +24 -0
  218. package/dist/update-prompt-GDKRYJI3.js +140 -0
  219. package/dist/update-prompt-MY263DYF.js +141 -0
  220. package/dist/update-scenario-7KA3JDXA.js +34 -0
  221. package/dist/{update-scenario-NEXCAQI7.js → update-scenario-MOHRQKAQ.js} +11 -4
  222. package/package.json +39 -44
  223. package/pyproject.toml +8 -8
  224. package/src/config.d.ts +4 -0
  225. package/src/config.ts +20 -29
  226. package/src/create-mcp-server.ts +1021 -596
  227. package/src/documentation-fetch.ts +21 -20
  228. package/src/http-security.ts +166 -135
  229. package/src/http-server.ts +189 -224
  230. package/src/index.ts +14 -16
  231. package/src/langwatch-api-agents.ts +202 -21
  232. package/src/langwatch-api-annotations.ts +11 -12
  233. package/src/langwatch-api-api-keys.ts +8 -9
  234. package/src/langwatch-api-boards.ts +46 -0
  235. package/src/langwatch-api-dashboard-widgets.ts +112 -0
  236. package/src/langwatch-api-dashboards.ts +13 -10
  237. package/src/langwatch-api-datasets.ts +98 -32
  238. package/src/langwatch-api-evaluators.ts +13 -19
  239. package/src/langwatch-api-model-providers.ts +4 -4
  240. package/src/langwatch-api-monitors.ts +14 -18
  241. package/src/langwatch-api-projects.ts +27 -9
  242. package/src/langwatch-api-query.ts +114 -0
  243. package/src/langwatch-api-run-plans.ts +140 -0
  244. package/src/langwatch-api-scenarios.ts +17 -10
  245. package/src/langwatch-api-secrets.ts +31 -24
  246. package/src/langwatch-api-simulation-runs.ts +10 -7
  247. package/src/langwatch-api-test-suites.ts +116 -0
  248. package/src/langwatch-api-triggers.ts +96 -34
  249. package/src/langwatch-api-workflows.ts +9 -9
  250. package/src/langwatch-api.ts +143 -109
  251. package/src/public-http-request.ts +21 -12
  252. package/src/schemas/analytics-metrics.ts +3 -15
  253. package/src/schemas/create-dataset.ts +3 -4
  254. package/src/schemas/run-plan.ts +76 -0
  255. package/src/schemas/suite-fields.ts +132 -0
  256. package/src/schemas/triggers.ts +365 -0
  257. package/src/tools/add-dashboard-widget.ts +63 -0
  258. package/src/tools/archive-project.ts +2 -4
  259. package/src/tools/archive-run-plan.ts +10 -0
  260. package/src/tools/archive-scenario.ts +2 -4
  261. package/src/tools/archive-test-suite.ts +10 -0
  262. package/src/tools/assign-prompt-tag.ts +6 -2
  263. package/src/tools/create-agent.ts +1 -1
  264. package/src/tools/create-annotation.ts +7 -2
  265. package/src/tools/create-api-key.ts +4 -6
  266. package/src/tools/create-dashboard.ts +1 -1
  267. package/src/tools/create-dataset-records.ts +4 -8
  268. package/src/tools/create-dataset.ts +5 -7
  269. package/src/tools/create-evaluator.ts +3 -5
  270. package/src/tools/create-project.ts +2 -2
  271. package/src/tools/create-prompt-tag.ts +2 -4
  272. package/src/tools/create-prompt.ts +9 -18
  273. package/src/tools/create-scenario.ts +11 -5
  274. package/src/tools/create-test-suite.ts +38 -0
  275. package/src/tools/create-trigger.ts +55 -0
  276. package/src/tools/dashboard-exists.ts +25 -0
  277. package/src/tools/dashboard-widget-queries.ts +32 -0
  278. package/src/tools/delete-agent.ts +1 -1
  279. package/src/tools/delete-annotation.ts +1 -1
  280. package/src/tools/delete-dashboard.ts +1 -1
  281. package/src/tools/delete-dataset-records.ts +4 -8
  282. package/src/tools/delete-dataset.ts +3 -7
  283. package/src/tools/delete-evaluator.ts +4 -6
  284. package/src/tools/delete-prompt-tag.ts +2 -4
  285. package/src/tools/delete-workflow.ts +1 -1
  286. package/src/tools/discover-evaluator-schema.ts +34 -25
  287. package/src/tools/discover-scenario-schema.ts +86 -12
  288. package/src/tools/discover-schema.ts +149 -27
  289. package/src/tools/experiment-run-status.ts +2 -8
  290. package/src/tools/format-dataset-mutation.ts +5 -10
  291. package/src/tools/format-run-plan.ts +54 -0
  292. package/src/tools/format-scenario.ts +12 -0
  293. package/src/tools/format-suite-details.ts +90 -0
  294. package/src/tools/get-agent.ts +54 -3
  295. package/src/tools/get-analytics.ts +52 -46
  296. package/src/tools/get-dashboard.ts +1 -1
  297. package/src/tools/get-dataset.ts +34 -16
  298. package/src/tools/get-evaluator.ts +4 -11
  299. package/src/tools/get-experiment-results.ts +219 -186
  300. package/src/tools/get-project.ts +2 -4
  301. package/src/tools/get-prompt.ts +100 -37
  302. package/src/tools/get-run-plan.ts +60 -0
  303. package/src/tools/get-scenario.ts +6 -5
  304. package/src/tools/get-simulation-run.ts +32 -20
  305. package/src/tools/get-test-suite.ts +46 -0
  306. package/src/tools/get-trace.ts +16 -17
  307. package/src/tools/get-workflow.ts +1 -1
  308. package/src/tools/list-agents.ts +20 -3
  309. package/src/tools/list-annotations.ts +8 -5
  310. package/src/tools/list-api-keys.ts +7 -2
  311. package/src/tools/list-dashboard-boards.ts +28 -0
  312. package/src/tools/list-dashboards.ts +1 -1
  313. package/src/tools/list-dataset-records.ts +8 -6
  314. package/src/tools/list-datasets.ts +12 -23
  315. package/src/tools/list-evaluators.ts +4 -8
  316. package/src/tools/list-experiment-runs.ts +5 -9
  317. package/src/tools/list-experiments.ts +5 -11
  318. package/src/tools/list-model-providers.ts +3 -5
  319. package/src/tools/list-projects.ts +2 -4
  320. package/src/tools/list-prompt-tags.ts +3 -3
  321. package/src/tools/list-prompts.ts +4 -8
  322. package/src/tools/list-run-plans.ts +47 -0
  323. package/src/tools/list-scenarios.ts +26 -17
  324. package/src/tools/list-simulation-runs.ts +13 -5
  325. package/src/tools/list-test-suites.ts +35 -0
  326. package/src/tools/list-trigger-fires.ts +17 -0
  327. package/src/tools/list-triggers.ts +39 -0
  328. package/src/tools/list-workflows.ts +2 -4
  329. package/src/tools/rename-prompt-tag.ts +1 -1
  330. package/src/tools/rename-test-suite.ts +15 -0
  331. package/src/tools/report-issue.ts +5 -9
  332. package/src/tools/rerun-run-plan.ts +18 -0
  333. package/src/tools/revoke-api-key.ts +2 -4
  334. package/src/tools/run-agent.ts +65 -14
  335. package/src/tools/run-experiment.ts +36 -37
  336. package/src/tools/run-plan.ts +46 -0
  337. package/src/tools/run-query.ts +47 -0
  338. package/src/tools/run-test-suite.ts +27 -0
  339. package/src/tools/run-workflow.ts +2 -5
  340. package/src/tools/search-traces.ts +161 -47
  341. package/src/tools/set-model-provider.ts +4 -6
  342. package/src/tools/test-agent.ts +18 -0
  343. package/src/tools/update-agent.ts +1 -1
  344. package/src/tools/update-dashboard-widget.ts +97 -0
  345. package/src/tools/update-dataset-record.ts +1 -1
  346. package/src/tools/update-dataset.ts +5 -7
  347. package/src/tools/update-evaluator.ts +3 -5
  348. package/src/tools/update-project.ts +1 -1
  349. package/src/tools/update-prompt.ts +185 -15
  350. package/src/tools/update-scenario.ts +11 -5
  351. package/src/tools/update-test-suite.ts +40 -0
  352. package/src/utils/date-parsing.ts +1 -1
  353. package/src/utils/escape-markdown.ts +3 -8
  354. package/src/utils/format-evaluations.ts +6 -6
  355. package/src/utils/markdown-table.ts +58 -0
  356. package/src/utils/trace-id-shape.ts +20 -0
  357. package/tsconfig.app.json +24 -0
  358. package/tsconfig.json +19 -12
  359. package/uv.lock +416 -296
  360. package/vitest.integration.config.js +10 -0
  361. package/vitest.scenario.config.js +9 -0
  362. package/.eslintrc.cjs +0 -36
  363. package/dist/archive-suite-4T6BSRS7.js +0 -16
  364. package/dist/chunk-77BNWQ3U.js +0 -86
  365. package/dist/chunk-A2LEVYQ5.js +0 -217
  366. package/dist/chunk-TJCXFNDT.js +0 -24
  367. package/dist/chunk-YZLYHLLI.js +0 -48
  368. package/dist/config.d.ts +0 -17
  369. package/dist/create-mcp-server.d.ts +0 -10
  370. package/dist/create-suite-LZS6QIAF.js +0 -39
  371. package/dist/delete-evaluator-33SP2JFX.js +0 -16
  372. package/dist/discover-evaluator-schema-XTAD4X7D.js +0 -2191
  373. package/dist/discover-scenario-schema-FE64QK2D.js +0 -67
  374. package/dist/get-agent-Y7MWZ65F.js +0 -29
  375. package/dist/get-analytics-TETCSOK6.js +0 -73
  376. package/dist/get-dataset-RCMU5VAH.js +0 -49
  377. package/dist/get-prompt-OY5B7TRI.js +0 -46
  378. package/dist/get-suite-J7JVWO6O.js +0 -45
  379. package/dist/index.d.ts +0 -2
  380. package/dist/langwatch-api-secrets-BUBSNCNO.js +0 -41
  381. package/dist/langwatch-api-triggers-EDFUCJN6.js +0 -31
  382. package/dist/list-agents-KFHKGPXV.js +0 -33
  383. package/dist/list-scenarios-F2WYNRIE.js +0 -41
  384. package/dist/list-suites-CRY4VWW6.js +0 -43
  385. package/dist/report-issue-XYVAPAYJ.js +0 -412
  386. package/dist/run-suite-NKZCJ2IN.js +0 -30
  387. package/dist/search-traces-A6HFKPLJ.js +0 -79
  388. package/dist/update-prompt-ODCRQRN6.js +0 -25
  389. package/dist/update-suite-SNO3GS7T.js +0 -40
  390. package/src/__tests__/all-tools.integration.test.ts +0 -1626
  391. package/src/__tests__/config.unit.test.ts +0 -202
  392. package/src/__tests__/datasets.integration.test.ts +0 -620
  393. package/src/__tests__/datasets.unit.test.ts +0 -244
  394. package/src/__tests__/date-parsing.unit.test.ts +0 -78
  395. package/src/__tests__/discover-evaluator-schema.unit.test.ts +0 -89
  396. package/src/__tests__/discover-schema.unit.test.ts +0 -118
  397. package/src/__tests__/docker.integration.test.ts +0 -318
  398. package/src/__tests__/documentation-fetch-security.integration.test.ts +0 -182
  399. package/src/__tests__/evaluator-tools.unit.test.ts +0 -262
  400. package/src/__tests__/experiment-list-tools.unit.test.ts +0 -157
  401. package/src/__tests__/experiment-status.unit.test.ts +0 -194
  402. package/src/__tests__/feature-map-tool-drift.unit.test.ts +0 -93
  403. package/src/__tests__/get-experiment-results.unit.test.ts +0 -313
  404. package/src/__tests__/http-security-origin.unit.test.ts +0 -97
  405. package/src/__tests__/http-security-sessions.unit.test.ts +0 -209
  406. package/src/__tests__/http-security-verifier.unit.test.ts +0 -248
  407. package/src/__tests__/http-server-allocation.integration.test.ts +0 -279
  408. package/src/__tests__/http-server-origin.integration.test.ts +0 -169
  409. package/src/__tests__/http-server-session-auth.integration.test.ts +0 -341
  410. package/src/__tests__/http-transport.integration.test.ts +0 -395
  411. package/src/__tests__/integration.integration.test.ts +0 -288
  412. package/src/__tests__/langwatch-api.unit.test.ts +0 -661
  413. package/src/__tests__/model-provider-tools.unit.test.ts +0 -190
  414. package/src/__tests__/project-api-key-tools.unit.test.ts +0 -451
  415. package/src/__tests__/public-http-request-security.integration.test.ts +0 -118
  416. package/src/__tests__/report-issue.integration.test.ts +0 -147
  417. package/src/__tests__/scenario-tools.integration.test.ts +0 -286
  418. package/src/__tests__/scenario-tools.unit.test.ts +0 -188
  419. package/src/__tests__/schemas.unit.test.ts +0 -85
  420. package/src/__tests__/support/http-server-harness.ts +0 -138
  421. package/src/__tests__/tools.unit.test.ts +0 -924
  422. package/src/langwatch-api-suites.ts +0 -118
  423. package/src/schemas/filter-fields.ts +0 -119
  424. package/src/schemas/index.ts +0 -4
  425. package/src/tools/archive-suite.ts +0 -12
  426. package/src/tools/create-suite.ts +0 -42
  427. package/src/tools/get-suite.ts +0 -47
  428. package/src/tools/list-suites.ts +0 -43
  429. package/src/tools/run-suite.ts +0 -28
  430. package/src/tools/update-suite.ts +0 -44
@@ -1,2191 +0,0 @@
1
- import "./chunk-SAS5OB7F.js";
2
-
3
- // ../../services/langevals/ts-integration/evaluators.generated.ts
4
- import { z } from "zod";
5
- var evaluatorTypesSchema = z.string();
6
- var moneySchema = z.object({
7
- currency: z.string(),
8
- amount: z.number()
9
- });
10
- var evaluationResultSchema = z.object({
11
- status: z.literal("processed"),
12
- score: z.number().optional(),
13
- passed: z.boolean().optional(),
14
- label: z.string().optional(),
15
- details: z.string().optional(),
16
- cost: moneySchema.optional(),
17
- raw_response: z.any().optional()
18
- });
19
- var evaluationResultSkippedSchema = z.object({
20
- status: z.literal("skipped"),
21
- details: z.string().optional()
22
- });
23
- var evaluationResultErrorSchema = z.object({
24
- status: z.literal("error"),
25
- error_type: z.string(),
26
- details: z.string(),
27
- traceback: z.array(z.string())
28
- });
29
- var singleEvaluationResultSchema = z.union([
30
- evaluationResultSchema,
31
- evaluationResultSkippedSchema,
32
- evaluationResultErrorSchema
33
- ]);
34
- var batchEvaluationResultSchema = z.array(
35
- singleEvaluationResultSchema
36
- );
37
- var evaluatorsSchema = z.object({
38
- "openai/moderation": z.object({
39
- settings: z.object({
40
- model: z.union([
41
- z.literal("text-moderation-stable"),
42
- z.literal("text-moderation-latest")
43
- ]).describe(
44
- "The model version to use, `text-moderation-latest` will be automatically upgraded over time, while `text-moderation-stable` will only be updated with advanced notice by OpenAI."
45
- ).default("text-moderation-stable"),
46
- categories: z.object({
47
- harassment: z.boolean().default(true),
48
- harassment_threatening: z.boolean().default(true),
49
- hate: z.boolean().default(true),
50
- hate_threatening: z.boolean().default(true),
51
- self_harm: z.boolean().default(true),
52
- self_harm_instructions: z.boolean().default(true),
53
- self_harm_intent: z.boolean().default(true),
54
- sexual: z.boolean().default(true),
55
- sexual_minors: z.boolean().default(true),
56
- violence: z.boolean().default(true),
57
- violence_graphic: z.boolean().default(true)
58
- }).describe("The categories of content to check for moderation.").default({
59
- harassment: true,
60
- harassment_threatening: true,
61
- hate: true,
62
- hate_threatening: true,
63
- self_harm: true,
64
- self_harm_instructions: true,
65
- self_harm_intent: true,
66
- sexual: true,
67
- sexual_minors: true,
68
- violence: true,
69
- violence_graphic: true
70
- })
71
- })
72
- }),
73
- "ragas/bleu_score": z.object({ settings: z.record(z.string(), z.never()) }),
74
- "ragas/context_f1": z.object({
75
- settings: z.object({
76
- distance_measure: z.union([
77
- z.literal("levenshtein"),
78
- z.literal("hamming"),
79
- z.literal("jaro"),
80
- z.literal("jaro_winkler")
81
- ]).default("levenshtein")
82
- })
83
- }),
84
- "ragas/context_precision": z.object({
85
- settings: z.object({
86
- distance_measure: z.union([
87
- z.literal("levenshtein"),
88
- z.literal("hamming"),
89
- z.literal("jaro"),
90
- z.literal("jaro_winkler")
91
- ]).default("levenshtein")
92
- })
93
- }),
94
- "ragas/context_recall": z.object({
95
- settings: z.object({
96
- distance_measure: z.union([
97
- z.literal("levenshtein"),
98
- z.literal("hamming"),
99
- z.literal("jaro"),
100
- z.literal("jaro_winkler")
101
- ]).default("levenshtein")
102
- })
103
- }),
104
- "ragas/factual_correctness": z.object({
105
- settings: z.object({
106
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
107
- max_tokens: z.number().describe(
108
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
109
- ).default(2048),
110
- mode: z.union([z.literal("f1"), z.literal("precision"), z.literal("recall")]).describe("The mode to use for the factual correctness metric.").default("f1"),
111
- atomicity: z.union([z.literal("low"), z.literal("high")]).describe("The level of atomicity for claim decomposition.").default("low"),
112
- coverage: z.union([z.literal("low"), z.literal("high")]).describe("The level of coverage for claim decomposition.").default("low")
113
- })
114
- }),
115
- "ragas/faithfulness": z.object({
116
- settings: z.object({
117
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
118
- max_tokens: z.number().describe(
119
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
120
- ).default(2048),
121
- autodetect_dont_know: z.boolean().describe(
122
- "Whether to autodetect 'I don't know' in the output to avoid failing the evaluation."
123
- ).default(true)
124
- })
125
- }),
126
- "ragas/response_context_precision": z.object({
127
- settings: z.object({
128
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
129
- max_tokens: z.number().describe(
130
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
131
- ).default(2048)
132
- })
133
- }),
134
- "ragas/response_context_recall": z.object({
135
- settings: z.object({
136
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
137
- max_tokens: z.number().describe(
138
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
139
- ).default(2048)
140
- })
141
- }),
142
- "ragas/response_relevancy": z.object({
143
- settings: z.object({
144
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
145
- max_tokens: z.number().describe(
146
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
147
- ).default(2048),
148
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002")
149
- })
150
- }),
151
- "ragas/rouge_score": z.object({
152
- settings: z.object({
153
- rouge_type: z.union([z.literal("rouge1"), z.literal("rougeL")]).describe("ROUGE type").default("rouge1"),
154
- measure_type: z.union([
155
- z.literal("fmeasure"),
156
- z.literal("precision"),
157
- z.literal("recall")
158
- ]).describe("ROUGE measure type").default("fmeasure")
159
- })
160
- }),
161
- "ragas/rubrics_based_scoring": z.object({
162
- settings: z.object({
163
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
164
- max_tokens: z.number().describe(
165
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
166
- ).default(2048),
167
- rubrics: z.array(z.object({ description: z.string() })).default([
168
- { description: "The response is incorrect, irrelevant." },
169
- {
170
- description: "The response partially answers the question but includes significant errors, omissions, or irrelevant information."
171
- },
172
- {
173
- description: "The response partially answers the question but includes minor errors, omissions, or irrelevant information."
174
- },
175
- {
176
- description: "The response fully answers the question and includes minor errors, omissions, or irrelevant information."
177
- },
178
- {
179
- description: "The response fully answers the question and includes no errors, omissions, or irrelevant information."
180
- }
181
- ])
182
- })
183
- }),
184
- "ragas/sql_query_equivalence": z.object({
185
- settings: z.object({
186
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
187
- max_tokens: z.number().describe(
188
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
189
- ).default(2048)
190
- })
191
- }),
192
- "ragas/summarization_score": z.object({
193
- settings: z.object({
194
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
195
- max_tokens: z.number().describe(
196
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
197
- ).default(2048)
198
- })
199
- }),
200
- "presidio/pii_detection": z.object({
201
- settings: z.object({
202
- entities: z.object({
203
- credit_card: z.boolean().default(true),
204
- crypto: z.boolean().default(true),
205
- email_address: z.boolean().default(true),
206
- iban_code: z.boolean().default(true),
207
- ip_address: z.boolean().default(true),
208
- location: z.boolean().default(false),
209
- person: z.boolean().default(false),
210
- phone_number: z.boolean().default(true),
211
- medical_license: z.boolean().default(true),
212
- us_bank_number: z.boolean().default(false),
213
- us_driver_license: z.boolean().default(false),
214
- us_itin: z.boolean().default(false),
215
- us_passport: z.boolean().default(false),
216
- us_ssn: z.boolean().default(false),
217
- uk_nhs: z.boolean().default(false),
218
- sg_nric_fin: z.boolean().default(false),
219
- au_abn: z.boolean().default(false),
220
- au_acn: z.boolean().default(false),
221
- au_tfn: z.boolean().default(false),
222
- au_medicare: z.boolean().default(false),
223
- in_pan: z.boolean().default(false),
224
- in_aadhaar: z.boolean().default(false),
225
- in_vehicle_registration: z.boolean().default(false),
226
- in_voter: z.boolean().default(false),
227
- in_passport: z.boolean().default(false)
228
- }).describe("The types of PII to check for in the input.").default({
229
- credit_card: true,
230
- crypto: true,
231
- email_address: true,
232
- iban_code: true,
233
- ip_address: true,
234
- location: false,
235
- person: false,
236
- phone_number: true,
237
- medical_license: true,
238
- us_bank_number: false,
239
- us_driver_license: false,
240
- us_itin: false,
241
- us_passport: false,
242
- us_ssn: false,
243
- uk_nhs: false,
244
- sg_nric_fin: false,
245
- au_abn: false,
246
- au_acn: false,
247
- au_tfn: false,
248
- au_medicare: false,
249
- in_pan: false,
250
- in_aadhaar: false,
251
- in_vehicle_registration: false,
252
- in_voter: false,
253
- in_passport: false
254
- }),
255
- min_threshold: z.number().describe(
256
- "The minimum confidence required for failing the evaluation on a PII match."
257
- ).default(0.5)
258
- })
259
- }),
260
- "azure/content_safety": z.object({
261
- settings: z.object({
262
- severity_threshold: z.union([
263
- z.literal(1),
264
- z.literal(2),
265
- z.literal(3),
266
- z.literal(4),
267
- z.literal(5),
268
- z.literal(6),
269
- z.literal(7)
270
- ]).describe(
271
- "The minimum severity level to consider content as unsafe, from 1 to 7."
272
- ).default(1),
273
- categories: z.object({
274
- Hate: z.boolean().default(true),
275
- SelfHarm: z.boolean().default(true),
276
- Sexual: z.boolean().default(true),
277
- Violence: z.boolean().default(true)
278
- }).describe("The categories of moderation to check for.").default({ Hate: true, SelfHarm: true, Sexual: true, Violence: true }),
279
- output_type: z.union([
280
- z.literal("FourSeverityLevels"),
281
- z.literal("EightSeverityLevels")
282
- ]).describe(
283
- "The type of severity levels to return on the full 0-7 severity scale, it can be either the trimmed version with four values (0, 2, 4, 6 scores) or the whole range."
284
- ).default("FourSeverityLevels")
285
- })
286
- }),
287
- "azure/jailbreak": z.object({ settings: z.record(z.string(), z.never()) }),
288
- "azure/prompt_injection": z.object({
289
- settings: z.record(z.string(), z.never())
290
- }),
291
- "lingua/language_detection": z.object({
292
- settings: z.object({
293
- check_for: z.union([
294
- z.literal("input_matches_output"),
295
- z.literal("output_matches_language")
296
- ]).describe("What should be checked").default("input_matches_output"),
297
- expected_language: z.union([
298
- z.literal("AF"),
299
- z.literal("AR"),
300
- z.literal("AZ"),
301
- z.literal("BE"),
302
- z.literal("BG"),
303
- z.literal("BN"),
304
- z.literal("BS"),
305
- z.literal("CA"),
306
- z.literal("CS"),
307
- z.literal("CY"),
308
- z.literal("DA"),
309
- z.literal("DE"),
310
- z.literal("EL"),
311
- z.literal("EN"),
312
- z.literal("EO"),
313
- z.literal("ES"),
314
- z.literal("ET"),
315
- z.literal("EU"),
316
- z.literal("FA"),
317
- z.literal("FI"),
318
- z.literal("FR"),
319
- z.literal("GA"),
320
- z.literal("GU"),
321
- z.literal("HE"),
322
- z.literal("HI"),
323
- z.literal("HR"),
324
- z.literal("HU"),
325
- z.literal("HY"),
326
- z.literal("ID"),
327
- z.literal("IS"),
328
- z.literal("IT"),
329
- z.literal("JA"),
330
- z.literal("KA"),
331
- z.literal("KK"),
332
- z.literal("KO"),
333
- z.literal("LA"),
334
- z.literal("LG"),
335
- z.literal("LT"),
336
- z.literal("LV"),
337
- z.literal("MI"),
338
- z.literal("MK"),
339
- z.literal("MN"),
340
- z.literal("MR"),
341
- z.literal("MS"),
342
- z.literal("NB"),
343
- z.literal("NL"),
344
- z.literal("NN"),
345
- z.literal("PA"),
346
- z.literal("PL"),
347
- z.literal("PT"),
348
- z.literal("RO"),
349
- z.literal("RU"),
350
- z.literal("SK"),
351
- z.literal("SL"),
352
- z.literal("SN"),
353
- z.literal("SO"),
354
- z.literal("SQ"),
355
- z.literal("SR"),
356
- z.literal("ST"),
357
- z.literal("SV"),
358
- z.literal("SW"),
359
- z.literal("TA"),
360
- z.literal("TE"),
361
- z.literal("TH"),
362
- z.literal("TL"),
363
- z.literal("TN"),
364
- z.literal("TR"),
365
- z.literal("TS"),
366
- z.literal("UK"),
367
- z.literal("UR"),
368
- z.literal("VI"),
369
- z.literal("XH"),
370
- z.literal("YO"),
371
- z.literal("ZH"),
372
- z.literal("ZU")
373
- ]).optional().describe("The specific language that the output is expected to be"),
374
- min_words: z.number().describe(
375
- "Minimum number of words to check, as the language detection can be unreliable for very short texts. Inputs shorter than the minimum will be skipped."
376
- ).default(7),
377
- threshold: z.number().describe(
378
- "Minimum confidence threshold for the language detection. If the confidence is lower than this, the evaluation will be skipped."
379
- ).default(0.25)
380
- })
381
- }),
382
- "legacy/ragas_answer_correctness": z.object({
383
- settings: z.object({
384
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
385
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
386
- max_tokens: z.number().describe(
387
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
388
- ).default(2048)
389
- })
390
- }),
391
- "legacy/ragas_answer_relevancy": z.object({
392
- settings: z.object({
393
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
394
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
395
- max_tokens: z.number().describe(
396
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
397
- ).default(2048)
398
- })
399
- }),
400
- "legacy/ragas_context_precision": z.object({
401
- settings: z.object({
402
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
403
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
404
- max_tokens: z.number().describe(
405
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
406
- ).default(2048)
407
- })
408
- }),
409
- "legacy/ragas_context_recall": z.object({
410
- settings: z.object({
411
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
412
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
413
- max_tokens: z.number().describe(
414
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
415
- ).default(2048)
416
- })
417
- }),
418
- "legacy/ragas_context_relevancy": z.object({
419
- settings: z.object({
420
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
421
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
422
- max_tokens: z.number().describe(
423
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
424
- ).default(2048)
425
- })
426
- }),
427
- "legacy/ragas_context_utilization": z.object({
428
- settings: z.object({
429
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
430
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
431
- max_tokens: z.number().describe(
432
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
433
- ).default(2048)
434
- })
435
- }),
436
- "legacy/ragas_faithfulness": z.object({
437
- settings: z.object({
438
- model: z.string().describe("The model to use for evaluation.").default("openai/gpt-5-mini"),
439
- embeddings_model: z.string().describe("The model to use for embeddings.").default("openai/text-embedding-ada-002"),
440
- max_tokens: z.number().describe(
441
- "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped."
442
- ).default(2048)
443
- })
444
- }),
445
- "langevals/basic": z.object({
446
- settings: z.object({
447
- rules: z.array(
448
- z.object({
449
- field: z.union([z.literal("input"), z.literal("output")]).default("output"),
450
- rule: z.union([
451
- z.literal("contains"),
452
- z.literal("not_contains"),
453
- z.literal("matches_regex"),
454
- z.literal("not_matches_regex")
455
- ]),
456
- value: z.string()
457
- })
458
- ).describe("List of rules to check, the message must pass all of them").default([
459
- {
460
- field: "output",
461
- rule: "not_contains",
462
- value: "artificial intelligence"
463
- }
464
- ])
465
- })
466
- }),
467
- "langevals/competitor_blocklist": z.object({
468
- settings: z.object({
469
- competitors: z.array(z.string()).describe("The competitors that must not be mentioned.").default(["OpenAI", "Google", "Microsoft"])
470
- })
471
- }),
472
- "langevals/competitor_llm": z.object({
473
- settings: z.object({
474
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
475
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
476
- name: z.string().describe("The name of your company").default("LangWatch"),
477
- description: z.string().describe("Description of what your company is specializing at").default(
478
- "We are providing an LLM observability and evaluation platform"
479
- )
480
- })
481
- }),
482
- "langevals/competitor_llm_function_call": z.object({
483
- settings: z.object({
484
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
485
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
486
- name: z.string().describe("The name of your company").default("LangWatch"),
487
- description: z.string().describe("Description of what your company is specializing at").default(
488
- "We are providing an LLM observability and evaluation platform"
489
- ),
490
- competitors: z.array(z.string()).describe("The competitors that must not be mentioned.").default(["OpenAI", "Google", "Microsoft"])
491
- })
492
- }),
493
- "langevals/exact_match": z.object({
494
- settings: z.object({
495
- case_sensitive: z.boolean().describe(
496
- "True if the comparison should be case-sensitive, False otherwise"
497
- ).default(false),
498
- trim_whitespace: z.boolean().describe(
499
- "True if the comparison should trim whitespace, False otherwise"
500
- ).default(true),
501
- remove_punctuation: z.boolean().describe(
502
- "True if the comparison should remove punctuation, False otherwise"
503
- ).default(true)
504
- })
505
- }),
506
- "langevals/llm_answer_match": z.object({
507
- settings: z.object({
508
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
509
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
510
- prompt: z.string().describe("Prompt for the comparison").default(
511
- "Verify that the predicted answer matches the gold answer for the question. Style does not matter, for example the gold answer may be more direct while the predicted answer more verbose and still be correct."
512
- )
513
- })
514
- }),
515
- "langevals/llm_boolean": z.object({
516
- settings: z.object({
517
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
518
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
519
- prompt: z.string().describe("The system prompt to use for the LLM to run the evaluation").default(
520
- "You are an LLM evaluator. We need the guarantee that the output answers what is being asked on the input, please evaluate as False if it doesn't"
521
- )
522
- })
523
- }),
524
- "langevals/llm_category": z.object({
525
- settings: z.object({
526
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
527
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
528
- prompt: z.string().describe("The system prompt to use for the LLM to run the evaluation").default(
529
- "You are an LLM category evaluator. Please categorize the message in one of the following categories"
530
- ),
531
- categories: z.array(z.object({ name: z.string(), description: z.string() })).describe("The categories to use for the evaluation").default([
532
- { name: "smalltalk", description: "Smalltalk with the user" },
533
- {
534
- name: "company",
535
- description: "Questions about the company, what we do, etc"
536
- }
537
- ])
538
- })
539
- }),
540
- "langevals/llm_score": z.object({
541
- settings: z.object({
542
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
543
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
544
- prompt: z.string().describe("The system prompt to use for the LLM to run the evaluation").default(
545
- "You are an LLM evaluator. Please score from 0.0 to 1.0 how likely the user is to be satisfied with this answer, from 0.0 being not satisfied at all to 1.0 being completely satisfied"
546
- )
547
- })
548
- }),
549
- "langevals/off_topic": z.object({
550
- settings: z.object({
551
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
552
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
553
- allowed_topics: z.array(z.object({ topic: z.string(), description: z.string() })).describe(
554
- "The list of topics and their short descriptions that the chatbot is allowed to talk about"
555
- ).default([
556
- { topic: "simple_chat", description: "Smalltalk with the user" },
557
- {
558
- topic: "company",
559
- description: "Questions about the company, what we do, etc"
560
- }
561
- ])
562
- })
563
- }),
564
- "langevals/pairwise_compare": z.object({
565
- settings: z.object({
566
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
567
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
568
- prompt: z.string().describe("Judge prompt template (golden-aware by default)").default(
569
- 'Compare two candidate outputs against a known-good reference (golden answer).\n\nTask: {input}\nGolden answer: {golden}\n\nCandidate A: {candidate_a_output}\nCandidate B: {candidate_b_output}\n\nReason step-by-step about how closely each candidate matches the\ngolden answer in correctness, completeness, and style. Then pick\nthe better candidate, or "tie" if equivalent.\nPrefer cheaper/faster only when quality is comparable.\n'
570
- ),
571
- has_golden_answer: z.boolean().describe(
572
- "Compare each candidate against a reference answer. Turn off to have the judge compare Candidate A and Candidate B directly on their own merits, with no reference answer involved."
573
- ).default(true),
574
- swap_and_confirm: z.boolean().describe(
575
- "Run two judge calls with A/B positions swapped; tie on disagreement. Doubles judge cost but materially reduces position bias (PandaLM: 68% -> 51%)."
576
- ).default(true),
577
- allow_tie: z.boolean().describe(
578
- "Allow the judge to return 'tie' when candidates are equivalent"
579
- ).default(true),
580
- include_metrics: z.array(z.union([z.literal("cost"), z.literal("duration")])).describe("Per-candidate metrics to inject into the judge prompt").default([])
581
- })
582
- }),
583
- "langevals/query_resolution": z.object({
584
- settings: z.object({
585
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
586
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3)
587
- })
588
- }),
589
- "langevals/select_best_compare": z.object({
590
- settings: z.object({
591
- model: z.string().describe("The model to use for evaluation").default("openai/gpt-5-mini"),
592
- max_tokens: z.number().describe("Max tokens allowed for evaluation").default(128e3),
593
- prompt: z.string().describe(
594
- "Judge prompt template. Placeholders: {input}, {golden}, {candidates} (a pre-rendered bulleted list with slot labels and optional per-candidate metrics)."
595
- ).default(
596
- `Pick the best of N candidate replies to the task.
597
-
598
- Task: {input}
599
- Reference: {golden}
600
-
601
- Candidates:
602
- {candidates}
603
-
604
- Look across the candidates and decide which one is the best reply.
605
- Briefly explain WHY it's better than the others, then pick the winning
606
- slot label. Use "tie" only when no candidate is clearly better.
607
- `
608
- ),
609
- has_golden_answer: z.boolean().describe(
610
- "Compare each candidate against a reference answer. Turn off to have the judge compare the candidates directly on their own merits, with no reference answer involved."
611
- ).default(false),
612
- randomize_order: z.boolean().describe(
613
- "Shuffle candidate order per row (deterministically, seeded by row_index) before presenting them to the judge. Reduces position bias when the judge is called once per row."
614
- ).default(true),
615
- allow_tie: z.boolean().describe(
616
- "Allow the judge to return 'tie' when candidates are equivalent"
617
- ).default(true),
618
- include_metrics: z.array(z.union([z.literal("cost"), z.literal("duration")])).describe("Per-candidate metrics to inject into the judge prompt").default([]),
619
- temperature: z.number().describe(
620
- "Sampling temperature for the judge call. Lower is more deterministic."
621
- ).default(0),
622
- swap_and_reconcile: z.boolean().describe(
623
- "Check each row twice, the second time with the candidate order reversed, and record no result for that row when the two disagree \u2014 rather than a tie, which would claim the candidates are equally good. Doubles judge-call cost per row (literature: swapping candidate order alone flips 10-30% of verdicts on contested rows)."
624
- ).default(true)
625
- })
626
- }),
627
- "langevals/sentiment": z.object({
628
- settings: z.object({
629
- embeddings_model: z.string().describe("The embeddings model to use for sentiment analysis").default("openai/text-embedding-3-small"),
630
- positive_reference: z.string().describe(
631
- "Reference phrase representing the positive end of the sentiment scale"
632
- ).default("Comment of a very happy and satisfied user"),
633
- negative_reference: z.string().describe(
634
- "Reference phrase representing the negative end of the sentiment scale"
635
- ).default("Comment of a user who is extremely dissatisfied"),
636
- normalization_factor: z.number().describe(
637
- "Controls sentiment sensitivity. Decrease to make scores more extreme (fewer neutrals), increase to make scores more moderate (more neutrals)"
638
- ).default(0.1)
639
- })
640
- }),
641
- "langevals/similarity": z.object({
642
- settings: z.object({
643
- field: z.union([z.literal("input"), z.literal("output")]).default("output"),
644
- rule: z.union([z.literal("is_not_similar_to"), z.literal("is_similar_to")]).default("is_not_similar_to"),
645
- value: z.string().default("example"),
646
- threshold: z.number().default(0.3),
647
- embeddings_model: z.string().default("openai/text-embedding-3-small")
648
- })
649
- }),
650
- "langevals/valid_format": z.object({
651
- settings: z.object({
652
- format: z.union([
653
- z.literal("json"),
654
- z.literal("markdown"),
655
- z.literal("python"),
656
- z.literal("sql")
657
- ]).default("json"),
658
- json_schema: z.string().optional().describe("JSON schema to validate against when format is 'json'")
659
- })
660
- })
661
- });
662
- var AVAILABLE_EVALUATORS = {
663
- "openai/moderation": {
664
- name: `OpenAI Moderation`,
665
- description: `
666
- This evaluator uses OpenAI's moderation API to detect potentially harmful content in text,
667
- including harassment, hate speech, self-harm, sexual content, and violence.
668
- `,
669
- category: "safety",
670
- docsUrl: "https://platform.openai.com/docs/guides/moderation/overview",
671
- isGuardrail: true,
672
- requiredFields: [],
673
- optionalFields: ["input", "output"],
674
- settings: {
675
- model: {
676
- description: "The model version to use, `text-moderation-latest` will be automatically upgraded over time, while `text-moderation-stable` will only be updated with advanced notice by OpenAI.",
677
- default: "text-moderation-stable"
678
- },
679
- categories: {
680
- description: "The categories of content to check for moderation.",
681
- default: {
682
- harassment: true,
683
- harassment_threatening: true,
684
- hate: true,
685
- hate_threatening: true,
686
- self_harm: true,
687
- self_harm_instructions: true,
688
- self_harm_intent: true,
689
- sexual: true,
690
- sexual_minors: true,
691
- violence: true,
692
- violence_graphic: true
693
- }
694
- }
695
- },
696
- envVars: ["OPENAI_API_KEY"],
697
- result: {
698
- score: {
699
- description: "The model's confidence on primary category where the input violates the OpenAI's policy. The value is between 0 and 1, where higher values denote higher confidence."
700
- },
701
- passed: {
702
- description: "Fails if any moderation category is flagged"
703
- }
704
- }
705
- },
706
- "ragas/bleu_score": {
707
- name: `BLEU Score`,
708
- description: `
709
- Traditional NLP metric. BLEU score for evaluating the similarity between two strings.
710
- `,
711
- category: "quality",
712
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/traditional/#bleu-score",
713
- isGuardrail: false,
714
- requiredFields: ["output", "expected_output"],
715
- optionalFields: [],
716
- settings: {},
717
- envVars: [],
718
- result: {
719
- score: {
720
- description: "BLEU similarity score"
721
- }
722
- }
723
- },
724
- "ragas/context_f1": {
725
- name: `Context F1`,
726
- description: `
727
- Balances between precision and recall for context retrieval, increasing it means a better signal-to-noise ratio. Uses traditional string distance metrics.
728
- `,
729
- category: "rag",
730
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_F1/#non-llm-based-context-F1",
731
- isGuardrail: false,
732
- requiredFields: ["contexts", "expected_contexts"],
733
- optionalFields: [],
734
- settings: {
735
- distance_measure: {
736
- description: void 0,
737
- default: "levenshtein"
738
- }
739
- },
740
- envVars: [],
741
- result: {
742
- score: {
743
- description: "A score between 0.0 and 1.0 indicating the F1 score."
744
- }
745
- }
746
- },
747
- "ragas/context_precision": {
748
- name: `Context Precision`,
749
- description: `
750
- Measures how accurate is the retrieval compared to expected contexts, increasing it means less noise in the retrieval. Uses traditional string distance metrics.
751
- `,
752
- category: "rag",
753
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_precision/#non-llm-based-context-precision",
754
- isGuardrail: false,
755
- requiredFields: ["contexts", "expected_contexts"],
756
- optionalFields: [],
757
- settings: {
758
- distance_measure: {
759
- description: void 0,
760
- default: "levenshtein"
761
- }
762
- },
763
- envVars: [],
764
- result: {
765
- score: {
766
- description: "A score between 0.0 and 1.0 indicating the precision score."
767
- }
768
- }
769
- },
770
- "ragas/context_recall": {
771
- name: `Context Recall`,
772
- description: `
773
- Measures how many relevant contexts were retrieved compared to expected contexts, increasing it means more signal in the retrieval. Uses traditional string distance metrics.
774
- `,
775
- category: "rag",
776
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_recall/#non-llm-based-context-recall",
777
- isGuardrail: false,
778
- requiredFields: ["contexts", "expected_contexts"],
779
- optionalFields: [],
780
- settings: {
781
- distance_measure: {
782
- description: void 0,
783
- default: "levenshtein"
784
- }
785
- },
786
- envVars: [],
787
- result: {
788
- score: {
789
- description: "A score between 0.0 and 1.0 indicating the Recall score."
790
- }
791
- }
792
- },
793
- "ragas/factual_correctness": {
794
- name: `LLM Factual Match`,
795
- description: `
796
- Computes with an LLM how factually similar the generated answer is to the expected output.
797
- `,
798
- category: "quality",
799
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/factual_correctness/",
800
- isGuardrail: false,
801
- requiredFields: ["output", "expected_output"],
802
- optionalFields: [],
803
- settings: {
804
- model: {
805
- description: "The model to use for evaluation.",
806
- default: "openai/gpt-5-mini"
807
- },
808
- max_tokens: {
809
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
810
- default: 2048
811
- },
812
- mode: {
813
- description: "The mode to use for the factual correctness metric.",
814
- default: "f1"
815
- },
816
- atomicity: {
817
- description: "The level of atomicity for claim decomposition.",
818
- default: "low"
819
- },
820
- coverage: {
821
- description: "The level of coverage for claim decomposition.",
822
- default: "low"
823
- }
824
- },
825
- envVars: [],
826
- result: {
827
- score: {
828
- description: "A score between 0.0 and 1.0 indicating how factually similar the generated answer is to the expected output."
829
- }
830
- }
831
- },
832
- "ragas/faithfulness": {
833
- name: `Ragas Faithfulness`,
834
- description: `
835
- This evaluator assesses the extent to which the generated answer is consistent with the provided context. Higher scores indicate better faithfulness to the context, useful for detecting hallucinations.
836
- `,
837
- category: "rag",
838
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/",
839
- isGuardrail: false,
840
- requiredFields: ["output", "contexts"],
841
- optionalFields: ["input"],
842
- settings: {
843
- model: {
844
- description: "The model to use for evaluation.",
845
- default: "openai/gpt-5-mini"
846
- },
847
- max_tokens: {
848
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
849
- default: 2048
850
- },
851
- autodetect_dont_know: {
852
- description: "Whether to autodetect 'I don't know' in the output to avoid failing the evaluation.",
853
- default: true
854
- }
855
- },
856
- envVars: [],
857
- result: {
858
- score: {
859
- description: "A score between 0.0 and 1.0 indicating the faithfulness of the answer."
860
- }
861
- }
862
- },
863
- "ragas/response_context_precision": {
864
- name: `Ragas Response Context Precision`,
865
- description: `
866
- Uses an LLM to measure the proportion of chunks in the retrieved context that were relevant to generate the output or the expected output.
867
- `,
868
- category: "rag",
869
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_precision/#context-precision-without-reference",
870
- isGuardrail: false,
871
- requiredFields: ["input", "contexts"],
872
- optionalFields: ["output", "expected_output"],
873
- settings: {
874
- model: {
875
- description: "The model to use for evaluation.",
876
- default: "openai/gpt-5-mini"
877
- },
878
- max_tokens: {
879
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
880
- default: 2048
881
- }
882
- },
883
- envVars: [],
884
- result: {
885
- score: {
886
- description: "A score between 0.0 and 1.0 indicating the precision of the retrieved context."
887
- }
888
- }
889
- },
890
- "ragas/response_context_recall": {
891
- name: `Ragas Response Context Recall`,
892
- description: `
893
- Uses an LLM to measure how many of relevant documents attributable the claims in the output were successfully retrieved in order to generate an expected output.
894
- `,
895
- category: "rag",
896
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_recall/#llm-based-context-recall",
897
- isGuardrail: false,
898
- requiredFields: ["input", "output", "contexts", "expected_output"],
899
- optionalFields: [],
900
- settings: {
901
- model: {
902
- description: "The model to use for evaluation.",
903
- default: "openai/gpt-5-mini"
904
- },
905
- max_tokens: {
906
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
907
- default: 2048
908
- }
909
- },
910
- envVars: [],
911
- result: {
912
- score: {
913
- description: "A score between 0.0 and 1.0 indicating the recall of the retrieved context."
914
- }
915
- }
916
- },
917
- "ragas/response_relevancy": {
918
- name: `Ragas Response Relevancy`,
919
- description: `
920
- Evaluates how pertinent the generated answer is to the given prompt. Higher scores indicate better relevancy.
921
- `,
922
- category: "quality",
923
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/answer_relevance/",
924
- isGuardrail: false,
925
- requiredFields: ["input", "output"],
926
- optionalFields: [],
927
- settings: {
928
- model: {
929
- description: "The model to use for evaluation.",
930
- default: "openai/gpt-5-mini"
931
- },
932
- max_tokens: {
933
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
934
- default: 2048
935
- },
936
- embeddings_model: {
937
- description: "The model to use for embeddings.",
938
- default: "openai/text-embedding-ada-002"
939
- }
940
- },
941
- envVars: [],
942
- result: {
943
- score: {
944
- description: "A score between 0.0 and 1.0 indicating the relevance of the answer."
945
- }
946
- }
947
- },
948
- "ragas/rouge_score": {
949
- name: `ROUGE Score`,
950
- description: `
951
- Traditional NLP metric. ROUGE score for evaluating the similarity between two strings.
952
- `,
953
- category: "quality",
954
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/traditional/#rouge-score",
955
- isGuardrail: false,
956
- requiredFields: ["output", "expected_output"],
957
- optionalFields: [],
958
- settings: {
959
- rouge_type: {
960
- description: "ROUGE type",
961
- default: "rouge1"
962
- },
963
- measure_type: {
964
- description: "ROUGE measure type",
965
- default: "fmeasure"
966
- }
967
- },
968
- envVars: [],
969
- result: {
970
- score: {
971
- description: "ROUGE similarity score"
972
- }
973
- }
974
- },
975
- "ragas/rubrics_based_scoring": {
976
- name: `Rubrics Based Scoring`,
977
- description: `
978
- Rubric-based evaluation metric that is used to evaluate responses. The rubric consists of descriptions for each score, typically ranging from 1 to 5
979
- `,
980
- category: "quality",
981
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/general_purpose/#rubrics-based-criteria-scoring",
982
- isGuardrail: false,
983
- requiredFields: ["input", "output"],
984
- optionalFields: ["expected_output"],
985
- settings: {
986
- model: {
987
- description: "The model to use for evaluation.",
988
- default: "openai/gpt-5-mini"
989
- },
990
- max_tokens: {
991
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
992
- default: 2048
993
- },
994
- rubrics: {
995
- description: void 0,
996
- default: [
997
- {
998
- description: "The response is incorrect, irrelevant."
999
- },
1000
- {
1001
- description: "The response partially answers the question but includes significant errors, omissions, or irrelevant information."
1002
- },
1003
- {
1004
- description: "The response partially answers the question but includes minor errors, omissions, or irrelevant information."
1005
- },
1006
- {
1007
- description: "The response fully answers the question and includes minor errors, omissions, or irrelevant information."
1008
- },
1009
- {
1010
- description: "The response fully answers the question and includes no errors, omissions, or irrelevant information."
1011
- }
1012
- ]
1013
- }
1014
- },
1015
- envVars: [],
1016
- result: {
1017
- score: {
1018
- description: "A score according to the rubrics, typically between 1 and 5."
1019
- }
1020
- }
1021
- },
1022
- "ragas/sql_query_equivalence": {
1023
- name: `SQL Query Equivalence`,
1024
- description: `
1025
- Checks if the SQL query is equivalent to a reference one by using an LLM to infer if it would generate the same results given the table schemas.
1026
- `,
1027
- category: "quality",
1028
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/sql/#sql-query-semantic-equivalence",
1029
- isGuardrail: false,
1030
- requiredFields: ["output", "expected_output", "expected_contexts"],
1031
- optionalFields: [],
1032
- settings: {
1033
- model: {
1034
- description: "The model to use for evaluation.",
1035
- default: "openai/gpt-5-mini"
1036
- },
1037
- max_tokens: {
1038
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1039
- default: 2048
1040
- }
1041
- },
1042
- envVars: [],
1043
- result: {
1044
- passed: {
1045
- description: "Whether the SQL query is equivalent to the expected one."
1046
- }
1047
- }
1048
- },
1049
- "ragas/summarization_score": {
1050
- name: `Summarization Score`,
1051
- description: `
1052
- Measures how well the summary captures important information from the retrieved contexts.
1053
- `,
1054
- category: "quality",
1055
- docsUrl: "https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/summarization_score/",
1056
- isGuardrail: false,
1057
- requiredFields: ["output", "contexts"],
1058
- optionalFields: [],
1059
- settings: {
1060
- model: {
1061
- description: "The model to use for evaluation.",
1062
- default: "openai/gpt-5-mini"
1063
- },
1064
- max_tokens: {
1065
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1066
- default: 2048
1067
- }
1068
- },
1069
- envVars: [],
1070
- result: {
1071
- score: {
1072
- description: "A score between 0.0 and 1.0 indicating the summarization quality."
1073
- }
1074
- }
1075
- },
1076
- "presidio/pii_detection": {
1077
- name: `Presidio PII Detection`,
1078
- description: `
1079
- Detects personally identifiable information in text, including phone numbers, email addresses, and
1080
- social security numbers. It allows customization of the detection threshold and the specific types of PII to check.
1081
- `,
1082
- category: "safety",
1083
- docsUrl: "https://microsoft.github.io/presidio",
1084
- isGuardrail: true,
1085
- requiredFields: [],
1086
- optionalFields: ["input", "output"],
1087
- settings: {
1088
- entities: {
1089
- description: "The types of PII to check for in the input.",
1090
- default: {
1091
- credit_card: true,
1092
- crypto: true,
1093
- email_address: true,
1094
- iban_code: true,
1095
- ip_address: true,
1096
- location: false,
1097
- person: false,
1098
- phone_number: true,
1099
- medical_license: true,
1100
- us_bank_number: false,
1101
- us_driver_license: false,
1102
- us_itin: false,
1103
- us_passport: false,
1104
- us_ssn: false,
1105
- uk_nhs: false,
1106
- sg_nric_fin: false,
1107
- au_abn: false,
1108
- au_acn: false,
1109
- au_tfn: false,
1110
- au_medicare: false,
1111
- in_pan: false,
1112
- in_aadhaar: false,
1113
- in_vehicle_registration: false,
1114
- in_voter: false,
1115
- in_passport: false
1116
- }
1117
- },
1118
- min_threshold: {
1119
- description: "The minimum confidence required for failing the evaluation on a PII match.",
1120
- default: 0.5
1121
- }
1122
- },
1123
- envVars: [],
1124
- result: {
1125
- score: {
1126
- description: "Amount of PII detected, 0 means no PII detected"
1127
- },
1128
- passed: {
1129
- description: "If true then no PII was detected, if false then at least one PII was detected"
1130
- }
1131
- }
1132
- },
1133
- "azure/content_safety": {
1134
- name: `Azure Content Safety`,
1135
- description: `
1136
- This evaluator detects potentially unsafe content in text, including hate speech,
1137
- self-harm, sexual content, and violence. It allows customization of the severity
1138
- threshold and the specific categories to check.
1139
- `,
1140
- category: "safety",
1141
- docsUrl: "https://learn.microsoft.com/en-us/azure/ai-services/content-safety/quickstart-text",
1142
- isGuardrail: true,
1143
- requiredFields: [],
1144
- optionalFields: ["input", "output"],
1145
- settings: {
1146
- severity_threshold: {
1147
- description: "The minimum severity level to consider content as unsafe, from 1 to 7.",
1148
- default: 1
1149
- },
1150
- categories: {
1151
- description: "The categories of moderation to check for.",
1152
- default: {
1153
- Hate: true,
1154
- SelfHarm: true,
1155
- Sexual: true,
1156
- Violence: true
1157
- }
1158
- },
1159
- output_type: {
1160
- description: "The type of severity levels to return on the full 0-7 severity scale, it can be either the trimmed version with four values (0, 2, 4, 6 scores) or the whole range.",
1161
- default: "FourSeverityLevels"
1162
- }
1163
- },
1164
- envVars: ["AZURE_CONTENT_SAFETY_ENDPOINT", "AZURE_CONTENT_SAFETY_KEY"],
1165
- result: {
1166
- score: {
1167
- description: "The severity level of the detected content from 0 to 7. A higher score indicates higher severity."
1168
- }
1169
- }
1170
- },
1171
- "azure/jailbreak": {
1172
- name: `Azure Jailbreak Detection`,
1173
- description: `
1174
- This evaluator checks for jailbreak-attempt in the input using Azure's Content Safety API.
1175
- `,
1176
- category: "safety",
1177
- docsUrl: "",
1178
- isGuardrail: true,
1179
- requiredFields: ["input"],
1180
- optionalFields: [],
1181
- settings: {},
1182
- envVars: ["AZURE_CONTENT_SAFETY_ENDPOINT", "AZURE_CONTENT_SAFETY_KEY"],
1183
- result: {
1184
- passed: {
1185
- description: "If true then no jailbreak was detected, if false then a jailbreak was detected"
1186
- }
1187
- }
1188
- },
1189
- "azure/prompt_injection": {
1190
- name: `Azure Prompt Shield`,
1191
- description: `
1192
- This evaluator checks for prompt injection attempt in the input and the contexts using Azure's Content Safety API.
1193
- `,
1194
- category: "safety",
1195
- docsUrl: "https://learn.microsoft.com/en-us/azure/ai-services/content-safety/concepts/jailbreak-detection",
1196
- isGuardrail: true,
1197
- requiredFields: ["input"],
1198
- optionalFields: ["contexts"],
1199
- settings: {},
1200
- envVars: ["AZURE_CONTENT_SAFETY_ENDPOINT", "AZURE_CONTENT_SAFETY_KEY"],
1201
- result: {
1202
- passed: {
1203
- description: "If true then no prompt injection was detected, if false then a prompt injection was detected"
1204
- }
1205
- }
1206
- },
1207
- "lingua/language_detection": {
1208
- name: `Lingua Language Detection`,
1209
- description: `
1210
- This evaluator detects the language of the input and output text to check for example if the generated answer is in the same language as the prompt,
1211
- or if it's in a specific expected language.
1212
- `,
1213
- category: "quality",
1214
- docsUrl: "https://github.com/pemistahl/lingua-py",
1215
- isGuardrail: true,
1216
- requiredFields: ["output"],
1217
- optionalFields: ["input"],
1218
- settings: {
1219
- check_for: {
1220
- description: "What should be checked",
1221
- default: "input_matches_output"
1222
- },
1223
- expected_language: {
1224
- description: "The specific language that the output is expected to be",
1225
- default: void 0
1226
- },
1227
- min_words: {
1228
- description: "Minimum number of words to check, as the language detection can be unreliable for very short texts. Inputs shorter than the minimum will be skipped.",
1229
- default: 7
1230
- },
1231
- threshold: {
1232
- description: "Minimum confidence threshold for the language detection. If the confidence is lower than this, the evaluation will be skipped.",
1233
- default: 0.25
1234
- }
1235
- },
1236
- envVars: [],
1237
- result: {
1238
- passed: {
1239
- description: "Passes if the detected language on the output matches the detected language on the input, or if the output matches the expected language"
1240
- },
1241
- label: {
1242
- description: "Language detected on the input for input_matches_output, or language detected on the output for output_matches_language"
1243
- }
1244
- }
1245
- },
1246
- "legacy/ragas_answer_correctness": {
1247
- name: `Ragas Answer Correctness`,
1248
- description: `
1249
- Computes with an LLM a weighted combination of factual as well as semantic similarity between the generated answer and the expected output.
1250
- `,
1251
- category: "rag",
1252
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/answer_correctness.html",
1253
- isGuardrail: false,
1254
- requiredFields: ["output", "expected_output"],
1255
- optionalFields: ["input"],
1256
- settings: {
1257
- model: {
1258
- description: "The model to use for evaluation.",
1259
- default: "openai/gpt-5-mini"
1260
- },
1261
- embeddings_model: {
1262
- description: "The model to use for embeddings.",
1263
- default: "openai/text-embedding-ada-002"
1264
- },
1265
- max_tokens: {
1266
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1267
- default: 2048
1268
- }
1269
- },
1270
- envVars: [],
1271
- result: {
1272
- score: {
1273
- description: "A score between 0.0 and 1.0 indicating the correctness of the answer."
1274
- }
1275
- }
1276
- },
1277
- "legacy/ragas_answer_relevancy": {
1278
- name: `Ragas Answer Relevancy`,
1279
- description: `
1280
- Evaluates how pertinent the generated answer is to the given prompt. Higher scores indicate better relevancy.
1281
- `,
1282
- category: "rag",
1283
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/answer_relevance.html",
1284
- isGuardrail: false,
1285
- requiredFields: ["input", "output"],
1286
- optionalFields: [],
1287
- settings: {
1288
- model: {
1289
- description: "The model to use for evaluation.",
1290
- default: "openai/gpt-5-mini"
1291
- },
1292
- embeddings_model: {
1293
- description: "The model to use for embeddings.",
1294
- default: "openai/text-embedding-ada-002"
1295
- },
1296
- max_tokens: {
1297
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1298
- default: 2048
1299
- }
1300
- },
1301
- envVars: [],
1302
- result: {
1303
- score: {
1304
- description: "A score between 0.0 and 1.0 indicating the relevance of the answer."
1305
- }
1306
- }
1307
- },
1308
- "legacy/ragas_context_precision": {
1309
- name: `Ragas Context Precision`,
1310
- description: `
1311
- This metric evaluates whether all of the ground-truth relevant items present in the contexts are ranked higher or not. Higher scores indicate better precision.
1312
- `,
1313
- category: "rag",
1314
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/context_precision.html",
1315
- isGuardrail: false,
1316
- requiredFields: ["input", "contexts", "expected_output"],
1317
- optionalFields: [],
1318
- settings: {
1319
- model: {
1320
- description: "The model to use for evaluation.",
1321
- default: "openai/gpt-5-mini"
1322
- },
1323
- embeddings_model: {
1324
- description: "The model to use for embeddings.",
1325
- default: "openai/text-embedding-ada-002"
1326
- },
1327
- max_tokens: {
1328
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1329
- default: 2048
1330
- }
1331
- },
1332
- envVars: [],
1333
- result: {
1334
- score: {
1335
- description: "A score between 0.0 and 1.0 indicating the precision of the context."
1336
- }
1337
- }
1338
- },
1339
- "legacy/ragas_context_recall": {
1340
- name: `Ragas Context Recall`,
1341
- description: `
1342
- This evaluator measures the extent to which the retrieved context aligns with the annotated answer, treated as the ground truth. Higher values indicate better performance.
1343
- `,
1344
- category: "rag",
1345
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/context_recall.html",
1346
- isGuardrail: false,
1347
- requiredFields: ["input", "contexts", "expected_output"],
1348
- optionalFields: [],
1349
- settings: {
1350
- model: {
1351
- description: "The model to use for evaluation.",
1352
- default: "openai/gpt-5-mini"
1353
- },
1354
- embeddings_model: {
1355
- description: "The model to use for embeddings.",
1356
- default: "openai/text-embedding-ada-002"
1357
- },
1358
- max_tokens: {
1359
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1360
- default: 2048
1361
- }
1362
- },
1363
- envVars: [],
1364
- result: {
1365
- score: {
1366
- description: "A score between 0.0 and 1.0 indicating the recall of the context."
1367
- }
1368
- }
1369
- },
1370
- "legacy/ragas_context_relevancy": {
1371
- name: `Ragas Context Relevancy`,
1372
- description: `
1373
- This metric gauges the relevancy of the retrieved context, calculated based on both the question and contexts. The values fall within the range of (0, 1), with higher values indicating better relevancy.
1374
- `,
1375
- category: "rag",
1376
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/context_relevancy.html",
1377
- isGuardrail: false,
1378
- requiredFields: ["output", "contexts"],
1379
- optionalFields: [],
1380
- settings: {
1381
- model: {
1382
- description: "The model to use for evaluation.",
1383
- default: "openai/gpt-5-mini"
1384
- },
1385
- embeddings_model: {
1386
- description: "The model to use for embeddings.",
1387
- default: "openai/text-embedding-ada-002"
1388
- },
1389
- max_tokens: {
1390
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1391
- default: 2048
1392
- }
1393
- },
1394
- envVars: [],
1395
- result: {
1396
- score: {
1397
- description: "A score between 0.0 and 1.0 indicating the relevancy of the context."
1398
- }
1399
- }
1400
- },
1401
- "legacy/ragas_context_utilization": {
1402
- name: `Ragas Context Utilization`,
1403
- description: `
1404
- This metric evaluates whether all of the output relevant items present in the contexts are ranked higher or not. Higher scores indicate better utilization.
1405
- `,
1406
- category: "rag",
1407
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/context_precision.html",
1408
- isGuardrail: false,
1409
- requiredFields: ["input", "output", "contexts"],
1410
- optionalFields: [],
1411
- settings: {
1412
- model: {
1413
- description: "The model to use for evaluation.",
1414
- default: "openai/gpt-5-mini"
1415
- },
1416
- embeddings_model: {
1417
- description: "The model to use for embeddings.",
1418
- default: "openai/text-embedding-ada-002"
1419
- },
1420
- max_tokens: {
1421
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1422
- default: 2048
1423
- }
1424
- },
1425
- envVars: [],
1426
- result: {
1427
- score: {
1428
- description: "A score between 0.0 and 1.0 indicating the utilization of the context."
1429
- }
1430
- }
1431
- },
1432
- "legacy/ragas_faithfulness": {
1433
- name: `Ragas Faithfulness`,
1434
- description: `
1435
- This evaluator assesses the extent to which the generated answer is consistent with the provided context. Higher scores indicate better faithfulness to the context, useful for detecting hallucinations.
1436
- `,
1437
- category: "rag",
1438
- docsUrl: "https://docs.ragas.io/en/latest/concepts/metrics/faithfulness.html",
1439
- isGuardrail: false,
1440
- requiredFields: ["output", "contexts"],
1441
- optionalFields: [],
1442
- settings: {
1443
- model: {
1444
- description: "The model to use for evaluation.",
1445
- default: "openai/gpt-5-mini"
1446
- },
1447
- embeddings_model: {
1448
- description: "The model to use for embeddings.",
1449
- default: "openai/text-embedding-ada-002"
1450
- },
1451
- max_tokens: {
1452
- description: "The maximum number of tokens allowed for evaluation, a too high number can be costly. Entries above this amount will be skipped.",
1453
- default: 2048
1454
- }
1455
- },
1456
- envVars: [],
1457
- result: {
1458
- score: {
1459
- description: "A score between 0.0 and 1.0 indicating the faithfulness of the answer."
1460
- }
1461
- }
1462
- },
1463
- "langevals/basic": {
1464
- name: `Custom Basic Evaluator`,
1465
- description: `
1466
- Allows you to check for simple text matches or regex evaluation.
1467
- `,
1468
- category: "custom",
1469
- docsUrl: "",
1470
- isGuardrail: true,
1471
- requiredFields: [],
1472
- optionalFields: ["input", "output"],
1473
- settings: {
1474
- rules: {
1475
- description: "List of rules to check, the message must pass all of them",
1476
- default: [
1477
- {
1478
- field: "output",
1479
- rule: "not_contains",
1480
- value: "artificial intelligence"
1481
- }
1482
- ]
1483
- }
1484
- },
1485
- envVars: [],
1486
- result: {
1487
- passed: {
1488
- description: "True if all rules pass, False if any rule fails"
1489
- }
1490
- }
1491
- },
1492
- "langevals/competitor_blocklist": {
1493
- name: `Competitor Blocklist`,
1494
- description: `
1495
- This evaluator checks if any of the specified competitors was mentioned
1496
- `,
1497
- category: "policy",
1498
- docsUrl: "https://path/to/official/docs",
1499
- isGuardrail: true,
1500
- requiredFields: [],
1501
- optionalFields: ["output", "input"],
1502
- settings: {
1503
- competitors: {
1504
- description: "The competitors that must not be mentioned.",
1505
- default: ["OpenAI", "Google", "Microsoft"]
1506
- }
1507
- },
1508
- envVars: [],
1509
- result: {
1510
- score: {
1511
- description: "Number of competitors mentioned in the input and output"
1512
- },
1513
- passed: {
1514
- description: "Is the message containing explicit mention of competitor"
1515
- }
1516
- }
1517
- },
1518
- "langevals/competitor_llm": {
1519
- name: `Competitor Allowlist Check`,
1520
- description: `
1521
- This evaluator use an LLM-as-judge to check if the conversation is related to competitors, without having to name them explicitly
1522
- `,
1523
- category: "policy",
1524
- docsUrl: "",
1525
- isGuardrail: true,
1526
- requiredFields: [],
1527
- optionalFields: ["output", "input"],
1528
- settings: {
1529
- model: {
1530
- description: "The model to use for evaluation",
1531
- default: "openai/gpt-5-mini"
1532
- },
1533
- max_tokens: {
1534
- description: "Max tokens allowed for evaluation",
1535
- default: 128e3
1536
- },
1537
- name: {
1538
- description: "The name of your company",
1539
- default: "LangWatch"
1540
- },
1541
- description: {
1542
- description: "Description of what your company is specializing at",
1543
- default: "We are providing an LLM observability and evaluation platform"
1544
- }
1545
- },
1546
- envVars: [],
1547
- result: {
1548
- score: {
1549
- description: "Confidence that the message is competitor free"
1550
- },
1551
- passed: {
1552
- description: "Is the message related to the competitors"
1553
- }
1554
- }
1555
- },
1556
- "langevals/competitor_llm_function_call": {
1557
- name: `Competitor LLM Check`,
1558
- description: `
1559
- This evaluator implements LLM-as-a-judge with a function call approach to check if the message contains a mention of a competitor.
1560
- `,
1561
- category: "policy",
1562
- docsUrl: "",
1563
- isGuardrail: true,
1564
- requiredFields: [],
1565
- optionalFields: ["output", "input"],
1566
- settings: {
1567
- model: {
1568
- description: "The model to use for evaluation",
1569
- default: "openai/gpt-5-mini"
1570
- },
1571
- max_tokens: {
1572
- description: "Max tokens allowed for evaluation",
1573
- default: 128e3
1574
- },
1575
- name: {
1576
- description: "The name of your company",
1577
- default: "LangWatch"
1578
- },
1579
- description: {
1580
- description: "Description of what your company is specializing at",
1581
- default: "We are providing an LLM observability and evaluation platform"
1582
- },
1583
- competitors: {
1584
- description: "The competitors that must not be mentioned.",
1585
- default: ["OpenAI", "Google", "Microsoft"]
1586
- }
1587
- },
1588
- envVars: [],
1589
- result: {
1590
- score: {
1591
- description: "Number of unique competitors mentioned"
1592
- },
1593
- passed: {
1594
- description: "Is the message related to the competitors"
1595
- }
1596
- }
1597
- },
1598
- "langevals/exact_match": {
1599
- name: `Exact Match Evaluator`,
1600
- description: `
1601
- A simple evaluator that checks if the output matches the expected_output exactly.
1602
- `,
1603
- category: "quality",
1604
- docsUrl: "",
1605
- isGuardrail: false,
1606
- requiredFields: [],
1607
- optionalFields: ["output", "expected_output"],
1608
- settings: {
1609
- case_sensitive: {
1610
- description: "True if the comparison should be case-sensitive, False otherwise",
1611
- default: false
1612
- },
1613
- trim_whitespace: {
1614
- description: "True if the comparison should trim whitespace, False otherwise",
1615
- default: true
1616
- },
1617
- remove_punctuation: {
1618
- description: "True if the comparison should remove punctuation, False otherwise",
1619
- default: true
1620
- }
1621
- },
1622
- envVars: [],
1623
- result: {
1624
- passed: {
1625
- description: "True if the output matched the expected_output exactly, False otherwise"
1626
- }
1627
- }
1628
- },
1629
- "langevals/llm_answer_match": {
1630
- name: `LLM Answer Match`,
1631
- description: `
1632
- Uses an LLM to check if the generated output answers a question correctly the same way as the expected output, even if their style is different.
1633
- `,
1634
- category: "quality",
1635
- docsUrl: "",
1636
- isGuardrail: false,
1637
- requiredFields: [],
1638
- optionalFields: ["input", "output", "expected_output"],
1639
- settings: {
1640
- model: {
1641
- description: "The model to use for evaluation",
1642
- default: "openai/gpt-5-mini"
1643
- },
1644
- max_tokens: {
1645
- description: "Max tokens allowed for evaluation",
1646
- default: 128e3
1647
- },
1648
- prompt: {
1649
- description: "Prompt for the comparison",
1650
- default: "Verify that the predicted answer matches the gold answer for the question. Style does not matter, for example the gold answer may be more direct while the predicted answer more verbose and still be correct."
1651
- }
1652
- },
1653
- envVars: [],
1654
- result: {
1655
- passed: {
1656
- description: "Whether the predicted answer matches the gold answer"
1657
- }
1658
- }
1659
- },
1660
- "langevals/llm_boolean": {
1661
- name: `LLM-as-a-Judge Boolean Evaluator`,
1662
- description: `
1663
- Use an LLM as a judge with a custom prompt to do a true/false boolean evaluation of the message.
1664
- `,
1665
- category: "custom",
1666
- docsUrl: "",
1667
- isGuardrail: true,
1668
- requiredFields: [],
1669
- optionalFields: ["input", "output", "contexts"],
1670
- settings: {
1671
- model: {
1672
- description: "The model to use for evaluation",
1673
- default: "openai/gpt-5-mini"
1674
- },
1675
- max_tokens: {
1676
- description: "Max tokens allowed for evaluation",
1677
- default: 128e3
1678
- },
1679
- prompt: {
1680
- description: "The system prompt to use for the LLM to run the evaluation",
1681
- default: "You are an LLM evaluator. We need the guarantee that the output answers what is being asked on the input, please evaluate as False if it doesn't"
1682
- }
1683
- },
1684
- envVars: [],
1685
- result: {
1686
- passed: {
1687
- description: "The veredict given by the LLM"
1688
- }
1689
- }
1690
- },
1691
- "langevals/llm_category": {
1692
- name: `LLM-as-a-Judge Category Evaluator`,
1693
- description: `
1694
- Use an LLM as a judge with a custom prompt to classify the message into custom defined categories.
1695
- `,
1696
- category: "custom",
1697
- docsUrl: "",
1698
- isGuardrail: false,
1699
- requiredFields: [],
1700
- optionalFields: ["input", "output", "contexts"],
1701
- settings: {
1702
- model: {
1703
- description: "The model to use for evaluation",
1704
- default: "openai/gpt-5-mini"
1705
- },
1706
- max_tokens: {
1707
- description: "Max tokens allowed for evaluation",
1708
- default: 128e3
1709
- },
1710
- prompt: {
1711
- description: "The system prompt to use for the LLM to run the evaluation",
1712
- default: "You are an LLM category evaluator. Please categorize the message in one of the following categories"
1713
- },
1714
- categories: {
1715
- description: "The categories to use for the evaluation",
1716
- default: [
1717
- {
1718
- name: "smalltalk",
1719
- description: "Smalltalk with the user"
1720
- },
1721
- {
1722
- name: "company",
1723
- description: "Questions about the company, what we do, etc"
1724
- }
1725
- ]
1726
- }
1727
- },
1728
- envVars: [],
1729
- result: {
1730
- label: {
1731
- description: "The detected category of the message"
1732
- }
1733
- }
1734
- },
1735
- "langevals/llm_score": {
1736
- name: `LLM-as-a-Judge Score Evaluator`,
1737
- description: `
1738
- Use an LLM as a judge with custom prompt to do a numeric score evaluation of the message.
1739
- `,
1740
- category: "custom",
1741
- docsUrl: "",
1742
- isGuardrail: false,
1743
- requiredFields: [],
1744
- optionalFields: ["input", "output", "contexts"],
1745
- settings: {
1746
- model: {
1747
- description: "The model to use for evaluation",
1748
- default: "openai/gpt-5-mini"
1749
- },
1750
- max_tokens: {
1751
- description: "Max tokens allowed for evaluation",
1752
- default: 128e3
1753
- },
1754
- prompt: {
1755
- description: "The system prompt to use for the LLM to run the evaluation",
1756
- default: "You are an LLM evaluator. Please score from 0.0 to 1.0 how likely the user is to be satisfied with this answer, from 0.0 being not satisfied at all to 1.0 being completely satisfied"
1757
- }
1758
- },
1759
- envVars: [],
1760
- result: {
1761
- score: {
1762
- description: "The score given by the LLM, according to the prompt"
1763
- }
1764
- }
1765
- },
1766
- "langevals/off_topic": {
1767
- name: `Off Topic Evaluator`,
1768
- description: `
1769
- This evaluator checks if the user message is concerning one of the allowed topics of the chatbot
1770
- `,
1771
- category: "policy",
1772
- docsUrl: "",
1773
- isGuardrail: true,
1774
- requiredFields: ["input"],
1775
- optionalFields: [],
1776
- settings: {
1777
- model: {
1778
- description: "The model to use for evaluation",
1779
- default: "openai/gpt-5-mini"
1780
- },
1781
- max_tokens: {
1782
- description: "Max tokens allowed for evaluation",
1783
- default: 128e3
1784
- },
1785
- allowed_topics: {
1786
- description: "The list of topics and their short descriptions that the chatbot is allowed to talk about",
1787
- default: [
1788
- {
1789
- topic: "simple_chat",
1790
- description: "Smalltalk with the user"
1791
- },
1792
- {
1793
- topic: "company",
1794
- description: "Questions about the company, what we do, etc"
1795
- }
1796
- ]
1797
- }
1798
- },
1799
- envVars: [],
1800
- result: {
1801
- score: {
1802
- description: "Confidence level of the intent prediction"
1803
- },
1804
- passed: {
1805
- description: "Is the message concerning allowed topic"
1806
- },
1807
- label: {
1808
- description: "The detected intent or 'other' if the intent is not in the allowed topics"
1809
- }
1810
- }
1811
- },
1812
- "langevals/pairwise_compare": {
1813
- name: `Pairwise Compare (deprecated)`,
1814
- description: `
1815
- Compare two candidate outputs against a reference answer and pick the
1816
- better one. Superseded by Comparison, which judges two or more candidates.
1817
- `,
1818
- category: "quality",
1819
- docsUrl: "",
1820
- isGuardrail: false,
1821
- requiredFields: [
1822
- "candidate_a_id",
1823
- "candidate_a_output",
1824
- "candidate_b_id",
1825
- "candidate_b_output"
1826
- ],
1827
- optionalFields: [
1828
- "input",
1829
- "golden",
1830
- "candidate_a_cost",
1831
- "candidate_a_duration",
1832
- "candidate_b_cost",
1833
- "candidate_b_duration"
1834
- ],
1835
- settings: {
1836
- model: {
1837
- description: "The model to use for evaluation",
1838
- default: "openai/gpt-5-mini"
1839
- },
1840
- max_tokens: {
1841
- description: "Max tokens allowed for evaluation",
1842
- default: 128e3
1843
- },
1844
- prompt: {
1845
- description: "Judge prompt template (golden-aware by default)",
1846
- default: 'Compare two candidate outputs against a known-good reference (golden answer).\n\nTask: {input}\nGolden answer: {golden}\n\nCandidate A: {candidate_a_output}\nCandidate B: {candidate_b_output}\n\nReason step-by-step about how closely each candidate matches the\ngolden answer in correctness, completeness, and style. Then pick\nthe better candidate, or "tie" if equivalent.\nPrefer cheaper/faster only when quality is comparable.\n'
1847
- },
1848
- has_golden_answer: {
1849
- description: "Compare each candidate against a reference answer. Turn off to have the judge compare Candidate A and Candidate B directly on their own merits, with no reference answer involved.",
1850
- default: true
1851
- },
1852
- swap_and_confirm: {
1853
- description: "Run two judge calls with A/B positions swapped; tie on disagreement. Doubles judge cost but materially reduces position bias (PandaLM: 68% -> 51%).",
1854
- default: true
1855
- },
1856
- allow_tie: {
1857
- description: "Allow the judge to return 'tie' when candidates are equivalent",
1858
- default: true
1859
- },
1860
- include_metrics: {
1861
- description: "Per-candidate metrics to inject into the judge prompt",
1862
- default: []
1863
- }
1864
- },
1865
- envVars: [],
1866
- result: {
1867
- score: {
1868
- description: "0=A wins, 1=B wins, 0.5=tie"
1869
- },
1870
- label: {
1871
- description: "Winner identifier: candidate_a_id, candidate_b_id, or 'tie'. Programmatic consumers can read this directly without dereferencing the evaluator's candidate slot mapping."
1872
- }
1873
- }
1874
- },
1875
- "langevals/query_resolution": {
1876
- name: `Query Resolution`,
1877
- description: `
1878
- This evaluator checks if all the user queries in the conversation were resolved. Useful to detect when the bot doesn't know how to answer or can't help the user.
1879
- `,
1880
- category: "quality",
1881
- docsUrl: "",
1882
- isGuardrail: false,
1883
- requiredFields: ["conversation"],
1884
- optionalFields: [],
1885
- settings: {
1886
- model: {
1887
- description: "The model to use for evaluation",
1888
- default: "openai/gpt-5-mini"
1889
- },
1890
- max_tokens: {
1891
- description: "Max tokens allowed for evaluation",
1892
- default: 128e3
1893
- }
1894
- },
1895
- envVars: [],
1896
- result: {}
1897
- },
1898
- "langevals/select_best_compare": {
1899
- name: `Comparison`,
1900
- description: `
1901
- Compare two or more candidate outputs and pick the best one, optionally
1902
- against a reference answer. The judge sees every candidate at once and
1903
- explains why the winner is better. Candidate order is shuffled so that a
1904
- candidate's position never sways the verdict, and by default each row is
1905
- checked twice \u2014 once more with the order reversed \u2014 recording no result
1906
- for that row when the two checks disagree, rather than guessing.
1907
- `,
1908
- category: "quality",
1909
- docsUrl: "",
1910
- isGuardrail: false,
1911
- requiredFields: [],
1912
- optionalFields: ["input", "golden", "candidates", "row_index"],
1913
- settings: {
1914
- model: {
1915
- description: "The model to use for evaluation",
1916
- default: "openai/gpt-5-mini"
1917
- },
1918
- max_tokens: {
1919
- description: "Max tokens allowed for evaluation",
1920
- default: 128e3
1921
- },
1922
- prompt: {
1923
- description: "Judge prompt template. Placeholders: {input}, {golden}, {candidates} (a pre-rendered bulleted list with slot labels and optional per-candidate metrics).",
1924
- default: `Pick the best of N candidate replies to the task.
1925
-
1926
- Task: {input}
1927
- Reference: {golden}
1928
-
1929
- Candidates:
1930
- {candidates}
1931
-
1932
- Look across the candidates and decide which one is the best reply.
1933
- Briefly explain WHY it's better than the others, then pick the winning
1934
- slot label. Use "tie" only when no candidate is clearly better.
1935
- `
1936
- },
1937
- has_golden_answer: {
1938
- description: "Compare each candidate against a reference answer. Turn off to have the judge compare the candidates directly on their own merits, with no reference answer involved.",
1939
- default: false
1940
- },
1941
- randomize_order: {
1942
- description: "Shuffle candidate order per row (deterministically, seeded by row_index) before presenting them to the judge. Reduces position bias when the judge is called once per row.",
1943
- default: true
1944
- },
1945
- allow_tie: {
1946
- description: "Allow the judge to return 'tie' when candidates are equivalent",
1947
- default: true
1948
- },
1949
- include_metrics: {
1950
- description: "Per-candidate metrics to inject into the judge prompt",
1951
- default: []
1952
- },
1953
- temperature: {
1954
- description: "Sampling temperature for the judge call. Lower is more deterministic.",
1955
- default: 0
1956
- },
1957
- swap_and_reconcile: {
1958
- description: "Check each row twice, the second time with the candidate order reversed, and record no result for that row when the two disagree \u2014 rather than a tie, which would claim the candidates are equally good. Doubles judge-call cost per row (literature: swapping candidate order alone flips 10-30% of verdicts on contested rows).",
1959
- default: true
1960
- }
1961
- },
1962
- envVars: [],
1963
- result: {
1964
- score: {
1965
- description: "1.0 when a winner was picked, 0.5 for tie"
1966
- },
1967
- label: {
1968
- description: "The winning candidate id (matches the id supplied in entry.candidates), or 'tie'."
1969
- }
1970
- }
1971
- },
1972
- "langevals/sentiment": {
1973
- name: `Sentiment Evaluator`,
1974
- description: `
1975
- Analyzes the sentiment of the input text by comparing its embedding similarity
1976
- to positive and negative reference phrases. Returns a score from -1.0 (very negative)
1977
- to 1.0 (very positive) and a corresponding label.
1978
- `,
1979
- category: "quality",
1980
- docsUrl: "",
1981
- isGuardrail: false,
1982
- requiredFields: ["input"],
1983
- optionalFields: [],
1984
- settings: {
1985
- embeddings_model: {
1986
- description: "The embeddings model to use for sentiment analysis",
1987
- default: "openai/text-embedding-3-small"
1988
- },
1989
- positive_reference: {
1990
- description: "Reference phrase representing the positive end of the sentiment scale",
1991
- default: "Comment of a very happy and satisfied user"
1992
- },
1993
- negative_reference: {
1994
- description: "Reference phrase representing the negative end of the sentiment scale",
1995
- default: "Comment of a user who is extremely dissatisfied"
1996
- },
1997
- normalization_factor: {
1998
- description: "Controls sentiment sensitivity. Decrease to make scores more extreme (fewer neutrals), increase to make scores more moderate (more neutrals)",
1999
- default: 0.1
2000
- }
2001
- },
2002
- envVars: [],
2003
- result: {
2004
- score: {
2005
- description: "Sentiment score from -1.0 (very negative) to 1.0 (very positive)"
2006
- },
2007
- label: {
2008
- description: "Sentiment label: 'positive' or 'negative'"
2009
- }
2010
- }
2011
- },
2012
- "langevals/similarity": {
2013
- name: `Semantic Similarity Evaluator`,
2014
- description: `
2015
- Allows you to check for semantic similarity or dissimilarity between input and output and a
2016
- target value, so you can avoid sentences that you don't want to be present without having to
2017
- match on the exact text.
2018
- `,
2019
- category: "custom",
2020
- docsUrl: "",
2021
- isGuardrail: true,
2022
- requiredFields: [],
2023
- optionalFields: ["input", "output"],
2024
- settings: {
2025
- field: {
2026
- description: void 0,
2027
- default: "output"
2028
- },
2029
- rule: {
2030
- description: void 0,
2031
- default: "is_not_similar_to"
2032
- },
2033
- value: {
2034
- description: void 0,
2035
- default: "example"
2036
- },
2037
- threshold: {
2038
- description: void 0,
2039
- default: 0.3
2040
- },
2041
- embeddings_model: {
2042
- description: void 0,
2043
- default: "openai/text-embedding-3-small"
2044
- }
2045
- },
2046
- envVars: [],
2047
- result: {
2048
- score: {
2049
- description: "How similar the input and output semantically, from 0.0 to 1.0, with 1.0 meaning the sentences are identical"
2050
- },
2051
- passed: {
2052
- description: "Passes if the cosine similarity crosses the threshold for the defined rule"
2053
- }
2054
- }
2055
- },
2056
- "langevals/valid_format": {
2057
- name: `Valid Format Evaluator`,
2058
- description: `
2059
- Allows you to check if the output is a valid json, markdown, python, sql, etc.
2060
- For JSON, can optionally validate against a provided schema.
2061
- `,
2062
- category: "quality",
2063
- docsUrl: "",
2064
- isGuardrail: true,
2065
- requiredFields: [],
2066
- optionalFields: ["output"],
2067
- settings: {
2068
- format: {
2069
- description: void 0,
2070
- default: "json"
2071
- },
2072
- json_schema: {
2073
- description: "JSON schema to validate against when format is 'json'",
2074
- default: void 0
2075
- }
2076
- },
2077
- envVars: [],
2078
- result: {
2079
- passed: {
2080
- description: "True if the output is formatted correctly, False otherwise"
2081
- }
2082
- }
2083
- }
2084
- };
2085
-
2086
- // src/tools/discover-evaluator-schema.ts
2087
- function formatEvaluatorSchema(evaluatorType) {
2088
- if (evaluatorType) {
2089
- return formatEvaluatorDetail(evaluatorType);
2090
- }
2091
- return formatEvaluatorOverview();
2092
- }
2093
- function formatEvaluatorOverview() {
2094
- const lines = [];
2095
- lines.push("# Available Evaluator Types\n");
2096
- const byCategory = /* @__PURE__ */ new Map();
2097
- for (const [type, def] of Object.entries(AVAILABLE_EVALUATORS)) {
2098
- const evalDef = def;
2099
- const oneLine = extractFirstLine(evalDef.description);
2100
- const entry = { type, name: evalDef.name, description: oneLine };
2101
- const list = byCategory.get(evalDef.category) ?? [];
2102
- list.push(entry);
2103
- byCategory.set(evalDef.category, list);
2104
- }
2105
- for (const [category, entries] of byCategory) {
2106
- lines.push(`## ${category}
2107
- `);
2108
- for (const entry of entries) {
2109
- lines.push(`- **${entry.type}** (${entry.name}): ${entry.description}`);
2110
- }
2111
- lines.push("");
2112
- }
2113
- lines.push(
2114
- "> Use `discover_schema({ category: 'evaluators', evaluatorType: '<type>' })` for full details on a specific evaluator type."
2115
- );
2116
- return lines.join("\n");
2117
- }
2118
- function formatEvaluatorDetail(evaluatorType) {
2119
- const def = AVAILABLE_EVALUATORS[evaluatorType];
2120
- if (!def) {
2121
- return `Unknown evaluator type: "${evaluatorType}". Use \`discover_schema({ category: 'evaluators' })\` to see all available types.`;
2122
- }
2123
- const lines = [];
2124
- lines.push(`# ${def.name} (\`${evaluatorType}\`)
2125
- `);
2126
- lines.push(`**Category**: ${def.category}`);
2127
- lines.push(`**Is Guardrail**: ${def.isGuardrail ? "Yes" : "No"}`);
2128
- if (def.docsUrl) {
2129
- lines.push(`**Docs**: ${def.docsUrl}`);
2130
- }
2131
- lines.push("");
2132
- lines.push(`## Description
2133
- `);
2134
- lines.push(def.description.trim());
2135
- lines.push("\n## Fields\n");
2136
- if (def.requiredFields.length > 0) {
2137
- lines.push(`**Required**: ${def.requiredFields.join(", ")}`);
2138
- } else {
2139
- lines.push("**Required**: none");
2140
- }
2141
- if (def.optionalFields.length > 0) {
2142
- lines.push(`**Optional**: ${def.optionalFields.join(", ")}`);
2143
- }
2144
- const settingsEntries = Object.entries(def.settings);
2145
- if (settingsEntries.length > 0) {
2146
- lines.push("\n## Settings\n");
2147
- for (const [key, setting] of settingsEntries) {
2148
- const s = setting;
2149
- const defaultStr = JSON.stringify(s.default);
2150
- const desc = s.description ? ` - ${s.description}` : "";
2151
- lines.push(`- **${key}**${desc}`);
2152
- lines.push(` Default: \`${defaultStr}\``);
2153
- }
2154
- }
2155
- if (def.envVars.length > 0) {
2156
- lines.push("\n## Required Environment Variables\n");
2157
- for (const envVar of def.envVars) {
2158
- lines.push(`- \`${envVar}\``);
2159
- }
2160
- }
2161
- const resultEntries = Object.entries(def.result);
2162
- if (resultEntries.length > 0) {
2163
- lines.push("\n## Result Fields\n");
2164
- for (const [key, value] of resultEntries) {
2165
- const v = value;
2166
- lines.push(`- **${key}**: ${v.description}`);
2167
- }
2168
- }
2169
- lines.push("\n## Usage Example\n");
2170
- lines.push("```json");
2171
- lines.push(JSON.stringify({
2172
- evaluatorType,
2173
- settings: Object.fromEntries(
2174
- settingsEntries.map(([key, setting]) => [key, setting.default])
2175
- )
2176
- }, null, 2));
2177
- lines.push("```");
2178
- return lines.join("\n");
2179
- }
2180
- function extractFirstLine(description) {
2181
- const trimmed = description.trim();
2182
- const firstLine = trimmed.split("\n")[0]?.trim() ?? trimmed;
2183
- if (firstLine.length > 120) {
2184
- return firstLine.slice(0, 117) + "...";
2185
- }
2186
- return firstLine;
2187
- }
2188
- export {
2189
- formatEvaluatorSchema
2190
- };
2191
- //# sourceMappingURL=discover-evaluator-schema-XTAD4X7D.js.map