PageSourceSearch

https://app.antsplatform.ai/_next/static/chunks/pages/project/[projectId]/evals/templates-6ce5621056820d35.js

js antsplatform.ai collected 2026-10-05 16:11:23 UTC 14,923 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="500f45f8-f327-415e-9a1b-da0302dae277",e._sentryDebugIdIdentifier="sentry-dbid-500f45f8-f327-415e-9a1b-da0302dae277")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[304],{2883:(e,a,t)=>{"use strict";t.d(a,{q:()=>d});var l=t(64476),s=t(76348),n=t(99846);let r=()=>(0,l.jsx)("div",{className:"flex items-center","data-sentry-component":"RagasLogoIcon","data-sentry-source-file":"ragas-logo.tsx",children:(0,l.jsx)("img",{src:"/assets/ragas-logo.png",alt:"Ragas Logo",width:12,height:12})});var i=t(76620);function o(e){let{maintainer:a}=e;return a.includes("Ragas")?(0,l.jsx)(r,{}):a.includes("ANTS")?(0,l.jsx)(s.T,{size:16}):(0,l.jsx)(i.A,{className:"h-4 w-4"})}function d(e){let{maintainer:a}=e;return(0,l.jsxs)(n.m_,{"data-sentry-element":"Tooltip","data-sentry-component":"MaintainerTooltip","data-sentry-source-file":"maintainer-tooltip.tsx",children:[(0,l.jsx)(n.k$,{"data-sentry-element":"TooltipTrigger","data-sentry-source-file":"maintainer-tooltip.tsx",children:(0,l.jsx)(o,{maintainer:a,"data-sentry-element":"MaintainerIcon","data-sentry-source-file":"maintainer-tooltip.tsx"})}),(0,l.jsx)(n.ZI,{"data-sentry-element":"TooltipContent","data-sentry-source-file":"maintainer-tooltip.tsx",children:a})]})}},9426:(e,a,t)=>{"use strict";t.d(a,{L:()=>s});let l=new Map([["ragas","Ragas"]]),s=e=>null===e.projectId?e.partner?"".concat((e=>{var a;return null!=(a=l.get(e))?a:"Unknown"})(e.partner)," maintained"):"ANTS maintained":"User maintained"},23098:(e,a,t)=>{"use strict";t.d(a,{X:()=>l,o:()=>s});let l={CONFIGS:"configs",TEMPLATES:"templates"},s=e=>[{value:l.CONFIGS,label:"Running Evaluators",href:"/project/".concat(e,"/evals")},{value:l.TEMPLATES,label:"Evaluator Library",href:"/project/".concat(e,"/evals/templates")}
1]},23594:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>M});var l=t(64476),s=t(44021),n=t(85446),r=t(93637),i=t(3219),o=t.n(i),d=t(7409),c=t(44547),u=t(6896),m=t(75759),p=t(84917),v=t(83929),h=t(55596),x=t(91397),g=t(64602),f=t(92838),y=t(50662),b=t(5776),j=t(23621),w=t(49657),E=t(49220),T=t(69376),C=t(2883),N=t(9426);let S=e=>{let{projectId:a}=e,{peekId:t}=(0,w._)(),{data:s}=(e=>{let{projectId:a,templateId:t}=e;return h.FH.evals.templateById.useQuery({id:t,projectId:a},{enabled:!!t})})({templateId:t,projectId:a});return s?(0,l.jsx)("div",{className:"grid h-full flex-1 grid-rows-[auto,1fr] gap-2 overflow-hidden p-4 contain-layout","data-sentry-component":"PeekViewEvaluatorTemplateDetail","data-sentry-source-file":"peek-evaluator-template-detail.tsx",children:(0,l.jsxs)("div",{className:"flex w-full flex-col items-start justify-between space-y-2 overflow-y-auto pb-4",children:[(0,l.jsxs)("div",{className:"border-border bg-muted/50 mb-1 w-full rounded-md border p-4",children:[(0,l.jsx)("h3",{className:"mb-1 text-sm font-medium",children:"Selected Evaluator"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("p",{className:"text-muted-foreground text-sm",children:s.name}),(0,l.jsx)(C.q,{maintainer:(0,N.L)(s),"data-sentry-element":"MaintainerTooltip","data-sentry-source-file":"peek-evaluator-template-detail.tsx"})]})]}),(0,l.jsx)(T.h,{projectId:a,existingEvalTemplate:s,isEditing:!1,preventRedirect:!0,useDialog:!1,"data-sentry-element":"EvalTemplateForm","data-sentry-source-file":"peek-evaluator-template-detail.tsx"},s.id)]})}):(0,l.jsx)(E.E,{className:"h-full w-full"})};var I=t(56435),D=t(55165),k=t(73586),A=t(68280),P=t(5058),L=t(62948),_=t(68726),R=t(47335);function F(e){var a,t,s;let{projectId:i}=e,o=(0,n.useRouter)(),{setDetailPageList:c}=(0,I.h)(),[u,E]=(0,y.useQueryParams)({pageIndex:(0,y.withDefault)(y.NumberParam,0),pageSize:(0,y.withDefault)(y.NumberParam,50)}),[F,V]=(0,y.useQueryParam)("search",(0,y.withDefault)(y.StringParam,null)),[U,H]=(0,b.useState)(null),[M,O]=(0,b.useState)(null),[Q,B]=(0,b.useState)(!1),[z,q]=(0,b.useState)(null),G=h.FH.useUtils(),$=h.FH.evals.templateNames.useQuery({projectId:i,page:u.pageIndex,limit:u.pageSize,searchQuery:F}),X=(0,d.lp)({projectId:i,scope:"evalJob:CUD"}),J=null!=(t=null==(a=$.data)?void 0:a.totalCount)?t:null,Y=h.FH.evals.templateById.useQuery({projectId:i,id:U},{enabled:!!U}),K=h.FH.evals.templateById.useQuery({projectId:i,id:M},{enabled:!!M}),W=(0,R.Im)("model-based-evaluations-count-evaluators"),Z=h.FH.evals.counts.useQuery({projectId:i},{enabled:!!i,trpc:{context:{skipBatch:!0}}}),{isTemplateInvalid:ee}=(0,L.r)({projectId:i}),ea=h.FH.evals.createTemplate.useMutation({onSuccess:()=>{G.evals.templateNames.invalidate(),O(null),q(null),B(!1),(0,k.G)({title:"Evaluator cloned successfully",description:"This evaluator is now available and maintained on project level."})},onError:e=>{(0,P.N)("Error cloning evaluator",e.message)}});(0,b.useEffect)(()=>{$.isSuccess&&c("eval-templates",$.data.templates.map(e=>({id:e.latestId})))},[$.isSuccess,$.data]);let et=(0,x.FB)(),el=[et.accessor("name",{header:"Name",id:"name",cell:e=>{let a=e.getValue();return a?(0,l.jsx)(j.A,{value:a}):void 0}}),et.accessor("maintainer",{id:"maintainer",header:"Maintainer",size:150,cell:e=>(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(C.q,{maintainer:e.getValue()})})}),et.accessor("latestCreatedAt",{header:"Last Edit",id:"latestCreatedAt",cell:e=>{var a;return null==(a=e.getValue())?void 0:a.toLocaleDateString()}}),et.accessor("usageCount",{header:"Usage count",id:"usageCount",enableHiding:!0,cell:e=>e.getValue()||null}),et.accessor("latestVersion",{header:"Latest Version",id:"latestVersion",enableHiding:!0,cell:e=>e.getValue()}),et.accessor("id",{header:"Id",id:"id",size:100,enableHiding:!0,cell:e=>{let a=e.getValue();return a?(0,l.jsx)(j.A,{value:a}):null}}),et.accessor("actions",{header:"Actions",id:"actions",size:100,cell:e=>{var a,t,s,n;let{row:d}=e,c=d.original.id,u=ee({provider:null!=(t=d.original.provider)?t:null,model:null!=(s=d.original.model)?s:null});return(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)(_.r,{variant:"outline",size:"sm","aria-label":"apply",disabled:u,title:u?"Evaluator requires project-level evaluation model. Set it up and start running evaluations.":void 0,hasAccess:X,limitValue:null!=(n=null==(a=Z.data)?void 0:a.configActiveCount)?n:0,limit:W,onClick:e=>{e.stopPropagation(),c&&o.push("/project/".concat(i,"/evals/new?evaluator=").concat(c))},children:"Use Evaluator"}),d.original.maintainer.includes("User")?(0,l.jsx)(r.$,{"aria-label":"edit",variant:"outline",size:"icon-xs",title:"Edit",disabled:!X,onClick:e=>{e.stopPropagation(),c&&H(c)},children:(0,l.jsx)(f.A,{className:"h-3 w-3"})}):(0,l.jsx)(r.$,{"aria-label":"clone",variant:"outline",size:"icon-xs",title:"Clone",disabled:!X,onClick:e=>{e.stopPropagation(),c&&O(c)},children:(0,l.jsx)(g.A,{className:"h-3 w-3"})})]})}})],[es,en]=(0,v.A)("evalTemplatesColumnVisibility",el),{getNavigationPath:er,expandPeek:ei}=(()=>{let e=(0,n.useRouter)(),{projectId:a,peek:t}=e.query;
1return{getNavigationPath:e=>{let a=new URL(window.location.href);a.pathname=(0,h.N9)();let t=new URLSearchParams(a.search);return t.set("peek",e.id),"".concat(a.pathname,"?").concat(t.toString())},expandPeek:(l,s)=>{if(!s)return;let n="/project/".concat(a,"/evals/templates/").concat(encodeURIComponent(t));if(l){let e="".concat("").concat(n);window.open(e,"_blank")}else e.push(n)}}})(),{setPeekView:eo}=(0,w._)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.w,{columns:el,columnVisibility:es,setColumnVisibility:en,searchConfig:{metadataSearchFields:["Name"],updateQuery:V,currentQuery:null!=F?F:void 0,tableAllowsFullTextSearch:!1,setSearchType:void 0,searchType:void 0},"data-sentry-element":"DataTableToolbar","data-sentry-source-file":"eval-templates-table.tsx"}),(0,l.jsx)(m.b,{tableName:"evalTemplates",columns:el,peekView:{itemType:"EVALUATOR",listKey:"eval-templates",onOpenChange:eo,onExpand:ei,shouldUpdateRowOnDetailPageNavigation:!0,getNavigationPath:er,children:()=>(0,l.jsx)(S,{projectId:i}),peekEventOptions:{ignoredSelectors:["[aria-label='apply'], [aria-label='actions'], [aria-label='edit'], [aria-label='clone']"]},tableDataUpdatedAt:$.dataUpdatedAt},data:$.isLoading?{isLoading:!0,isError:!1}:$.isError?{isLoading:!1,isError:!0,error:$.error.message}:{isLoading:!1,isError:!1,data:$.data.templates.map(e=>({name:e.name,maintainer:(0,N.L)(e),latestCreatedAt:e.latestCreatedAt,latestVersion:e.version,id:e.latestId,usageCount:e.usageCount,provider:e.provider,model:e.model}))},pagination:{totalCount:J,onChange:E,state:u},columnVisibility:es,onColumnVisibilityChange:en,"data-sentry-element":"DataTable","data-sentry-source-file":"eval-templates-table.tsx"}),(0,l.jsx)(D.lG,{open:!!U&&Y.isSuccess,onOpenChange:e=>{e||H(null)},"data-sentry-element":"Dialog","data-sentry-source-file":"eval-templates-table.tsx",children:(0,l.jsxs)(D.Cf,{className:"max-h-[90vh] max-w-screen-md overflow-y-auto","data-sentry-element":"DialogContent","data-sentry-source-file":"eval-templates-table.tsx",children:[(0,l.jsx)(D.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"eval-templates-table.tsx",children:(0,l.jsx)(D.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"eval-templates-table.tsx",children:"Edit evaluator"})}),(0,l.jsx)(T.h,{projectId:i,preventRedirect:!0,useDialog:!0,isEditing:!0,existingEvalTemplate:null!=(s=Y.data)?s:void 0,onFormSuccess:()=>{H(null),G.evals.templateNames.invalidate(),(0,k.G)({title:"Evaluator updated successfully",description:"You can now use this evaluator."})},"data-sentry-element":"EvalTemplateForm","data-sentry-source-file":"eval-templates-table.tsx"})]})}),(0,l.jsx)(D.lG,{open:!!M&&K.isSuccess,onOpenChange:e=>{e||(O(null),q(null))},"data-sentry-element":"Dialog","data-sentry-source-file":"eval-templates-table.tsx",children:(0,l.jsxs)(D.Cf,{className:"max-h-[90vh] max-w-screen-md overflow-y-auto","data-sentry-element":"DialogContent","data-sentry-source-file":"eval-templates-table.tsx",children:[(0,l.jsx)(D.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"eval-templates-table.tsx",children:(0,l.jsx)(D.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"eval-templates-table.tsx",children:"Clone evaluator"})}),(0,l.jsx)(T.h,{projectId:i,preventRedirect:!0,useDialog:!0,isEditing:!0,existingEvalTemplate:K.data?{name:"".concat(K.data.name," (project-level)"),description:K.data.description,prompt:K.data.prompt,vars:K.data.vars,outputSchema:K.data.outputSchema,provider:K.data.provider,model:K.data.model,modelParams:K.data.modelParams,partner:K.data.partner,projectId:i}:void 0,cloneSourceId:M,onBeforeSubmit:e=>!M||!K.data||!!K.data.projectId||(q({...e,cloneSourceId:M}),B(!0),!1),onFormSuccess:()=>{O(null),q(null),G.evals.templateNames.invalidate(),(0,k.G)({title:"Evaluator cloned successfully",description:"This evaluator is now available and maintained on project level. "})},"data-sentry-element":"EvalTemplateForm","data-sentry-source-file":"eval-templates-table.tsx"})]})}),(0,l.jsx)(D.lG,{open:Q,onOpenChange:e=>{!e&&z&&(z.referencedEvaluators=A.ip.PERSIST,ea.mutate(z)),B(e)},"data-sentry-element":"Dialog","data-sentry-source-file":"eval-templates-table.tsx",children:(0,l.jsxs)(D.Cf,{"data-sentry-element":"DialogContent","data-sentry-source-file":"eval-templates-table.tsx",children:[(0,l.jsxs)(D.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"eval-templates-table.tsx",children:[(0,l.jsx)(D.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"eval-templates-table.tsx",children:"Update running evaluators?"}),(0,l.jsxs)(D.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"eval-templates-table.tsx",children:["Do you want all running evaluators attached to the original ANTS evaluator to reference your new project-level version?",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),(0,l.jsx)("strong",{children:"Warning:"})," This might break workflows if you have changed variables or other critical aspects of the template."]})]}),(0,l.jsxs)(D.Es,{"data-sentry-element":"DialogFooter","data-sentry-source-file":"eval-templates-table.tsx",children:[(0,l.jsx)(r.$,{variant:"outline",onClick:()=>{z&&(z.referencedEvaluators=A.ip.PERSIST,ea.mutate(z))},"data-sentry-element":"Button","data-sentry-source-file":"eval-templates-table.tsx",children:"No, keep as is"}),(0,l.jsx)(r.$,{onClick:()=>{z&&(z.referencedEvaluators=A.ip.UPDATE,ea.mutate(z))},"data-sentry-element":"Button","data-sentry-source-file":"eval-templates-table.tsx",children:"Yes, update all references"})]})]})})]})}var V=t(50655),U=t(23098),H=t(52502);function M(){let e=(0,n.useRouter)().query.projectId,a=(0,V.B)(),t=(0,d.lp)({projectId:e,scope:"evalTemplate:CUD"});return(0,d.lp)({projectId:e,scope:"evalTemplate:read"})?(0,l.jsx)(s.A,{headerProps:{title:"LLM-as-a-Judge Evaluators",help:{description:"View all ANTS managed and custom evaluators.",href:""},tabsProps:{tabs:(0,U.o)(e),activeTab:U.X.TEMPLATES},actionButtonsRight:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(H.k,{projectId:e}),(0,l.jsx)(r.$,{disabled:!t,onClick:()=>a("eval_templates:new_form_open"),asChild:!0,variant:"default",children:(0,l.jsxs)(o(),{href:t?"/project/".concat(e,"/evals/templates/new"):"#",children:[t?(0,l.jsx)(c.A,{className:"mr-2 h-4 w-4"}):(0,l.jsx)(u.A,{className:"mr-2 h-4 w-4"}),"Custom Evaluator"]})})]})},"data-sentry-element":"Page","data-sentry-component":"TemplatesPage","data-sentry-source-file":"templates.tsx",children:(0,l.jsx)(F,{projectId:e,"data-sentry-element":"EvalsTemplateTable","data-sentry-source-file":"templates.tsx"})}):null}},23621:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});
1var l=t(64476),s=t(37855);function n(e){let{value:a,className:t}=e;return(0,l.jsx)("div",{title:a,className:(0,s.cn)("inline-block max-w-full overflow-hidden text-ellipsis text-nowrap rounded py-0.5 text-xs font-semibold",t),"data-sentry-component":"TableIdOrName","data-sentry-source-file":"table-id.tsx",children:a})}},49657:(e,a,t)=>{"use strict";t.d(a,{_:()=>r});var l=t(85446),s=t(5776),n=t(55596);let r=()=>{let e=(0,l.useRouter)(),{peek:a}=e.query,t=(0,s.useCallback)((t,l)=>{let s=new URLSearchParams(new URL(window.location.href).search),r=(0,n.N9)();if(t&&l)if(!t||l===a)return;else s.set("peek",l);else s.delete("peek");e.replace({pathname:r,query:s.toString()},void 0,{shallow:!0})},[e,a]);return{peekId:a,setPeekView:t}}},62948:(e,a,t)=>{"use strict";t.d(a,{r:()=>s});var l=t(55596);function s(e){let{projectId:a,finopsContext:t}=e,{data:s}=l.FH.defaultLlmModel.fetchDefaultModel.useQuery({projectId:a});return{isTemplateInvalid:e=>(null==t||!t.baselineModel)&&!s}}},68136:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/project/[projectId]/evals/templates",function(){return t(23594)}])}},e=>{e.O(0,[80,7442,8470,636,6593,8792],()=>e(e.s=68136)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.