evalkit-py 0.2.0.dev12__py3-none-any.whl

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 (371) hide show
  1. evalkit/__init__.py +0 -0
  2. evalkit/api/__init__.py +0 -0
  3. evalkit/api/access.py +74 -0
  4. evalkit/api/agents.py +159 -0
  5. evalkit/api/app.py +360 -0
  6. evalkit/api/auth.py +225 -0
  7. evalkit/api/cli_dist.py +10 -0
  8. evalkit/api/datasets.py +169 -0
  9. evalkit/api/deps.py +79 -0
  10. evalkit/api/download.py +15 -0
  11. evalkit/api/evaluators.py +121 -0
  12. evalkit/api/experiments.py +616 -0
  13. evalkit/api/fixtures.py +95 -0
  14. evalkit/api/harness_check.py +48 -0
  15. evalkit/api/imports.py +180 -0
  16. evalkit/api/limits.py +84 -0
  17. evalkit/api/llm_providers.py +120 -0
  18. evalkit/api/mcp/__init__.py +0 -0
  19. evalkit/api/mcp/auth.py +100 -0
  20. evalkit/api/mcp/descriptions.py +336 -0
  21. evalkit/api/mcp/models.py +259 -0
  22. evalkit/api/mcp/server.py +101 -0
  23. evalkit/api/mcp/tools.py +844 -0
  24. evalkit/api/meta.py +19 -0
  25. evalkit/api/otel.py +350 -0
  26. evalkit/api/pull.py +197 -0
  27. evalkit/api/review.py +271 -0
  28. evalkit/api/runs.py +555 -0
  29. evalkit/api/server_keys.py +44 -0
  30. evalkit/api/tokens.py +51 -0
  31. evalkit/api/trace_imports.py +173 -0
  32. evalkit/api/trace_sources.py +49 -0
  33. evalkit/api/traces.py +196 -0
  34. evalkit/api/users.py +72 -0
  35. evalkit/api/workspaces.py +131 -0
  36. evalkit/bundled/contracts/atif-accepted.json +5 -0
  37. evalkit/bundled/contracts/custom-evaluator-api-v1.json +243 -0
  38. evalkit/bundled/contracts/harness-api-v1.json +938 -0
  39. evalkit/bundled/contracts/span-mapping-v1.json +314 -0
  40. evalkit/bundled/docs/concepts.md +26 -0
  41. evalkit/bundled/docs/config.md +38 -0
  42. evalkit/bundled/docs/harness-api.md +44 -0
  43. evalkit/bundled/docs/install.md +60 -0
  44. evalkit/bundled/docs/login.md +36 -0
  45. evalkit/bundled/docs/mappings.md +136 -0
  46. evalkit/bundled/docs/mcp.md +44 -0
  47. evalkit/bundled/docs/quickstart.md +142 -0
  48. evalkit/bundled/docs/sdk-runs.md +171 -0
  49. evalkit/bundled/docs/tracing.md +171 -0
  50. evalkit/bundled/docs/try-locally.md +288 -0
  51. evalkit/bundled/docs/workspaces.md +45 -0
  52. evalkit/bundled/skills/authoring-eval-cases/SKILL.md +387 -0
  53. evalkit/bundled/skills/authoring-eval-cases/references/overlays.md +83 -0
  54. evalkit/bundled/skills/authoring-eval-cases/references/tool-checks.md +71 -0
  55. evalkit/bundled/skills/connect-traces/SKILL.md +296 -0
  56. evalkit/bundled/skills/connect-traces/references/gen_ai.json +42 -0
  57. evalkit/bundled/skills/connect-traces/references/openinference.json +35 -0
  58. evalkit/bundled/skills/connect-traces/references/span-mapping-schema.md +88 -0
  59. evalkit/bundled/skills/eval-driven-development/SKILL.md +458 -0
  60. evalkit/bundled/skills/eval-driven-development/references/analyze-run.md +97 -0
  61. evalkit/bundled/skills/eval-driven-development/references/diagnose.md +130 -0
  62. evalkit/bundled/skills/eval-driven-development/references/synthesize-cases.md +87 -0
  63. evalkit/bundled/skills/eval-driven-development/references/synthesize.md +165 -0
  64. evalkit/bundled/skills/evalkit-deployment/SKILL.md +332 -0
  65. evalkit/bundled/skills/evalkit-deployment/config.example.yaml +49 -0
  66. evalkit/bundled/skills/evalkit-deployment/docker-compose.yml +51 -0
  67. evalkit/bundled/skills/evalkit-deployment/references/config-and-deploy.md +333 -0
  68. evalkit/bundled/skills/evalkit-deployment/references/harness-api.md +139 -0
  69. evalkit/bundled/skills/evalkit-deployment/try/.env.example +11 -0
  70. evalkit/bundled/skills/evalkit-deployment/try/agent.py +131 -0
  71. evalkit/bundled/skills/evalkit-deployment/try/cases/acme/balance-sheet/cases.yaml +25 -0
  72. evalkit/bundled/skills/evalkit-deployment/try/cases/acme/income-statement/cases.yaml +43 -0
  73. evalkit/bundled/skills/evalkit-deployment/try/config.yaml +17 -0
  74. evalkit/bundled/skills/evalkit-deployment/try/docker-compose.yml +82 -0
  75. evalkit/bundled/skills/evalkit-deployment/try/evalkit.yaml +4 -0
  76. evalkit/bundled/skills/evalkit-deployment/try/mapping.json +42 -0
  77. evalkit/bundled/skills/evalkit-deployment/try/run.py +33 -0
  78. evalkit/bundled/skills/evalkit-usage/SKILL.md +509 -0
  79. evalkit/bundled/skills/evalkit-usage/references/suite-fixtures.md +42 -0
  80. evalkit/bundled/ui/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  81. evalkit/bundled/ui/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  82. evalkit/bundled/ui/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  83. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  84. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  85. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  86. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  87. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  88. evalkit/bundled/ui/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  89. evalkit/bundled/ui/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  90. evalkit/bundled/ui/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  91. evalkit/bundled/ui/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  92. evalkit/bundled/ui/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  93. evalkit/bundled/ui/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  94. evalkit/bundled/ui/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  95. evalkit/bundled/ui/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  96. evalkit/bundled/ui/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  97. evalkit/bundled/ui/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  98. evalkit/bundled/ui/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  99. evalkit/bundled/ui/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  100. evalkit/bundled/ui/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  101. evalkit/bundled/ui/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  102. evalkit/bundled/ui/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  103. evalkit/bundled/ui/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  104. evalkit/bundled/ui/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  105. evalkit/bundled/ui/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  106. evalkit/bundled/ui/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  107. evalkit/bundled/ui/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  108. evalkit/bundled/ui/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  109. evalkit/bundled/ui/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  110. evalkit/bundled/ui/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  111. evalkit/bundled/ui/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  112. evalkit/bundled/ui/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  113. evalkit/bundled/ui/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  114. evalkit/bundled/ui/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  115. evalkit/bundled/ui/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  116. evalkit/bundled/ui/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  117. evalkit/bundled/ui/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  118. evalkit/bundled/ui/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  119. evalkit/bundled/ui/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  120. evalkit/bundled/ui/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  121. evalkit/bundled/ui/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  122. evalkit/bundled/ui/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  123. evalkit/bundled/ui/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  124. evalkit/bundled/ui/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  125. evalkit/bundled/ui/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  126. evalkit/bundled/ui/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  127. evalkit/bundled/ui/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  128. evalkit/bundled/ui/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  129. evalkit/bundled/ui/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  130. evalkit/bundled/ui/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  131. evalkit/bundled/ui/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  132. evalkit/bundled/ui/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  133. evalkit/bundled/ui/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  134. evalkit/bundled/ui/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  135. evalkit/bundled/ui/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  136. evalkit/bundled/ui/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  137. evalkit/bundled/ui/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  138. evalkit/bundled/ui/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  139. evalkit/bundled/ui/assets/abap-08VXUWAP.js +1 -0
  140. evalkit/bundled/ui/assets/apex-BWPQTe0t.js +1 -0
  141. evalkit/bundled/ui/assets/azcli-Bc_sGQ0U.js +1 -0
  142. evalkit/bundled/ui/assets/bat-i0X4ZdIN.js +1 -0
  143. evalkit/bundled/ui/assets/bicep-B5-_aFwp.js +2 -0
  144. evalkit/bundled/ui/assets/cameligo-DMUM7wLl.js +1 -0
  145. evalkit/bundled/ui/assets/clojure-Cm7r79vr.js +1 -0
  146. evalkit/bundled/ui/assets/codicon-DF1abBS2.ttf +0 -0
  147. evalkit/bundled/ui/assets/coffee-Ba7i2nA0.js +1 -0
  148. evalkit/bundled/ui/assets/cpp-C7h46wYY.js +1 -0
  149. evalkit/bundled/ui/assets/csharp-BKxtCVv1.js +1 -0
  150. evalkit/bundled/ui/assets/csp-bTuwJoIa.js +1 -0
  151. evalkit/bundled/ui/assets/css-DIMkf-bt.js +3 -0
  152. evalkit/bundled/ui/assets/css.worker-DwfUZ3fB.js +96 -0
  153. evalkit/bundled/ui/assets/cssMode-C97l1pbB.js +1 -0
  154. evalkit/bundled/ui/assets/cypher-CVaqCwHa.js +1 -0
  155. evalkit/bundled/ui/assets/dart-onAF5SnQ.js +1 -0
  156. evalkit/bundled/ui/assets/dockerfile-DZFCIeNp.js +1 -0
  157. evalkit/bundled/ui/assets/ecl-94qehhXe.js +1 -0
  158. evalkit/bundled/ui/assets/editor-DjpsE8to.css +1 -0
  159. evalkit/bundled/ui/assets/editor.api-NTesIxw5.js +908 -0
  160. evalkit/bundled/ui/assets/editor.worker-CRz__AKW.js +33 -0
  161. evalkit/bundled/ui/assets/elixir-6RTg0lbw.js +1 -0
  162. evalkit/bundled/ui/assets/flow9-C5_-GSwl.js +1 -0
  163. evalkit/bundled/ui/assets/freemarker2-BWqEFagp.js +3 -0
  164. evalkit/bundled/ui/assets/fsharp-C8Ef5oNN.js +1 -0
  165. evalkit/bundled/ui/assets/go-C-y9NEjX.js +1 -0
  166. evalkit/bundled/ui/assets/graphql-fmXr3nnJ.js +1 -0
  167. evalkit/bundled/ui/assets/handlebars-DkIF-whN.js +1 -0
  168. evalkit/bundled/ui/assets/hcl-CpzslTdj.js +1 -0
  169. evalkit/bundled/ui/assets/html-C_rpeQXJ.js +1 -0
  170. evalkit/bundled/ui/assets/html.worker-D9ugpX4y.js +509 -0
  171. evalkit/bundled/ui/assets/htmlMode-B0YIq3DF.js +1 -0
  172. evalkit/bundled/ui/assets/index-Cw-jBH6M.js +736 -0
  173. evalkit/bundled/ui/assets/index-DKtoQZtm.css +1 -0
  174. evalkit/bundled/ui/assets/ini-sBoK_t0W.js +1 -0
  175. evalkit/bundled/ui/assets/java-BEtHBSE6.js +1 -0
  176. evalkit/bundled/ui/assets/javascript-D4EGhYA6.js +1 -0
  177. evalkit/bundled/ui/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  178. evalkit/bundled/ui/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  179. evalkit/bundled/ui/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  180. evalkit/bundled/ui/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  181. evalkit/bundled/ui/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  182. evalkit/bundled/ui/assets/json.worker-CV9fqkUp.js +65 -0
  183. evalkit/bundled/ui/assets/jsonMode-pQjSfIH6.js +7 -0
  184. evalkit/bundled/ui/assets/julia-Bri6UV-V.js +1 -0
  185. evalkit/bundled/ui/assets/kotlin-BOotOW0E.js +1 -0
  186. evalkit/bundled/ui/assets/less-B9JPFI3C.js +2 -0
  187. evalkit/bundled/ui/assets/lexon-CfSJPG6W.js +1 -0
  188. evalkit/bundled/ui/assets/liquid-DbrvoYjD.js +1 -0
  189. evalkit/bundled/ui/assets/lspLanguageFeatures-D0B7cH6y.js +4 -0
  190. evalkit/bundled/ui/assets/lua-CsQS60Ue.js +1 -0
  191. evalkit/bundled/ui/assets/m3-D-oSqn_W.js +1 -0
  192. evalkit/bundled/ui/assets/markdown-Cimd5fb3.js +1 -0
  193. evalkit/bundled/ui/assets/mdx-B0HrujLR.js +1 -0
  194. evalkit/bundled/ui/assets/mips-CIPQ_RoX.js +1 -0
  195. evalkit/bundled/ui/assets/monacoEditor-DsoPncxW.js +68 -0
  196. evalkit/bundled/ui/assets/monacoEditor-n7clI0si.css +1 -0
  197. evalkit/bundled/ui/assets/msdax-DauUninz.js +1 -0
  198. evalkit/bundled/ui/assets/mysql-SOo6toE5.js +1 -0
  199. evalkit/bundled/ui/assets/objective-c-FvmIjYaQ.js +1 -0
  200. evalkit/bundled/ui/assets/pascal-DrH0SRf2.js +1 -0
  201. evalkit/bundled/ui/assets/pascaligo-D-ptJ9y-.js +1 -0
  202. evalkit/bundled/ui/assets/perl-oz_6vUea.js +1 -0
  203. evalkit/bundled/ui/assets/pgsql-DTj74zXo.js +1 -0
  204. evalkit/bundled/ui/assets/php-nr791fC2.js +1 -0
  205. evalkit/bundled/ui/assets/pla-CopQ2nXW.js +1 -0
  206. evalkit/bundled/ui/assets/postiats-43DmfD33.js +1 -0
  207. evalkit/bundled/ui/assets/powerquery-D3hlyOfw.js +1 -0
  208. evalkit/bundled/ui/assets/powershell-DmHpPYUd.js +1 -0
  209. evalkit/bundled/ui/assets/protobuf-C531GsRP.js +2 -0
  210. evalkit/bundled/ui/assets/pug-Z5eAx3Zn.js +1 -0
  211. evalkit/bundled/ui/assets/python-CieHVM9n.js +1 -0
  212. evalkit/bundled/ui/assets/qsharp-DkqhCAOL.js +1 -0
  213. evalkit/bundled/ui/assets/r-BwWrilGY.js +1 -0
  214. evalkit/bundled/ui/assets/razor-sLewSMyp.js +1 -0
  215. evalkit/bundled/ui/assets/redis-ClamHrr6.js +1 -0
  216. evalkit/bundled/ui/assets/redshift-DT7zqm-g.js +1 -0
  217. evalkit/bundled/ui/assets/restructuredtext-BYgofb2h.js +1 -0
  218. evalkit/bundled/ui/assets/ruby-DezsRK8O.js +1 -0
  219. evalkit/bundled/ui/assets/rust-DdL9SqIa.js +1 -0
  220. evalkit/bundled/ui/assets/sb-CcwsVR0C.js +1 -0
  221. evalkit/bundled/ui/assets/scala-DHpiXF5c.js +1 -0
  222. evalkit/bundled/ui/assets/scheme-BeGwcela.js +1 -0
  223. evalkit/bundled/ui/assets/scss-gp-XZpBa.js +3 -0
  224. evalkit/bundled/ui/assets/shell-CC2rA5mh.js +1 -0
  225. evalkit/bundled/ui/assets/solidity-BEEn4gHE.js +1 -0
  226. evalkit/bundled/ui/assets/sophia-CRfGWb83.js +1 -0
  227. evalkit/bundled/ui/assets/sparql-D_Lu-MrJ.js +1 -0
  228. evalkit/bundled/ui/assets/sql-NEE52Syq.js +1 -0
  229. evalkit/bundled/ui/assets/st-DbInun42.js +1 -0
  230. evalkit/bundled/ui/assets/swift-Bxkupp3x.js +1 -0
  231. evalkit/bundled/ui/assets/systemverilog-Bz4Y3fRF.js +1 -0
  232. evalkit/bundled/ui/assets/tcl-DISqw1ZD.js +1 -0
  233. evalkit/bundled/ui/assets/ts.worker-DIAQkoB3.js +67741 -0
  234. evalkit/bundled/ui/assets/tsMode-BcVQ1nu0.js +11 -0
  235. evalkit/bundled/ui/assets/twig-De2hgUGE.js +1 -0
  236. evalkit/bundled/ui/assets/typescript-CUvNWd9p.js +1 -0
  237. evalkit/bundled/ui/assets/typespec-B8J7ngcE.js +1 -0
  238. evalkit/bundled/ui/assets/vb-DV3o63ZY.js +1 -0
  239. evalkit/bundled/ui/assets/wgsl-DpFanUEy.js +298 -0
  240. evalkit/bundled/ui/assets/workers-CwpYQtzp.js +1 -0
  241. evalkit/bundled/ui/assets/xml-C1HnXMdF.js +1 -0
  242. evalkit/bundled/ui/assets/yaml-D7Ey3HQu.js +1 -0
  243. evalkit/bundled/ui/favicon.svg +6 -0
  244. evalkit/bundled/ui/index.html +14 -0
  245. evalkit/cli/__init__.py +0 -0
  246. evalkit/cli/admin_commands.py +590 -0
  247. evalkit/cli/client.py +67 -0
  248. evalkit/cli/init_server.py +165 -0
  249. evalkit/cli/local_run.py +195 -0
  250. evalkit/cli/main.py +1365 -0
  251. evalkit/cli/runs_commands.py +539 -0
  252. evalkit/cli/server_commands.py +130 -0
  253. evalkit/cli/skill_targets.py +43 -0
  254. evalkit/cli/tokens_commands.py +52 -0
  255. evalkit/cli/traces_commands.py +332 -0
  256. evalkit/cli/update.py +85 -0
  257. evalkit/client/__init__.py +0 -0
  258. evalkit/client/agents.py +25 -0
  259. evalkit/client/api.py +193 -0
  260. evalkit/client/blob.py +104 -0
  261. evalkit/client/connection.py +88 -0
  262. evalkit/client/evaluators.py +11 -0
  263. evalkit/client/sessions.py +17 -0
  264. evalkit/client/store.py +139 -0
  265. evalkit/client/summary.py +46 -0
  266. evalkit/client/sync.py +198 -0
  267. evalkit/config.py +227 -0
  268. evalkit/contracts/__init__.py +0 -0
  269. evalkit/contracts/atif.py +115 -0
  270. evalkit/contracts/cases.py +456 -0
  271. evalkit/contracts/custom_evaluator.py +58 -0
  272. evalkit/contracts/enums.py +86 -0
  273. evalkit/contracts/esf.py +120 -0
  274. evalkit/contracts/harness.py +281 -0
  275. evalkit/contracts/notes.json +4 -0
  276. evalkit/contracts/notes.py +7 -0
  277. evalkit/contracts/settings.py +41 -0
  278. evalkit/core/__init__.py +0 -0
  279. evalkit/core/access.py +75 -0
  280. evalkit/core/agents.py +65 -0
  281. evalkit/core/blob.py +46 -0
  282. evalkit/core/capabilities.py +36 -0
  283. evalkit/core/costmap.py +90 -0
  284. evalkit/core/custom_eval.py +50 -0
  285. evalkit/core/data/cost_map.json +81546 -0
  286. evalkit/core/endpoints.py +31 -0
  287. evalkit/core/evaluators/__init__.py +29 -0
  288. evalkit/core/evaluators/base.py +121 -0
  289. evalkit/core/evaluators/gauges.py +84 -0
  290. evalkit/core/evaluators/presentation.py +166 -0
  291. evalkit/core/evaluators/response_time.py +21 -0
  292. evalkit/core/evaluators/rubrics.py +494 -0
  293. evalkit/core/evaluators/tool_trajectory.py +187 -0
  294. evalkit/core/evaluators/trajectory_rubrics.py +198 -0
  295. evalkit/core/fixtures.py +57 -0
  296. evalkit/core/harness.py +227 -0
  297. evalkit/core/harness_check.py +191 -0
  298. evalkit/core/importer.py +257 -0
  299. evalkit/core/judge.py +78 -0
  300. evalkit/core/lint.py +265 -0
  301. evalkit/core/overlays.py +76 -0
  302. evalkit/core/paths.py +25 -0
  303. evalkit/core/promotion.py +94 -0
  304. evalkit/core/pull.py +198 -0
  305. evalkit/core/python_eval.py +59 -0
  306. evalkit/core/remote_evaluators.py +32 -0
  307. evalkit/core/review.py +220 -0
  308. evalkit/core/run_digest.py +421 -0
  309. evalkit/core/runner.py +995 -0
  310. evalkit/core/scorecard.py +255 -0
  311. evalkit/core/traces/__init__.py +0 -0
  312. evalkit/core/traces/convert.py +336 -0
  313. evalkit/core/traces/importer.py +113 -0
  314. evalkit/core/traces/mapping.py +385 -0
  315. evalkit/core/traces/poll.py +38 -0
  316. evalkit/core/traces/raw.py +21 -0
  317. evalkit/core/traces/sessions.py +172 -0
  318. evalkit/core/traces/settle.py +14 -0
  319. evalkit/core/traces/sources/__init__.py +19 -0
  320. evalkit/core/traces/sources/base.py +25 -0
  321. evalkit/core/traces/sources/phoenix.py +121 -0
  322. evalkit/core/trajectory.py +248 -0
  323. evalkit/core/workspace.py +30 -0
  324. evalkit/credentials.py +119 -0
  325. evalkit/db/__init__.py +0 -0
  326. evalkit/db/agents.py +289 -0
  327. evalkit/db/alembic/env.py +90 -0
  328. evalkit/db/alembic/script.py.mako +28 -0
  329. evalkit/db/alembic/versions/0011_baseline.py +1002 -0
  330. evalkit/db/alembic/versions/0012_ticket_token_kind.py +27 -0
  331. evalkit/db/alembic/versions/0013_keys_and_llm_providers.py +67 -0
  332. evalkit/db/cases.py +608 -0
  333. evalkit/db/crypto.py +12 -0
  334. evalkit/db/evaluators.py +156 -0
  335. evalkit/db/experiments.py +363 -0
  336. evalkit/db/fixture_blobs.py +91 -0
  337. evalkit/db/keys.py +78 -0
  338. evalkit/db/llm_providers.py +176 -0
  339. evalkit/db/locks.py +6 -0
  340. evalkit/db/mappings.py +168 -0
  341. evalkit/db/models.py +567 -0
  342. evalkit/db/promotion.py +271 -0
  343. evalkit/db/rekey.py +46 -0
  344. evalkit/db/review.py +250 -0
  345. evalkit/db/review_state.py +50 -0
  346. evalkit/db/runs.py +533 -0
  347. evalkit/db/scorecard.py +300 -0
  348. evalkit/db/session.py +71 -0
  349. evalkit/db/sessions.py +90 -0
  350. evalkit/db/spans.py +360 -0
  351. evalkit/db/store.py +209 -0
  352. evalkit/db/tokens.py +100 -0
  353. evalkit/db/trace_imports.py +308 -0
  354. evalkit/db/trace_sources.py +131 -0
  355. evalkit/db/users.py +186 -0
  356. evalkit/db/workspaces.py +232 -0
  357. evalkit/paths.py +33 -0
  358. evalkit/sdk/__init__.py +29 -0
  359. evalkit/sdk/binding.py +69 -0
  360. evalkit/sdk/evaluators.py +56 -0
  361. evalkit/sdk/runner.py +957 -0
  362. evalkit/sdk/tracing.py +166 -0
  363. evalkit/store/__init__.py +0 -0
  364. evalkit/store/base.py +354 -0
  365. evalkit/store/blob.py +69 -0
  366. evalkit/version.py +44 -0
  367. evalkit_py-0.2.0.dev12.dist-info/METADATA +205 -0
  368. evalkit_py-0.2.0.dev12.dist-info/RECORD +371 -0
  369. evalkit_py-0.2.0.dev12.dist-info/WHEEL +4 -0
  370. evalkit_py-0.2.0.dev12.dist-info/entry_points.txt +2 -0
  371. evalkit_py-0.2.0.dev12.dist-info/licenses/LICENSE +661 -0
@@ -0,0 +1,456 @@
1
+ """Pydantic schema for eval case YAML files.
2
+
3
+ Validates shape of every case on import — before any blob write or store
4
+ call. Unknown evaluator keys or missing required fields fail loudly here so
5
+ the author fixes them locally instead of discovering bad config at run time.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import hashlib
11
+ import json
12
+ import re
13
+ from pathlib import Path
14
+ from typing import Annotated, Any, Literal
15
+
16
+ import yaml
17
+ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
18
+
19
+ AnswerRubricType = Literal[
20
+ "factual_retrieval",
21
+ "derived_computation",
22
+ "analysis_interpretation",
23
+ ]
24
+
25
+ _SHA256_HEX = re.compile(r"^[0-9a-f]{64}$")
26
+ REGISTRY_FILENAME = "fixtures.yaml"
27
+
28
+
29
+ class FixtureEntry(BaseModel):
30
+ model_config = ConfigDict(extra="forbid")
31
+
32
+ key: Annotated[str, Field(min_length=1)]
33
+ sha256: str
34
+ context: Annotated[str, Field(min_length=1)]
35
+
36
+ @model_validator(mode="after")
37
+ def _flat_key_and_digest(self) -> FixtureEntry:
38
+ if self.key in (".", "..") or "/" in self.key or "\\" in self.key:
39
+ raise ValueError(f"fixture key {self.key!r} must be a flat filename")
40
+ if not _SHA256_HEX.match(self.sha256):
41
+ raise ValueError(f"fixture {self.key!r}: sha256 must be 64 lowercase hex chars")
42
+ return self
43
+
44
+
45
+ class FixtureRegistry(BaseModel):
46
+ model_config = ConfigDict(extra="forbid")
47
+
48
+ fixtures: list[FixtureEntry] = Field(default_factory=list)
49
+
50
+ @field_validator("fixtures", mode="before")
51
+ @classmethod
52
+ def _none_is_empty(cls, value: Any) -> Any:
53
+ return [] if value is None else value
54
+
55
+
56
+ def load_registry(path: Path) -> FixtureRegistry:
57
+ return FixtureRegistry.model_validate(yaml.safe_load(Path(path).read_text()) or {})
58
+
59
+
60
+ def is_case_yaml(path: Path) -> bool:
61
+ path = Path(path)
62
+ if path.suffix not in (".yaml", ".yml"):
63
+ return False
64
+ return path.name not in (REGISTRY_FILENAME, "manifest.yaml")
65
+
66
+
67
+ class Rubric(BaseModel):
68
+ """One thing a correct answer contains, written as a sentence."""
69
+
70
+ model_config = ConfigDict(extra="forbid")
71
+ rubric: str = Field(
72
+ min_length=1,
73
+ description="One assertion a correct answer contains, as a single"
74
+ " sentence. Carries its own subject, period, unit and expected value —"
75
+ " a figure with no stated band accepts normal roundings of itself; state"
76
+ " a band only to tighten or widen that. Never names a tool, skill or"
77
+ " data provider, and never refers to another rubric.",
78
+ )
79
+ type: AnswerRubricType = Field(
80
+ description="Which kind of check this is; drives the per-type rates."
81
+ )
82
+ source: str | None = Field(
83
+ default=None,
84
+ description="The source the answer must credit this fact to, named at the"
85
+ " level of detail the case cares about. Graded on its own citation axis."
86
+ " `factual_retrieval` only.",
87
+ )
88
+
89
+ @model_validator(mode="after")
90
+ def _source_matches_type(self) -> Rubric:
91
+ if self.source is not None and self.type != "factual_retrieval":
92
+ raise ValueError(
93
+ f"rubric {self.rubric!r} sets `source` on type {self.type!r}."
94
+ " `source` is only valid on factual_retrieval: an"
95
+ " analysis_interpretation assertion has no source by definition,"
96
+ " and a derived_computation's sources are its inputs, plural"
97
+ )
98
+ return self
99
+
100
+
101
+ class AnswerRubrics(BaseModel):
102
+ model_config = ConfigDict(extra="forbid")
103
+ rubrics: list[Rubric] = Field(
104
+ min_length=1,
105
+ description="Everything the answer must contain, one sentence each.",
106
+ )
107
+
108
+
109
+ class PresentationRubric(BaseModel):
110
+ """One property of how the reply presents its information."""
111
+
112
+ model_config = ConfigDict(extra="forbid")
113
+
114
+ rubric: str | None = Field(
115
+ default=None,
116
+ description="A presentation property the answer must have. Write the"
117
+ " property, not a description of the answer having it.",
118
+ )
119
+ forbid: str | None = Field(
120
+ default=None,
121
+ description="A presentation property the answer must NOT have. Costs its"
122
+ " points when violated; it does not zero the case.",
123
+ )
124
+ points: int = Field(
125
+ default=1,
126
+ ge=1,
127
+ le=10,
128
+ description="Weight of this rubric, relative within the case.",
129
+ )
130
+ note: str | None = Field(
131
+ default=None,
132
+ description="Qualification of this rubric written by the case author, shown to the judge.",
133
+ )
134
+
135
+ @model_validator(mode="after")
136
+ def _exactly_one(self) -> PresentationRubric:
137
+ if (self.rubric is None) == (self.forbid is None):
138
+ raise ValueError("a presentation rubric carries exactly one of rubric / forbid")
139
+ return self
140
+
141
+
142
+ class PresentationJudge(BaseModel):
143
+ """Grades HOW the reply presents its information — units shown, columns
144
+ present, an artifact relayed rather than restated. Correctness of the
145
+ figures belongs to answer_rubrics; asserting the same thing in both places
146
+ reweights it rather than making the case stricter."""
147
+
148
+ model_config = ConfigDict(extra="forbid")
149
+
150
+ rubrics: list[PresentationRubric] = Field(
151
+ min_length=1,
152
+ description="The presentation properties this answer must satisfy. At least"
153
+ " one must be a positive `rubric`.",
154
+ )
155
+
156
+ @model_validator(mode="after")
157
+ def _not_only_guards(self) -> PresentationJudge:
158
+ # An all-forbid rubric set scores 1.0 for an answer that violates nothing —
159
+ # including one that says nothing at all — so it hands out free presentation
160
+ # marks.
161
+ if all(r.rubric is None for r in self.rubrics):
162
+ raise ValueError(
163
+ "presentation_judge carries only `forbid` rubrics, which scores 1.0"
164
+ " for an answer that violates nothing. Add a positive `rubric` for"
165
+ " what the answer must show, or drop presentation_judge from this case"
166
+ )
167
+ return self
168
+
169
+
170
+ class TrajectoryRubrics(BaseModel):
171
+ """Checkpoints the recorded trajectory must show, one sentence each: an
172
+ intermediate value the derivation needs ("Retrieves FY2024 Platform revenue
173
+ as $3,522,776,000") or a process step in plain language ("Rounds the final
174
+ figure to the nearest basis point"). Order is not graded. By convention a
175
+ rubric never names a tool, skill or MCP server, so the case stays portable
176
+ across harnesses."""
177
+
178
+ model_config = ConfigDict(extra="forbid")
179
+ rubrics: list[Annotated[str, Field(min_length=1)]] = Field(min_length=1)
180
+
181
+
182
+ class ExpectedToolCall(BaseModel):
183
+ model_config = ConfigDict(extra="forbid")
184
+ name: str = Field(min_length=1, description="Tool name, exactly as the trajectory records it.")
185
+ args: dict[str, Any] = Field(default_factory=dict)
186
+ args_mode: Literal["subset", "exact", "ignore", "substring"] = Field(
187
+ default="subset",
188
+ description="subset: every expected key present and equal, extras allowed."
189
+ " exact: args equal. ignore: name alone. substring: like subset, but each"
190
+ " expected value need only appear, case-insensitively, inside the actual"
191
+ " value (lists and dicts compared as JSON text).",
192
+ )
193
+ match_overrides: dict[str, Literal["equals", "substring"]] = Field(
194
+ default_factory=dict,
195
+ description="Per-arg mode, overriding the one args_mode implies. Keys must be in args.",
196
+ )
197
+
198
+ @model_validator(mode="after")
199
+ def _validate_match_overrides(self) -> ExpectedToolCall:
200
+ if not self.match_overrides:
201
+ return self
202
+ if self.args_mode in ("exact", "ignore"):
203
+ raise ValueError("match_overrides can't be combined with args_mode 'exact' or 'ignore'")
204
+ unknown = set(self.match_overrides) - set(self.args)
205
+ if unknown:
206
+ raise ValueError(f"match_overrides keys not present in args: {sorted(unknown)}")
207
+ return self
208
+
209
+
210
+ class ToolTrajectoryMatch(BaseModel):
211
+ """Expected tool calls, matched by name and args, each against at most one
212
+ actual call. Scores the fraction found; `ordered` also requires them to
213
+ appear in this order."""
214
+
215
+ model_config = ConfigDict(extra="forbid")
216
+ expected: list[ExpectedToolCall] = Field(min_length=1)
217
+ ordered: bool = False
218
+
219
+
220
+ class RequiredToolsCalled(BaseModel):
221
+ """Tools the agent must call at least once. Scores the fraction called."""
222
+
223
+ model_config = ConfigDict(extra="forbid")
224
+ tools: list[Annotated[str, Field(min_length=1)]] = Field(min_length=1)
225
+
226
+
227
+ class MaxResponseTime(BaseModel):
228
+ """Wall-clock cap on the agent run."""
229
+
230
+ model_config = ConfigDict(extra="forbid")
231
+ max_seconds: float = Field(gt=0)
232
+
233
+
234
+ class OutputEvaluators(BaseModel):
235
+ """Evaluators that look only at the agent's returned output."""
236
+
237
+ model_config = ConfigDict(extra="forbid")
238
+
239
+ answer_rubrics: AnswerRubrics | None = None
240
+ presentation_judge: PresentationJudge | None = None
241
+ max_response_time: MaxResponseTime | None = None
242
+
243
+
244
+ class TrajectoryEvaluators(BaseModel):
245
+ """Evaluators that look only at how the agent got to its output."""
246
+
247
+ model_config = ConfigDict(extra="forbid")
248
+
249
+ trajectory_rubrics: TrajectoryRubrics | None = None
250
+ tool_trajectory_match: ToolTrajectoryMatch | None = None
251
+ required_tools_called: RequiredToolsCalled | None = None
252
+
253
+
254
+ class OverlayTrajectoryEvaluators(BaseModel):
255
+ """The harness-specific trajectory evaluators an overlay may attach."""
256
+
257
+ model_config = ConfigDict(extra="forbid")
258
+
259
+ tool_trajectory_match: ToolTrajectoryMatch | None = None
260
+ required_tools_called: RequiredToolsCalled | None = None
261
+
262
+ def as_metadata(self) -> dict[str, Any]:
263
+ return {
264
+ name: _dump_evaluator_config(value)
265
+ for name in type(self).model_fields
266
+ if (value := getattr(self, name)) is not None
267
+ }
268
+
269
+
270
+ def _dump_evaluator_config(value: Any) -> Any:
271
+ if isinstance(value, BaseModel):
272
+ return value.model_dump()
273
+ if isinstance(value, dict):
274
+ return {k: _dump_evaluator_config(v) for k, v in value.items()}
275
+ return value
276
+
277
+
278
+ class CaseEvaluators(BaseModel):
279
+ """Case's evaluator opt-ins: built-ins split into output and trajectory
280
+ families, plus opaque custom-evaluator blocks keyed by registered name."""
281
+
282
+ model_config = ConfigDict(extra="forbid")
283
+
284
+ output: OutputEvaluators = Field(default_factory=OutputEvaluators)
285
+ trajectory: TrajectoryEvaluators = Field(default_factory=TrajectoryEvaluators)
286
+ custom: dict[str, dict[str, Any]] = Field(default_factory=dict)
287
+
288
+ def as_metadata(self) -> dict[str, Any]:
289
+ out: dict[str, Any] = {}
290
+ for family in ("output", "trajectory"):
291
+ sub = getattr(self, family)
292
+ block = {
293
+ name: _dump_evaluator_config(value)
294
+ for name in type(sub).model_fields
295
+ if (value := getattr(sub, name)) is not None
296
+ }
297
+ if block:
298
+ out[family] = block
299
+ if self.custom:
300
+ out["custom"] = _dump_evaluator_config(self.custom)
301
+ return out
302
+
303
+
304
+ class Case(BaseModel):
305
+ """A single eval case authored in YAML."""
306
+
307
+ model_config = ConfigDict(extra="forbid")
308
+
309
+ id: Annotated[str, Field(min_length=1)]
310
+ tags: list[str] = Field(default_factory=list)
311
+ input: dict[str, Any] = Field(default_factory=dict)
312
+ fixtures: list[Annotated[str, Field(min_length=1)]] = Field(default_factory=list)
313
+ expected: dict[str, Any] | None = None
314
+ evaluators: CaseEvaluators = Field(default_factory=CaseEvaluators)
315
+
316
+
317
+ class OverlayEvaluators(BaseModel):
318
+ model_config = ConfigDict(extra="forbid")
319
+
320
+ custom: dict[str, dict[str, Any]] = Field(default_factory=dict)
321
+ trajectory: OverlayTrajectoryEvaluators = Field(default_factory=OverlayTrajectoryEvaluators)
322
+
323
+ @model_validator(mode="after")
324
+ def _not_empty(self) -> OverlayEvaluators:
325
+ if not self.custom and not self.trajectory.as_metadata():
326
+ raise ValueError("an overlay must attach at least one custom or trajectory evaluator")
327
+ return self
328
+
329
+
330
+ AgentName = Annotated[str, Field(min_length=1, pattern=r"^[^@]+$")]
331
+
332
+
333
+ class Overlay(BaseModel):
334
+ """Extends a case in another suite by id without touching its ground truth: only
335
+ additive tags, custom-evaluator config and tool trajectory evaluators are allowed."""
336
+
337
+ model_config = ConfigDict(extra="forbid")
338
+
339
+ extends: Annotated[str, Field(min_length=1)]
340
+ agents: Annotated[list[AgentName], Field(min_length=1)]
341
+ tags: list[str] = Field(default_factory=list)
342
+ evaluators: OverlayEvaluators
343
+
344
+
345
+ _ALLOWED_DEFAULTS = {"input", "tags", "max_response_time", "agents"}
346
+
347
+
348
+ def _apply_defaults(item: dict[str, Any], defaults: dict[str, Any]) -> dict[str, Any]:
349
+ default_input = defaults.get("input") or {}
350
+ default_tags = defaults.get("tags") or []
351
+ default_mrt = defaults.get("max_response_time")
352
+ if default_input:
353
+ item = {**item, "input": {**default_input, **(item.get("input") or {})}}
354
+ if default_tags:
355
+ item = {**item, "tags": list(dict.fromkeys(default_tags + (item.get("tags") or [])))}
356
+ if default_mrt is not None:
357
+ if isinstance(default_mrt, int | float):
358
+ default_mrt = {"max_seconds": default_mrt}
359
+ evaluators = dict(item.get("evaluators") or {})
360
+ output = dict(evaluators.get("output") or {})
361
+ if "max_response_time" not in output:
362
+ output["max_response_time"] = default_mrt
363
+ evaluators["output"] = output
364
+ item = {**item, "evaluators": evaluators}
365
+ return item
366
+
367
+
368
+ def load_cases_from_yaml(path: Path) -> tuple[list[Case], list[Overlay]]:
369
+ """Parse a YAML file into validated cases and overlays.
370
+
371
+ Accepts these top-level shapes:
372
+ - a single case dict
373
+ - a list of case/overlay dicts (overlays identified by `extends`)
374
+ - a mapping with any of `defaults`, `cases`, `overlays`
375
+ """
376
+ path = Path(path)
377
+ raw = yaml.safe_load(path.read_text())
378
+ defaults: dict[str, Any] = {}
379
+ overlay_items: list[Any] = []
380
+ if isinstance(raw, dict) and ("cases" in raw or "overlays" in raw):
381
+ defaults = raw.get("defaults") or {}
382
+ extra = set(defaults) - _ALLOWED_DEFAULTS
383
+ if extra:
384
+ raise ValueError(
385
+ f"{path}: defaults supports only {sorted(_ALLOWED_DEFAULTS)}, got {sorted(extra)}"
386
+ )
387
+ default_tags = defaults.get("tags", [])
388
+ if not isinstance(default_tags, list) or not all(
389
+ isinstance(tag, str) for tag in default_tags
390
+ ):
391
+ raise ValueError(f"{path}: defaults.tags must be a list of strings")
392
+ overlay_items = raw.get("overlays") or []
393
+ raw = raw.get("cases") or []
394
+ if isinstance(raw, dict):
395
+ raw = [raw]
396
+ if not isinstance(raw, list):
397
+ raise ValueError(
398
+ f"{path}: expected a list of cases or a single case dict, got {type(raw).__name__}"
399
+ )
400
+ case_items: list[Any] = []
401
+ for item in raw:
402
+ if isinstance(item, dict) and "extends" in item:
403
+ overlay_items.append(item)
404
+ else:
405
+ case_items.append(item)
406
+ cases = []
407
+ for item in case_items:
408
+ if isinstance(item, dict):
409
+ item = _apply_defaults(item, defaults)
410
+ cases.append(Case.model_validate(item))
411
+ default_agents = defaults.get("agents")
412
+ overlays = [
413
+ Overlay.model_validate(
414
+ {"agents": default_agents, **item}
415
+ if default_agents is not None and isinstance(item, dict)
416
+ else item
417
+ )
418
+ for item in overlay_items
419
+ ]
420
+ return cases, overlays
421
+
422
+
423
+ HASHED_FILE_FIELDS = ("key", "sha256", "context")
424
+
425
+
426
+ def content_hash(case: Case, files: list[dict[str, str]] | None = None) -> str:
427
+ hashed_files = [
428
+ {field: entry[field] for field in HASHED_FILE_FIELDS if field in entry}
429
+ for entry in files or []
430
+ ]
431
+ body = {
432
+ "input": {**case.input, "files": hashed_files},
433
+ "metadata": {
434
+ "id": case.id,
435
+ "tags": case.tags,
436
+ "expected": case.expected,
437
+ "evaluators": case.evaluators.as_metadata(),
438
+ },
439
+ }
440
+ encoded = json.dumps(body, sort_keys=True, default=str).encode("utf-8")
441
+ return hashlib.sha256(encoded).hexdigest()[:16]
442
+
443
+
444
+ def overlay_hash(overlay: Overlay) -> str:
445
+ evaluators: dict[str, Any] = {"custom": overlay.evaluators.custom}
446
+ trajectory = overlay.evaluators.trajectory.as_metadata()
447
+ if trajectory:
448
+ evaluators["trajectory"] = trajectory
449
+ body = {
450
+ "extends": overlay.extends,
451
+ "agents": overlay.agents,
452
+ "tags": overlay.tags,
453
+ "evaluators": evaluators,
454
+ }
455
+ encoded = json.dumps(body, sort_keys=True, default=str).encode("utf-8")
456
+ return hashlib.sha256(encoded).hexdigest()[:16]
@@ -0,0 +1,58 @@
1
+ from typing import Literal
2
+
3
+ from pydantic import BaseModel, ConfigDict, Field
4
+
5
+
6
+ class CustomEvaluatorModel(BaseModel):
7
+ model_config = ConfigDict(extra="allow")
8
+
9
+
10
+ class EvalCase(CustomEvaluatorModel):
11
+ id: str = Field(description="Case id.")
12
+ input: dict = Field(description="Case input, verbatim.")
13
+ expected: dict | None = Field(default=None, description="Case expected block, if any.")
14
+ config: dict = Field(
15
+ description="This case's YAML config for this evaluator. Opaque to evalkit — "
16
+ "passed through untouched."
17
+ )
18
+
19
+
20
+ class EvalRun(CustomEvaluatorModel):
21
+ answer: str = Field(
22
+ description="The agent's final answer. When the harness sent only a structured "
23
+ "output, this is that output as canonical JSON (sorted keys)."
24
+ )
25
+ output: dict | None = Field(
26
+ default=None,
27
+ description="The agent's structured output, parsed, or null when the harness sent none.",
28
+ )
29
+ trajectory: dict = Field(description="The persisted ATIF trajectory document.")
30
+
31
+
32
+ class EvalRequest(CustomEvaluatorModel):
33
+ schema_version: str = Field(default="v1", description="Custom Evaluator API version.")
34
+ evaluator: str = Field(description="The registered name being invoked.")
35
+ kind: Literal["evaluator", "gauge"] = Field(
36
+ description="'evaluator' (scores) or 'gauge' (measures)."
37
+ )
38
+ case: EvalCase
39
+ run: EvalRun
40
+
41
+
42
+ class ScoreItem(CustomEvaluatorModel):
43
+ name: str = Field(
44
+ description="Score name. Multi-score is first-class: one call may return "
45
+ "several named scores."
46
+ )
47
+ score: float | None = Field(
48
+ default=None,
49
+ description="null means 'no reading' — recorded but excluded from aggregates.",
50
+ )
51
+ label: str | None = Field(default=None, description="Optional short label.")
52
+ explanation: str | None = Field(
53
+ default=None, description="Optional. Shown in the UI and EDD bundles."
54
+ )
55
+
56
+
57
+ class EvalResponse(CustomEvaluatorModel):
58
+ scores: list[ScoreItem] = Field(description="Named scores produced by this evaluator.")
@@ -0,0 +1,86 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class WorkspaceRole(StrEnum):
5
+ WRITER = "writer"
6
+ REVIEWER = "reviewer"
7
+
8
+
9
+ class TokenKind(StrEnum):
10
+ USER = "user"
11
+ AGENT = "agent"
12
+ TICKET = "ticket"
13
+
14
+
15
+ class TrajectorySource(StrEnum):
16
+ ATIF = "atif"
17
+ OTEL = "otel"
18
+
19
+
20
+ class EvaluatorKind(StrEnum):
21
+ SCORE = "score"
22
+ GAUGE = "gauge"
23
+
24
+
25
+ class EvaluationSource(StrEnum):
26
+ BUILTIN = "builtin"
27
+ REMOTE = "remote"
28
+ CODE = "code"
29
+
30
+
31
+ class MappingStatus(StrEnum):
32
+ DRAFT = "draft"
33
+ ACTIVE = "active"
34
+ RETIRED = "retired"
35
+
36
+
37
+ class TraceProvider(StrEnum):
38
+ PHOENIX = "phoenix"
39
+
40
+
41
+ class TraceImportStatus(StrEnum):
42
+ RUNNING = "running"
43
+ STOPPING = "stopping"
44
+ STOPPED = "stopped"
45
+ DONE = "done"
46
+ FAILED = "failed"
47
+
48
+
49
+ class DatasetKind(StrEnum):
50
+ SUITE = "suite"
51
+
52
+
53
+ class SyncSource(StrEnum):
54
+ GIT = "git"
55
+ PROMOTION = "promotion"
56
+
57
+
58
+ class ExperimentStatus(StrEnum):
59
+ RUNNING = "running"
60
+ EVALUATING = "evaluating"
61
+ COMPLETED = "completed"
62
+ FAILED = "failed"
63
+
64
+
65
+ class RunStatus(StrEnum):
66
+ QUEUED = "queued"
67
+ RUNNING = "running"
68
+ COMPLETED = "completed"
69
+ FAILED = "failed"
70
+ CANCELLED = "cancelled"
71
+ TIMEOUT = "timeout"
72
+
73
+
74
+ class TrajectoryStatus(StrEnum):
75
+ VALID = "valid"
76
+ PARTIAL = "partial"
77
+ INVALID = "invalid"
78
+ UNAVAILABLE = "unavailable"
79
+
80
+
81
+ class Bucket(StrEnum):
82
+ CONTENT = "content"
83
+ TRAJECTORY = "trajectory"
84
+ PRESENTATION = "presentation"
85
+ EFFICIENCY = "efficiency"
86
+ CUSTOM = "custom"