1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4785],{5157:(e,t,a)=>{a.d(t,{q:()=>c});var s=a(73154),l=a(11021),r=a(53524),n=a(82145);let i=()=>{var e;let t="".concat(null!=(e=n._.NEXT_PUBLIC_BASE_PATH)?e:"","/assets/ragas-logo.png");return(0,s.jsx)("div",{className:"flex items-center","data-sentry-component":"RagasLogoIcon","data-sentry-source-file":"ragas-logo.tsx",children:(0,s.jsx)("img",{src:t,alt:"Ragas Logo",width:12,height:12})})};var o=a(21520);function d(e){let{maintainer:t}=e;return t.includes("Ragas")?(0,s.jsx)(i,{}):t.includes("Langfuse")?(0,s.jsx)(l.h,{size:16}):(0,s.jsx)(o.A,{className:"h-4 w-4"})}function c(e){let{maintainer:t}=e;return(0,s.jsxs)(r.m_,{"data-sentry-element":"Tooltip","data-sentry-component":"MaintainerTooltip","data-sentry-source-file":"maintainer-tooltip.tsx",children:[(0,s.jsx)(r.k$,{"data-sentry-element":"TooltipTrigger","data-sentry-source-file":"maintainer-tooltip.tsx",children:(0,s.jsx)(d,{maintainer:t,"data-sentry-element":"MaintainerIcon","data-sentry-source-file":"maintainer-tooltip.tsx"})}),(0,s.jsx)(r.ZI,{"data-sentry-element":"TooltipContent","data-sentry-source-file":"maintainer-tooltip.tsx",children:t})]})}},10300:(e,t,a)=>{a.d(t,{S:()=>n});var s=a(96810),l=a(84796),r=a.n(l);function n(e){let{datasetId:t,createDefaultEvaluator:a,evaluatorsData:l,evalTemplatesData:n,refetchEvaluators:i}=e,[o,d]=(0,s.useState)(null),[c,m]=(0,s.useState)(!1),u=(0,s.useCallback)((e,s)=>{if(s){let t=null==l?void 0:l.find(t=>t.evalTemplateId===e);return t&&t.evalTemplate?{templateId:e,evaluator:{...t,evalTemplate:{...t.evalTemplate,outputSchema:t.evalTemplate.outputSchema}}}:(console.log("Config or evalTemplate not found for editing:",e),null)}let r=null==n?void 0:n.templates.find(t=>t.id===e);return r?{templateId:e,evaluator:a(r,t)}:null},[t,l,n,a]),x=(0,s.useCallback)(e=>{let t=u(e,!0);t&&(d(t),m(!0))},[u]),p=(0,s.useCallback)(()=>{m(!1)},[]),h=(0,s.useCallback)(()=>{m(!1),d(null),i()},[i]),f=(0,s.useCallback)(e=>{let t=u(e,!1);t&&(d(t),m(!0))},[u]),{activeEvaluators:j,pausedEvaluators:v,evaluatorTargetObjects:g}=(0,s.useMemo)(()=>((e,t)=>{let a=(null==e?void 0:e.filter(e=>{let{filter:a}=e;return(null==a?void 0:a.length)===0||(null==a?void 0:a.some(e=>{let{type:a,value:s}=e;return"stringOptions"===a&&s.includes(t)}))}))||[],[s,l]=r()(a,e=>"ACTIVE"===e.status),n=s.map(e=>e.evalTemplateId),i=l.map(e=>e.evalTemplateId),o={};for(let e of a)o[e.evalTemplateId]=e.targetObject;return{activeEvaluators:n,pausedEvaluators:i,evaluatorTargetObjects:o}})(l,t),[l,t]);return{selectedEvaluatorData:o,showEvaluatorForm:c,activeEvaluators:j,pausedEvaluators:v,evaluatorTargetObjects:g,handleConfigureEvaluator:x,handleCloseEvaluatorForm:p,handleEvaluatorSuccess:h,handleSelectEvaluator:f,setShowEvaluatorForm:m}}},19093:(e,t,a)=>{a.d(t,{_:()=>d});var s=a(73154);a(96810);var l=a(86843),r=a(97898),n=a(97390),i=a(45596),o=a(81509);function d(e){let{labels:t,maxVisibleLabels:a=5,className:d,badgeClassName:c,showSimpleBadges:m=!1}=e,u=[...t].sort((e,t)=>e===i.PRODUCTION_LABEL?-1:t===i.PRODUCTION_LABEL?1:e===i.LATEST_PROMPT_LABEL?-1:t===i.LATEST_PROMPT_LABEL?1:e.localeCompare(t)),x=u.slice(0,a),p=u.slice(a),h=p.length>0;return 0===u.length?null:(0,s.jsxs)("div",{className:(0,o.cn)("flex flex-wrap gap-1",d),"data-sentry-component":"TruncatedLabels","data-sentry-source-file":"TruncatedLabels.tsx",children:[x.map(e=>m?(0,s.jsx)("div",{className:(0,o.cn)("max-h-fit min-h-6 w-fit content-center rounded-sm bg-secondary px-1 text-left text-xs font-semibold text-secondary-foreground",c),children:e},e):(0,s.jsx)(n.W,{type:e,className:(0,o.cn)("break-all sm:break-normal",c),isLive:e===i.PRODUCTION_LABEL},e)),h&&(0,s.jsxs)(r.jc,{children:[(0,s.jsx)(r.d0,{asChild:!0,children:(0,s.jsxs)(l.$,{variant:"outline",size:"sm",className:"h-6 cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:["+",p.length," more"]})}),(0,s.jsx)(r.Et,{className:"w-80 p-3",side:"bottom",align:"start",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold",children:"All Labels"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:u.map(e=>m?(0,s.jsx)("div",{className:(0,o.cn)("max-h-fit min-h-6 w-fit content-center rounded-sm bg-secondary px-1 text-left text-xs font-semibold text-secondary-foreground",c),children:e},e):(0,s.jsx)(n.W,{type:e,className:(0,o.cn)("break-all sm:break-normal",c),isLive:e===i.PRODUCTION_LABEL},e))})]})})]})]})}},21201:(e,t,a)=>{a.d(t,{X:()=>i});var s=a(92065),l=a(45596);let r=new Map([["input",{langfuseObject:"trace",selectedColumnId:"input",objectName:void 0}],["query",{langfuseObject:"trace",selectedColumnId:"input",objectName:void 0}],["question",{langfuseObject:"trace",selectedColumnId:"input",objectName:void 0}],["prompt",{langfuseObject:"trace",selectedColumnId:"input",objectName:void 0}],["output",{langfuseObject:"trace",selectedColumnId:"output",objectName:void 0}],["response",{langfuseObject:"trace",selectedColumnId:"output",objectName:void 0}],["answer",{langfuseObject:"trace",selectedColumnId:"output",objectName:void 0}],["completion",{langfuseObject:"trace",selectedColumnId:"output",objectName:void 0}],["expected_output",{langfuseObject:"dataset_item",selectedColumnId:"expected_output",objectName:void 0}],["ground_truth",{langfuseObject:"dataset_item",selectedColumnId:"expected_output",objectName:void 0}],["reference",{langfuseObject:"dataset_item",selectedColumnId:"expected_output",objectName:void 0}]]),n={sampling:new s.W(1),delay:3e4,timeScope:["NEW"],status:l.JobConfigState.ACTIVE};function i(){return{createDefaultEvaluator:(e,t,a)=>{let s=e.vars&&0!==e.vars.length?e.vars.map(e=>{let t=r.get(e.toLowerCase());return t?{templateVariable:e,langfuseObject:t.langfuseObject||"dataset_item",selectedColumnId:t.selectedColumnId||"expected_output",objectName:t.objectName,jsonSelector:t.jsonSelector}:{langfuseObject:"dataset_item",templateVariable:e,selectedColumnId:"expected_output",objectName:void 0,jsonSelector:void 0}}):[];return{...n,targetObject:l.EvalTargetObject.EXPERIMENT,evalTemplate:e,scoreName:a||e.name,variableMapping:s,filter:[{type:"stringOptions",value:[t],column:"experimentDatasetId",operator:"any of"}]}}}}},33362:(e,t,a)=>{a.d(t,{G:()=>i});
1var s=a(73154),l=a(61871),r=a(75755),n=a(84750);let i=e=>{var t,a,i,o,d;let c=(0,r.o)(e.projectId),m=null!=(i=null==(t=e.existingEvaluator)?void 0:t.evalTemplate)?i:e.evalTemplates.find(t=>t.id===e.templateId);return m?(0,s.jsx)(s.Fragment,{children:c.isLoading?(0,s.jsx)(n.E,{className:"h-[30dvh] w-full"}):(0,s.jsx)(l.W,{projectId:e.projectId,disabled:e.disabled,existingEvaluator:e.existingEvaluator,evalTemplate:null!=(o=null==(a=e.existingEvaluator)?void 0:a.evalTemplate)?o:m,onFormSuccess:e.onFormSuccess,shouldWrapVariables:e.shouldWrapVariables,hideTargetSection:e.hideTargetSection,hideTargetSelection:e.hideTargetSelection,mode:e.mode,preventRedirect:null==(d=e.preventRedirect)||d,preprocessFormValues:e.preprocessFormValues,useDialog:e.useDialog,evalCapabilities:c,defaultRunOnLive:e.defaultRunOnLive,hidePreviewTable:e.hidePreviewTable})}):null}},44785:(e,t,a)=>{a.d(t,{x:()=>eh});var s=a(73154),l=a(96810),r=a(86843),n=a(60555),i=a(24274),o=a(31450),d=a(81286),c=a(93367),m=a(25277),u=a(18799),x=a(14183),p=a(68389),h=a.n(p),f=a(92125),j=a(10873),v=a(60520),g=a(92273),y=a(95840),N=a(59757),b=a(33100),w=a(17020),S=a(20192),C=a(21201),I=a(10300),E=a(97908),T=a(45596),R=a(26946),F=a(8163),k=a(84750),D=a(41454);let A=D.Ay$.object({name:D.Ay$.string().min(1,"Please enter an experiment name").transform(e=>e.trim()),runName:D.Ay$.string().min(1,"Run name is required"),promptId:D.Ay$.string().min(1,"Please select a prompt"),datasetId:D.Ay$.string().min(1,"Please select a dataset"),datasetVersion:D.Ay$.coerce.date().optional(),description:D.Ay$.string().max(1e3).optional(),modelConfig:D.Ay$.object({provider:D.Ay$.string().min(1,"Please select a provider"),model:D.Ay$.string().min(1,"Please select a model"),modelParams:T.ZodModelConfig}),structuredOutputSchema:D.Ay$.record(D.Ay$.string(),D.Ay$.unknown()).optional()});var M=a(4198),P=a(11341),L=a(97638),V=a(21),O=a(29276),B=a(65295),_=a(95296),$=a(1597),H=a(81509);let U=e=>{let{title:t,description:a}=e;return(0,s.jsxs)("div",{className:"space-y-2","data-sentry-component":"StepHeader","data-sentry-source-file":"StepHeader.tsx",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:t}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]})};var Z=a(19093);let J=e=>{let{projectId:t,formState:a,promptModelState:n,modelState:i,structuredOutputState:o}=e,{form:d}=a,{promptsByName:u,selectedPromptName:x,setSelectedPromptName:p,selectedPromptVersion:h,setSelectedPromptVersion:f}=n,{modelParams:v,updateModelParamValue:y,setModelParamEnabled:N,availableModels:b,providerModelCombinations:w,availableProviders:S}=i,{structuredOutputEnabled:C,setStructuredOutputEnabled:I,setSelectedSchemaName:E}=o,[T,R]=(0,l.useState)(!1),[F,k]=(0,l.useState)(null),[D,A]=(0,l.useState)(!1),J=c.FH.llmSchemas.getAll.useQuery({projectId:t},{enabled:!!t,staleTime:3e5}),z=e=>{if(I(e),e){if(J.data&&J.data.length>0&&!F){let e=J.data[0];k(e),E(e.name),d.setValue("structuredOutputSchema",e.schema)}}else E(null),d.setValue("structuredOutputSchema",void 0)};return(0,s.jsxs)("div",{className:"space-y-6","data-sentry-component":"PromptModelStep","data-sentry-source-file":"PromptModelStep.tsx",children:[(0,s.jsx)(U,{title:"Prompt & Model Configuration",description:"Select the prompt version and configure the model parameters for your experiment.","data-sentry-element":"StepHeader","data-sentry-source-file":"PromptModelStep.tsx"}),(0,s.jsx)(j.zB,{control:d.control,name:"promptId",render:()=>(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Prompt"}),(0,s.jsxs)("div",{className:"mb-2 flex gap-2",children:[(0,s.jsxs)(L.AM,{open:T,onOpenChange:R,children:[(0,s.jsx)(L.Wv,{asChild:!0,children:(0,s.jsxs)(r.$,{variant:"outline",role:"combobox","aria-expanded":T,className:"w-2/3 justify-between px-2 font-normal",children:[x||"Select a prompt",(0,s.jsx)(V.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(L.hl,{className:"w-[--radix-popover-trigger-width] overflow-auto p-0",align:"start",children:(0,s.jsxs)(P.wJ,{children:[(0,s.jsx)(P.g1,{placeholder:"Search prompts...",className:"h-9",variant:"bottom"}),(0,s.jsxs)(P.S2,{children:[(0,s.jsx)(P.TD,{children:"No prompt found."}),(0,s.jsx)(P.Jf,{children:u&&Object.entries(u).map(e=>
1{let[t,a]=e;return(0,s.jsxs)(P.tZ,{onSelect:()=>{p(t);let e=a[0];f(e.version),d.setValue("promptId",e.id),d.clearErrors("promptId")},children:[t,(0,s.jsx)(g.A,{className:(0,H.cn)("ml-auto h-4 w-4",t===x?"opacity-100":"opacity-0")})]},t)})})]})]})})]}),(0,s.jsxs)(L.AM,{children:[(0,s.jsx)(L.Wv,{asChild:!0,children:(0,s.jsxs)(r.$,{disabled:!x,variant:"outline",role:"combobox",className:"w-1/3 justify-between px-2 font-normal",children:[h?"Version ".concat(h):"Version",(0,s.jsx)(V.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(L.hl,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,s.jsxs)(P.wJ,{children:[(0,s.jsx)(P.g1,{placeholder:"Search versions...",className:"h-9"}),(0,s.jsxs)(P.S2,{children:[(0,s.jsx)(P.TD,{children:"No version found."}),(0,s.jsx)(P.Jf,{className:"overflow-y-auto",children:u&&x&&u[x]?u[x].map(e=>(0,s.jsxs)(P.tZ,{onSelect:()=>{f(e.version),d.setValue("promptId",e.id),d.clearErrors("promptId")},children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,s.jsxs)("span",{className:"shrink-0",children:["Version ",e.version]}),e.labels.length>0&&(0,s.jsx)(Z._,{labels:e.labels,maxVisibleLabels:2,className:"min-w-0"})]}),(0,s.jsx)(g.A,{className:(0,H.cn)("ml-auto h-4 w-4 shrink-0",e.version===h?"opacity-100":"opacity-0")})]},e.id)):(0,s.jsx)(P.tZ,{disabled:!0,children:"No versions available"})})]})]})})]})]}),(0,s.jsx)(j.C5,{})]}),"data-sentry-element":"FormField","data-sentry-source-file":"PromptModelStep.tsx"}),(0,s.jsx)(j.zB,{control:d.control,name:"modelConfig",render:()=>{var e,t,a,l;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Model"}),(0,s.jsx)(M.s,{modelParams:v,availableModels:b,providerModelCombinations:w,availableProviders:S,updateModelParamValue:y,setModelParamEnabled:N,isEmbedded:!0}),d.formState.errors.modelConfig&&(0,s.jsx)("p",{id:"modelConfig",className:(0,H.cn)("text-sm font-medium text-destructive"),children:[null==(t=d.formState.errors.modelConfig)||null==(e=t.model)?void 0:e.message,null==(l=d.formState.errors.modelConfig)||null==(a=l.provider)?void 0:a.message].join(", ")})]})},"data-sentry-element":"FormField","data-sentry-source-file":"PromptModelStep.tsx"}),(0,s.jsx)(j.zB,{control:d.control,name:"structuredOutputSchema",render:e=>{let{field:a}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(j.lR,{children:"Structured output (optional)"}),(0,s.jsx)($.d,{checked:C,onCheckedChange:z})]}),C&&(0,s.jsx)(s.Fragment,{children:J.data&&J.data.length>0?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(L.AM,{open:D,onOpenChange:A,children:[(0,s.jsx)(L.Wv,{asChild:!0,children:(0,s.jsxs)(r.$,{variant:"outline",role:"combobox","aria-expanded":D,className:"flex-1 justify-between px-2 font-normal",children:[(null==F?void 0:F.name)||"Select schema",(0,s.jsx)(V.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(L.hl,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,s.jsxs)(P.wJ,{children:[(0,s.jsx)(P.g1,{placeholder:"Search schemas...",className:"h-9",variant:"bottom"}),(0,s.jsxs)(P.S2,{children:[(0,s.jsx)(P.TD,{children:"No schema found."}),(0,s.jsx)(P.Jf,{children:J.data.map(e=>(0,s.jsxs)(P.tZ,{onSelect:()=>{k(e),E(e.name),a.onChange(e.schema),A(!1)},children:[e.name,(0,s.jsx)(g.A,{className:(0,H.cn)("ml-auto h-4 w-4",(null==F?void 0:F.id)===e.id?"opacity-100":"opacity-0")})]},e.id))})]})]})})]}),F&&(0,s.jsx)(_._,{projectId:t,existingLlmSchema:F,onSave:e=>{k(e),E(e.name),a.onChange(e.schema)},onDelete:()=>{k(null),E(null),a.onChange(void 0)},children:(0,s.jsx)(r.$,{variant:"ghost",size:"icon",children:(0,s.jsx)(O.A,{className:"h-4 w-4"})})})]}):(0,s.jsx)(_._,{projectId:t,onSave:e=>{k(e),E(e.name),a.onChange(e.schema)},children:(0,s.jsxs)(r.$,{variant:"outline",className:"w-full",children:[(0,s.jsx)(B.A,{className:"mr-2 h-4 w-4"}),"Add schema"]})})}),(0,s.jsx)(m.BT,{children:C?"Configure the schema for structured LLM outputs":"Enable to enforce a specific output format"}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"PromptModelStep.tsx"})]})};var z=a(93323),W=a(80263),Q=a(64710),q=a(68780);let G=e=>{var t;let{projectId:a,formState:n,datasetState:i,promptInfo:o}=e,{form:d}=n,{datasets:u,selectedDatasetId:x,expectedColumnsForDataset:p,validationResult:h}=i,{selectedPromptName:f,selectedPromptVersion:v}=o,[y,N]=(0,l.useState)(!1),{data:b}=c.FH.datasets.listDatasetVersions.useQuery({projectId:a,datasetId:x||""},{enabled:!!x});return(0,s.jsxs)("div",{className:"space-y-6","data-sentry-component":"DatasetStep","data-sentry-source-file":"DatasetStep.tsx",children:[(0,s.jsx)(U,{title:"Dataset Selection",description:"Choose the dataset to run your experiment on. The dataset structure must match the prompt template variables.","data-sentry-element":"StepHeader","data-sentry-source-file":"DatasetStep.tsx"}),(0,s.jsx)(j.zB,{control:d.control,name:"datasetId",render:e=>{var t;let{field:a}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Dataset"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(L.AM,{open:y,onOpenChange:N,children:[(0,s.jsx)(L.Wv,{asChild:!0,children:(0,s.jsxs)(r.$,{variant:"outline",role:"combobox","aria-expanded":y,className:"flex-1 justify-between px-2 font-normal",children:[a.value?null==u||null==(t=u.find(e=>e.id===a.value))?void 0:t.name:"Select a dataset",(0,s.jsx)(V.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(L.hl,{className:"w-[--radix-popover-trigger-width] overflow-auto p-0",align:"start",children:(0,s.jsxs)(P.wJ,{children:[(0,s.jsx)(P.g1,{placeholder:"Search datasets...",className:"h-9",variant:"bottom"}),(0,s.jsxs)(P.S2,{children:[(0,s.jsx)(P.TD,{children:"No dataset found."}),(0,s.jsx)(P.Jf,{children:(null!=u?u:[]).map(e=>(0,s.jsxs)(P.tZ,{onSelect:()=>{a.onChange(e.id),d.clearErrors("datasetId"),N(!1)},children:[e.name,(0,s.jsx)(g.A,{className:(0,H.cn)("ml-auto h-4 w-4",e.id===a.value?"opacity-100":"opacity-0")})]},e.id))})]})]})})]}),f&&null!==v&&(0,s.jsxs)(L.AM,{children:[(0,s.jsx)(L.Wv,{asChild:!0,children:(0,s.jsx)(r.$,{variant:"outline",className:"h-8",children:"Expected columns"})}),(0,s.jsx)(L.hl,{className:"w-80",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h4",{className:"font-medium leading-none",children:"Expected Dataset Structure"}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Based on prompt ",f," v",v]}),(0,s.jsxs)("div",{className:"space-y-1 pt-2",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Input variables:"}),(0,s.jsx)("ul",{className:"list-inside list-disc text-sm",children:p.inputVariables.map(e=>(0,s.jsx)("li",{children:e},e))}),(0,s.jsx)("p",{className:"text-sm font-medium",children:"Expected output:"}),(0,s.jsx)("ul",{className:"list-inside list-disc text-sm",children:(0,s.jsxs)("li",{children:[p.outputVariableName,"
1(",p.outputVariableType,")"]})})]})]})})]})]}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"DatasetStep.tsx"}),x&&b&&b.length>0&&(0,s.jsx)(j.zB,{control:d.control,name:"datasetVersion",render:e=>{let{field:t}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Dataset Version (Optional)"}),(0,s.jsxs)(z.l6,{onValueChange:e=>{"latest"===e?t.onChange(void 0):t.onChange(new Date(e))},value:t.value?t.value.toISOString():"latest",children:[(0,s.jsx)(j.MJ,{children:(0,s.jsx)(z.bq,{children:(0,s.jsx)(z.yv,{placeholder:"Latest version"})})}),(0,s.jsxs)(z.gC,{children:[(0,s.jsx)(z.eb,{value:"latest",children:"Latest version (default)"}),b.map(e=>(0,s.jsxs)(z.eb,{value:e.toISOString(),children:[(0,q.GP)(e,"MMM d, yyyy 'at' h:mm a")," (UTC)"]},e.toISOString()))]})]}),(0,s.jsx)(j.Rr,{children:"Run the experiment using the dataset state at a specific point in time. Defaults to the latest version."}),(0,s.jsx)(j.C5,{})]})}}),x&&(0,s.jsxs)(s.Fragment,{children:[(null==h?void 0:h.isValid)===!1&&(0,s.jsx)(m.Zp,{className:"relative overflow-hidden rounded-md border-dark-yellow bg-light-yellow shadow-none group-data-[collapsible=icon]:hidden",children:(0,s.jsxs)(m.aR,{className:"p-2",children:[(0,s.jsxs)(m.ZB,{className:"flex items-center justify-between text-sm text-dark-yellow",children:[(0,s.jsx)("span",{children:"Invalid configuration"}),(0,s.jsx)(W.A,{className:"h-4 w-4"})]}),(0,s.jsx)(m.BT,{className:"text-foreground",children:null==h?void 0:h.message})]})}),(null==h?void 0:h.isValid)===!0&&(0,s.jsx)(m.Zp,{className:"relative overflow-hidden rounded-md border-dark-green bg-light-green shadow-none group-data-[collapsible=icon]:hidden",children:(0,s.jsxs)(m.aR,{className:"p-2",children:[(0,s.jsxs)(m.ZB,{className:"flex items-center justify-between text-sm text-dark-green",children:[(0,s.jsx)("span",{children:"Valid configuration"}),(0,s.jsx)(Q.A,{className:"h-4 w-4"})]}),(0,s.jsxs)("div",{className:"text-sm",children:["Matches between dataset items and prompt variables/placeholders",(0,s.jsx)("ul",{className:"my-2 ml-2 list-inside list-disc",children:Object.entries(null!=(t=h.variablesMap)?t:{}).map(e=>{let[t,a]=e;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("strong",{children:[t,":"]})," ",a," /"," ",(null==h?void 0:h.isValid)?h.totalItems:"unknown"]},t)})}),"Items missing all required variables and placeholders will be excluded from the dataset run."]})]})})]})]})};var Y=a(99432),X=a(33362);let K=e=>{let{projectId:t,datasetId:a,evaluatorState:l,permissions:r}=e,{evalTemplates:n,activeEvaluators:i,pausedEvaluators:o,evaluatorTargetObjects:d,selectedEvaluatorData:c,showEvaluatorForm:m,handleConfigureEvaluator:u,handleSelectEvaluator:p,handleCloseEvaluatorForm:h,handleEvaluatorSuccess:f,handleEvaluatorToggled:v,preprocessFormValues:g}=l,{hasEvalReadAccess:y,hasEvalWriteAccess:N}=r;return(0,s.jsxs)("div",{className:"space-y-6","data-sentry-component":"EvaluatorsStep","data-sentry-source-file":"EvaluatorsStep.tsx",children:[(0,s.jsx)(U,{title:"Evaluators (Optional)",description:"Configure evaluators to automatically score experiment results. You can add multiple evaluators to assess different aspects of your LLM outputs.","data-sentry-element":"StepHeader","data-sentry-source-file":"EvaluatorsStep.tsx"}),(0,s.jsxs)(j.eI,{"data-sentry-element":"FormItem","data-sentry-source-file":"EvaluatorsStep.tsx",children:[(0,s.jsx)(j.lR,{"data-sentry-element":"FormLabel","data-sentry-source-file":"EvaluatorsStep.tsx",children:"Select Evaluators"}),y&&a?(0,s.jsx)(Y.U,{projectId:t,datasetId:a,evalTemplates:n,onConfigureTemplate:u,onSelectEvaluator:p,onEvaluatorToggled:v,activeTemplateIds:i,inactiveTemplateIds:o,evaluatorTargetObjects:d,disabled:!N}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:y?"Please select a dataset first to configure evaluators":"You don't have permission to manage evaluators"}),(0,s.jsx)(j.C5,{"data-sentry-element":"FormMessage","data-sentry-source-file":"EvaluatorsStep.tsx"})]}),c&&(0,s.jsx)(x.lG,{open:m,onOpenChange:e=>{e||h()},children:(0,s.jsxs)(x.Cf,{className:"max-h-[90vh] max-w-screen-md overflow-y-auto",children:[(0,s.jsx)(x.c7,{children:(0,s.jsxs)(x.L3,{children:[c.evaluator.id?"Edit":"Configure"," ","Evaluator"]})}),(0,s.jsx)(X.G,{useDialog:!0,projectId:t,evalTemplates:n,templateId:c.templateId,existingEvaluator:c.evaluator,mode:c.evaluator.id?"edit":"create",hideTargetSection:!c.evaluator.id,onFormSuccess:f,preprocessFormValues:g})]})})]})};var ee=a(90270),et=a(61653);let ea=e=>{let{formState:t}=e,{form:a}=t;return(0,s.jsxs)("div",{className:"space-y-6","data-sentry-component":"ExperimentDetailsStep","data-sentry-source-file":"ExperimentDetailsStep.tsx",children:[(0,s.jsx)(U,{title:"Experiment Run Details",description:"Provide a name and optional description for your experiment to help identify and track it.","data-sentry-element":"StepHeader","data-sentry-source-file":"ExperimentDetailsStep.tsx"}),(0,s.jsx)(j.zB,{control:a.control,name:"name",render:e=>{let{field:t}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Experiment name"}),(0,s.jsx)(j.MJ,{children:(0,s.jsx)(ee.p,{...t,placeholder:"Enter experiment name",className:"w-full"})}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"ExperimentDetailsStep.tsx"}),(0,s.jsx)(j.zB,{control:a.control,name:"description",render:e=>{let{field:t}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Description (optional)"}),(0,s.jsx)(j.MJ,{children:(0,s.jsx)(et.T,{...t,placeholder:"Describe the purpose or context of this experiment",className:"min-h-[100px] w-full"})}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"ExperimentDetailsStep.tsx"})]})};var es=a(67716),el=a(53524);let er=e=>{let{formState:t,navigationState:a,summary:l}=e,{form:r}
1=t,{setActiveStep:n}=a,{selectedPromptName:i,selectedPromptVersion:o,selectedDataset:d,modelParams:c,activeEvaluatorNames:u,structuredOutputEnabled:x,selectedSchemaName:p,validationResult:h}=l,f=r.getValues();return(0,s.jsxs)("div",{className:"space-y-6","data-sentry-component":"ReviewStep","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(U,{title:"Review & Run",description:"Review your experiment configuration before running it. You can go back to any step to make changes.","data-sentry-element":"StepHeader","data-sentry-source-file":"ReviewStep.tsx"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,s.jsxs)(m.Zp,{className:"cursor-pointer transition-colors hover:bg-accent",onClick:()=>n("prompt"),"data-sentry-element":"Card","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(m.aR,{className:"pb-3","data-sentry-element":"CardHeader","data-sentry-source-file":"ReviewStep.tsx",children:(0,s.jsx)(m.ZB,{className:"text-base","data-sentry-element":"CardTitle","data-sentry-source-file":"ReviewStep.tsx",children:"Prompt"})}),(0,s.jsxs)(m.Wu,{className:"space-y-2 text-sm","data-sentry-element":"CardContent","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Name:"}),(0,s.jsx)("span",{className:"font-medium",children:i})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Version:"}),(0,s.jsxs)("span",{className:"font-medium",children:["v",o]})]})]})]}),(0,s.jsxs)(m.Zp,{className:"cursor-pointer transition-colors hover:bg-accent",onClick:()=>n("prompt"),"data-sentry-element":"Card","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(m.aR,{className:"pb-3","data-sentry-element":"CardHeader","data-sentry-source-file":"ReviewStep.tsx",children:(0,s.jsx)(m.ZB,{className:"text-base","data-sentry-element":"CardTitle","data-sentry-source-file":"ReviewStep.tsx",children:"Model"})}),(0,s.jsxs)(m.Wu,{className:"space-y-2 text-sm","data-sentry-element":"CardContent","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Provider:"}),(0,s.jsx)("span",{children:c.provider.value})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Model:"}),(0,s.jsx)("span",{children:c.model.value})]}),c.temperature.enabled&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Temperature:"}),(0,s.jsx)("span",{children:c.temperature.value})]}),c.max_tokens.enabled&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Max Tokens:"}),(0,s.jsx)("span",{children:c.max_tokens.value})]}),x&&p&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Structured Output:"}),(0,s.jsx)("span",{children:p})]})]})]}),(0,s.jsxs)(m.Zp,{className:"cursor-pointer transition-colors hover:bg-accent",onClick:()=>n("dataset"),"data-sentry-element":"Card","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(m.aR,{className:"pb-3","data-sentry-element":"CardHeader","data-sentry-source-file":"ReviewStep.tsx",children:(0,s.jsx)(m.ZB,{className:"text-base","data-sentry-element":"CardTitle","data-sentry-source-file":"ReviewStep.tsx",children:"Dataset"})}),(0,s.jsxs)(m.Wu,{className:"space-y-2 text-sm","data-sentry-element":"CardContent","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Name:"}),(0,s.jsx)("span",{className:"font-medium",children:null==d?void 0:d.name})]}),(null==h?void 0:h.isValid)&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Items:"}),(0,s.jsx)("span",{children:h.totalItems})]})]})]}),u.length>0&&(0,s.jsxs)(m.Zp,{className:"cursor-pointer transition-colors hover:bg-accent",onClick:()=>n("evaluators"),children:[(0,s.jsx)(m.aR,{className:"pb-3",children:(0,s.jsxs)(m.ZB,{className:"text-base",children:["Evaluators (",u.length,")"]})}),(0,s.jsx)(m.Wu,{children:(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:u.map(e=>(0,s.jsx)(es.E,{variant:"secondary",className:"text-xs",children:e},e))})})]}),(0,s.jsxs)(m.Zp,{className:"cursor-pointer transition-colors hover:bg-accent md:col-span-2",onClick:()=>n("details"),"data-sentry-element":"Card","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(m.aR,{className:"pb-3","data-sentry-element":"CardHeader","data-sentry-source-file":"ReviewStep.tsx",children:(0,s.jsx)(m.ZB,{className:"text-base","data-sentry-element":"CardTitle","data-sentry-source-file":"ReviewStep.tsx",children:"Experiment Run Details"})}),(0,s.jsxs)(m.Wu,{className:"space-y-2 text-sm","data-sentry-element":"CardContent","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Experiment Name:"}),(0,s.jsx)("span",{className:"font-medium",children:f.name})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Run Name:"}),(0,s.jsx)("span",{className:"font-medium",children:f.runName}),(0,s.jsxs)(el.m_,{"data-sentry-element":"Tooltip","data-sentry-source-file":"ReviewStep.tsx",children:[(0,s.jsx)(el.k$,{asChild:!0,"data-sentry-element":"TooltipTrigger","data-sentry-source-file":"ReviewStep.tsx",children:(0,s.jsx)(W.A,{className:"h-3.5 w-3.5 text-muted-foreground","data-sentry-element":"InfoIcon","data-sentry-source-file":"ReviewStep.tsx"})}),(0,s.jsx)(el.ZI,{className:"max-w-[300px]","data-sentry-element":"TooltipContent","data-sentry-source-file":"ReviewStep.tsx",children:"This run name is auto-generated from the experiment name and can be used to fetch the resulting experiment run via the public API."})]})]}),f.description&&(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Description:"}),(0,s.jsx)("span",{className:"text-sm",children:f.description})]})]})]})]})]})},en=e=>{var t,a,n,i,o,d,m,p;let{projectId:D,setFormOpen:M,defaultValues:P={},promptDefault:L,handleExperimentSettled:V,handleExperimentSuccess:O}=e,B=(0,f.B)(),[_,$]=(0,l.useState)("prompt"),[H,U]=(0,l.useState)(null!=(o=null==L?void 0:L.name)?o:""),[Z,z]=(0,l.useState)(null!=(d=null==L?void 0:L.version)?d:null),[W,Q]=(0,l.useState)(!1),[q,Y]=(0,l.useState)(null),X=[{id:"prompt",label:"Prompt & Model"},{id:"dataset",label:"Dataset"},{id:"evaluators",label:"Evaluators"},{id:"details",label:"Experiment run details"},{id:"review",label:"Review"}],ee=(0,u.lp)({projectId:D,scope:"evalJob:read"}),et=(0,u.lp)({projectId:D,scope:"evalJob:CUD"}),es=(0,w.mN)({resolver:(0,b.u)(A),defaultValues:{promptId:"",datasetId:"",datasetVersion:void 0,modelConfig:{},name:"",runName:"",description:"",...P}}),el=es.watch("datasetId"),en=es.watch("datasetVersion");(0,l.useEffect)(()=>{es.setValue("datasetVersion",void 0)},[el,es]);
1let ei=c.FH.evals.jobConfigsByTarget.useQuery({projectId:D,targetObject:["dataset","experiment"]},{enabled:ee&&!!el}),eo=c.FH.evals.allTemplates.useQuery({projectId:D},{enabled:ee}),{createDefaultEvaluator:ed}=(0,C.X)(),{activeEvaluators:ec,pausedEvaluators:em,evaluatorTargetObjects:eu,selectedEvaluatorData:ex,showEvaluatorForm:ep,handleConfigureEvaluator:eh,handleCloseEvaluatorForm:ef,handleEvaluatorSuccess:ej,handleSelectEvaluator:ev}=(0,I.S)({datasetId:el,createDefaultEvaluator:ed,evaluatorsData:ei.data,evalTemplatesData:eo.data,refetchEvaluators:ei.refetch}),{modelParams:eg,updateModelParamValue:ey,setModelParamEnabled:eN,availableModels:eb,providerModelCombinations:ew,availableProviders:eS}=(0,S.n)();!function(e){let{projectId:t,datasetId:a,form:s}=e,r=c.FH.datasets.baseRunDataByDatasetId.useQuery({projectId:t,datasetId:a},{enabled:!!a}),n=(0,l.useMemo)(()=>{var e,t;return null!=(t=null==(e=r.data)?void 0:e.map(e=>({value:e.name})))?t:[]},[r.data]);(0,E.t)({currentName:s.watch("name"),allNames:n,form:s,errorMessage:"Experiment name already exists for this dataset."})}({projectId:D,datasetId:el,form:es}),(0,l.useEffect)(()=>{es.setValue("modelConfig",{provider:eg.provider.value,model:eg.model.value,modelParams:(0,R._)(eg)}),eg.provider.value&&eg.model.value&&es.clearErrors("modelConfig")},[eg,es]);let{promptId:eC,promptsByName:eI,expectedColumns:eE}=function(e){let{projectId:t,form:a}=e,s=a.watch("promptId"),r=c.FH.prompts.allPromptMeta.useQuery({projectId:t});return{expectedColumns:(0,l.useMemo)(()=>{var e,t,a;let l=null==(e=r.data)?void 0:e.find(e=>e.id===s);if(!l)return[];let n=(0,T.extractVariables)(l.type===T.PromptType.Text?null!=(a=null==l||null==(t=l.prompt)?void 0:t.toString())?a:"":JSON.stringify(null==l?void 0:l.prompt)),i=(null==l?void 0:l.type)===T.PromptType.Chat&&Array.isArray(l.prompt)?l.prompt:[];return[...n,...(0,T.extractPlaceholderNames)(i)]},[s,r.data]),promptsByName:(0,l.useMemo)(()=>{var e;return null==(e=r.data)?void 0:e.reduce((e,t)=>(e[t.name]||(e[t.name]=[]),e[t.name].push({version:t.version,id:t.id,labels:t.labels}),e),{})},[r.data]),promptId:s}}({projectId:D,form:es}),eT=c.FH.experiments.createExperiment.useMutation({onSuccess:null!=O?O:()=>{},onError:e=>{(0,F.N)(e.message||"Failed to trigger dataset run","Please try again.")},onSettled:null!=V?V:()=>{}}),eR=c.FH.experiments.validateConfig.useQuery({projectId:D,promptId:eC,datasetId:el,datasetVersion:en},{enabled:!!(eC&&el)}),eF=c.FH.datasets.allDatasetMeta.useQuery({projectId:D},{trpc:{context:{skipBatch:!0}},refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,staleTime:1/0,enabled:!0}),ek=async e=>{B("dataset_run:new_form_submit");let t={...e,projectId:D};await eT.mutateAsync(t),es.reset(),M(!1)};(0,l.useEffect)(()=>{var e,t,a;if(!H||null===Z||!el)return;let s=null==(e=eF.data)?void 0:e.find(e=>e.id===el);if(!s)return;let l=(t=s.name,"Prompt ".concat(H,"-v").concat(Z," on dataset ").concat(t));es.setValue("name",l);let r=(a=s.name,"Experiment run of prompt ".concat(H,"-v").concat(Z," on dataset ").concat(a));es.setValue("description",r)},[H,Z,el,eF.data,es]);let eD=es.watch("name");(0,l.useEffect)(()=>{if(eD&&""!==eD.trim()){let e="".concat(eD," - ").concat(new Date().toISOString());es.setValue("runName",e)}else es.setValue("runName","")},[eD,es]);let eA=null!=(m=null==(t=eo.data)?void 0:t.templates.filter(e=>ec.includes(e.id)).map(e=>e.name))?m:[],eM=null==(a=eF.data)?void 0:a.find(e=>e.id===el),eP=e=>{switch(e){case"prompt":return!!(es.getValues("promptId")&&eg.provider.value&&eg.model.value&&!es.formState.errors.promptId&&!es.formState.errors.modelConfig);case"dataset":var t;return!!(es.getValues("datasetId")&&(null==(t=eR.data)?void 0:t.isValid)&&!es.formState.errors.datasetId);case"evaluators":return!0;case"details":return!!(es.getValues("name")&&!es.formState.errors.name);case"review":return eP("prompt")&&eP("dataset")&&eP("details");default:return!1}};if(!eI||!eF.data||ee&&el&&!ei.data)return(0,s.jsx)(k.E,{className:"min-h-[70dvh] w-full"});let eL={form:es},eV={datasets:eF.data,selectedDatasetId:el,selectedDataset:eM,selectedDatasetVersion:en,val
1idationResult:eR.data,expectedColumnsForDataset:{inputVariables:eE||[],outputVariableType:T.PromptType.Text,outputVariableName:"expected_output"}},eO={activeEvaluators:ec,pausedEvaluators:em,evaluatorTargetObjects:eu,evalTemplates:null!=(p=null==(n=eo.data)?void 0:n.templates)?p:[],activeEvaluatorNames:eA,selectedEvaluatorData:ex,showEvaluatorForm:ep,handleConfigureEvaluator:eh,handleCloseEvaluatorForm:ef,handleEvaluatorSuccess:ej,handleSelectEvaluator:ev,handleEvaluatorToggled:()=>void ei.refetch(),preprocessFormValues:e=>e},eB={selectedPromptName:H,selectedPromptVersion:Z,selectedDataset:eM,modelParams:eg,activeEvaluatorNames:eA,structuredOutputEnabled:W,selectedSchemaName:q,validationResult:eR.data};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:[(0,s.jsx)(x.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:"Run Experiment"}),(0,s.jsxs)(x.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:["Run an experiment to evaluate prompts and model configurations against a dataset. See"," ",(0,s.jsx)(h(),{href:"https://langfuse.com/docs/evaluation/dataset-runs/native-run",target:"_blank",className:"underline","data-sentry-element":"Link","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:"documentation"})," ","to learn more."]})]}),(0,s.jsx)(j.lV,{...es,"data-sentry-element":"Form","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:(0,s.jsxs)("form",{className:"space-y-6",onSubmit:es.handleSubmit(ek),children:[(0,s.jsxs)(x.R4,{"data-sentry-element":"DialogBody","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:[(0,s.jsx)(v.Qp,{className:"mb-6 w-full","data-sentry-element":"Breadcrumb","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:(0,s.jsx)(v.AB,{className:"flex w-full justify-between sm:justify-start","data-sentry-element":"BreadcrumbList","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:X.map((e,t)=>(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)(v.J5,{children:e.id===_?(0,s.jsxs)(v.tJ,{className:"flex items-center",children:[eP(e.id)&&(0,s.jsx)(g.A,{className:"mr-1.5 h-3.5 w-3.5 text-green-600"}),e.label]}):(0,s.jsxs)(v.w1,{onClick:()=>$(e.id),className:"flex cursor-pointer items-center",children:[eP(e.id)&&(0,s.jsx)(g.A,{className:"mr-1.5 h-3.5 w-3.5 text-green-600"}),e.label]})}),t<X.length-1&&(0,s.jsx)(v.tH,{})]},e.id))})}),(0,s.jsxs)("div",{className:"min-h-[500px] overflow-y-auto px-0.5",children:["prompt"===_&&(0,s.jsx)(J,{projectId:D,formState:eL,promptModelState:{selectedPromptName:H,setSelectedPromptName:U,selectedPromptVersion:Z,setSelectedPromptVersion:z,promptsByName:eI},modelState:{modelParams:eg,updateModelParamValue:ey,setModelParamEnabled:eN,availableModels:eb,providerModelCombinations:ew,availableProviders:eS},structuredOutputState:{structuredOutputEnabled:W,setStructuredOutputEnabled:Q,selectedSchemaName:q,setSelectedSchemaName:Y}}),"dataset"===_&&(0,s.jsx)(G,{projectId:D,formState:eL,datasetState:eV,promptInfo:{selectedPromptName:H,selectedPromptVersion:Z}}),"evaluators"===_&&(0,s.jsx)(K,{projectId:D,datasetId:el,evaluatorState:eO,permissions:{hasEvalReadAccess:ee,hasEvalWriteAccess:et}}),"details"===_&&(0,s.jsx)(ea,{formState:eL}),"review"===_&&(0,s.jsx)(er,{formState:eL,navigationState:{setActiveStep:$},summary:eB})]})]}),(0,s.jsx)(x.Es,{"data-sentry-element":"DialogFooter","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsxs)(r.$,{type:"button",variant:"outline",onClick:e=>{e.preventDefault();let t=X.map(e=>e.id),a=t.indexOf(_);a>0&&$(t[a-1])},disabled:"prompt"===_,"data-sentry-element":"Button","data-sentry-source-file":"MultiStepExperimentForm.tsx",children:[(0,s.jsx)(y.A,{className:"mr-2 h-4 w-4","data-sentry-element":"ChevronLeft","data-sentry-source-file":"MultiStepExperimentForm.tsx"}),"Previous"]}),(0,s.jsx)("div",{className:"flex gap-2",children:"review"!==_?(0,s.jsxs)(r.$,{type:"button",onClick:e=>{e.preventDefault();let t=X.map(e=>e.id),a=t.indexOf(_);a<X.length-1&&$(t[a+1])},children:["Next",(0,s.jsx)(N.A,{className:"ml-2 h-4 w-4"})]}):(0,s.jsx)(r.$,{type:"submit",disabled:!!(eC&&el)&&!(null==(i=eR.data)?void 0:i.isValid)||!!es.formState.errors.name,loading:es.formState.isSubmitting,children:"Run Experiment"})})]})})]})})]})};var ei=a(62583),eo=a(62065),ed=a(51883);let ec=e=>{if(!e)return"{}";if("string"==typeof e)try{let t=JSON.parse(e);return"string"==typeof t?t:JSON.stringify(t,null,2)}catch(t){return e}return JSON.stringify(e,null,2)},em=D.z.object({url:D.z.url(),defaultPayload:D.z.string()}),eu=e=>{var t;let{projectId:a,datasetId:l,existingRemoteExperiment:n,setShowRemoteExperimentUpsertForm:i}=e,o=(0,u.lp)({projectId:a,scope:"datasets:CUD"}),d=c.FH.datasets.byId.useQuery({projectId:a,datasetId:l}),m=c.FH.useUtils(),p=(0,w.mN)({resolver:(0,b.u)(em),defaultValues:{url:(null==n?void 0:n.url)||"",defaultPayload:ec(null==n?void 0:n.payload)}}),h=c.FH.datasets.upsertRemoteExperiment.useMutation({onSuccess:()=>{(0,ei.G)({title:"Setup successfully",description:"Your changes have been saved."}
1),i(!1),m.datasets.getRemoteExperiment.invalidate({projectId:a,datasetId:l})},onError:e=>{(0,F.N)(e.message||"Failed to setup","Please check your URL and config and try again.")}}),f=c.FH.datasets.deleteRemoteExperiment.useMutation({onSuccess:()=>{(0,ei.G)({title:"Deleted successfully",description:"The remote dataset run trigger has been removed from this dataset."}),i(!1)},onError:e=>{(0,F.N)(e.message||"Failed to delete remote dataset run trigger","Please try again.")}});return o?d.isPending?(0,s.jsx)(k.E,{className:"h-48 w-full"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:[(0,s.jsx)(r.$,{variant:"ghost",onClick:()=>i(!1),className:"inline-block self-start","data-sentry-element":"Button","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:"â Back"}),(0,s.jsx)(x.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:n?"Edit remote dataset run trigger":"Set up remote dataset run trigger in UI"}),(0,s.jsxs)(x.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:["Enable your team to run custom dataset runs on dataset"," ",(0,s.jsx)("strong",{children:d.isSuccess?(0,s.jsxs)(s.Fragment,{children:['"',null==(t=d.data)?void 0:t.name,'"']}):(0,s.jsx)(ed.A,{className:"inline h-4 w-4 animate-spin"})}),". Configure a webhook URL to trigger remote custom dataset runs from UI. We will send dataset info (name, id) and config to your service, which can run against the dataset and post results to Langfuse."]})]}),(0,s.jsx)(j.lV,{...p,"data-sentry-element":"Form","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:(0,s.jsxs)("form",{onSubmit:p.handleSubmit(e=>{if(e.defaultPayload.trim())try{JSON.parse(e.defaultPayload)}catch(e){p.setError("defaultPayload",{message:"Invalid JSON format"});return}h.mutate({projectId:a,datasetId:l,url:e.url,defaultPayload:e.defaultPayload})}),className:"space-y-4",children:[(0,s.jsxs)(x.R4,{"data-sentry-element":"DialogBody","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:[(0,s.jsx)(j.zB,{control:p.control,name:"url",render:e=>{let{field:t}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"URL"}),(0,s.jsx)(j.Rr,{children:"The URL that will be called when the remote dataset run is triggered."}),(0,s.jsx)(j.MJ,{children:(0,s.jsx)(ee.p,{placeholder:"https://your-service.com/webhook",...t})}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx"}),(0,s.jsx)(j.zB,{control:p.control,name:"defaultPayload",render:e=>{let{field:t}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Default config"}),(0,s.jsx)(j.Rr,{children:"Set a default config that will be sent to the remote dataset run URL. This can be modified before starting a new run. View docs for more details."}),(0,s.jsx)(eo.g,{value:t.value,onChange:t.onChange,onBlur:t.onBlur,editable:!0,mode:"json",minHeight:200}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx"})]}),(0,s.jsx)(x.Es,{"data-sentry-element":"DialogFooter","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[n&&(0,s.jsxs)(r.$,{type:"button",variant:"destructive",onClick:()=>{confirm("Are you sure you want to delete this remote dataset run trigger?")&&f.mutate({projectId:a,datasetId:l})},disabled:f.isPending,children:[f.isPending&&(0,s.jsx)(ed.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]}),(0,s.jsxs)(r.$,{type:"submit",disabled:h.isPending,"data-sentry-element":"Button","data-sentry-source-file":"RemoteExperimentUpsertForm.tsx",children:[h.isPending?(0,s.jsx)(ed.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,n?"Update":"Set up"]})]})})]})})]}):null},ex=D.z.object({payload:D.z.string()}),ep=e=>{let{projectId:t,datasetId:a,remoteExperimentConfig:l,setShowTriggerModal:n}=e,i=(0,u.lp)({projectId:t,scope:"datasets:CUD"}),o=c.FH.datasets.byId.useQuery({projectId:t,datasetId:a}),d=(0,w.mN)({resolver:(0,b.u)(ex),defaultValues:{payload:ec(l.payload)}}),m=c.FH.datasets.triggerRemoteExperiment.useMutation({onSuccess:e=>{e.success?(0,ei.G)({title:"Dataset run started",description:"Your dataset run may take a few minutes to complete."}):(0,F.N)("Failed to start dataset run","Please try again or check your remote dataset run configuration."),n(!1)},onError:e=>{(0,F.N)(e.message||"Failed to start dataset run","Please try again or check your remote dataset run configuration.")}});return i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:[(0,s.jsx)(r.$,{variant:"ghost",onClick:()=>n(!1),className:"inline-block self-start","data-sentry-element":"Button","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:"â Back"}),(0,s.jsx)(x.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:"Run remote dataset run"}),(0,s.jsxs)(x.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:["This action will send the following information to"," ",(0,s.jsx)("strong",{children:l.url}),"."]})]}),(0,s.jsx)(j.lV,{...d,"data-sentry-element":"Form","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:(0,s.jsxs)("form",{onSubmit:d.handleSubmit(e=>{if(e.payload.trim())try{JSON.parse(e.payload)}catch(e){d.setError("payload",{message:"Invalid JSON format"});return}m.mutate({projectId:t,datasetId:a,payload:e.payload})}),className:"space-y-4",children:[(0,s.jsx)(x.R4,{"data-sentry-element":"DialogBody","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsx)(j.zB,{control:d.control,name:"payload",render:e=>{var t;let{field:a}=e;return(0,s.jsxs)(j.eI,{children:[(0,s.jsx)(j.lR,{children:"Config"}),(0,s.jsxs)(j.Rr,{children:["Confirm the config you want to send to the remote dataset run URL along with the"," ",(0,s.jsx)("strong",{children:null==(t=o.data)?void 0:t.name})," dataset information."]}),(0,s.jsx)(j.MJ,{children:(0,s.jsx)(eo.g,{value:a.value,onChange:a.onChange,onBlur:a.onBlur,editable:!0,mode:"json",minHeight:200})}),(0,s.jsx)(j.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx"})})}),(0,s.jsx)(x.Es,{"data-sentry-element":"DialogFooter","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)(r.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:m.isPending,"data-sentry-element":"Button","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:"Cancel"}),(0,s.jsxs)(r.$,{type:"submit",disabled:m.isPending,"data-sentry-element":"Button","data-sentry-source-file":"RemoteExperimentTriggerModal.tsx",children:[m.isPending&&(0,s.jsx)(ed.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Run"]})]})})]})})]}):null},eh=e=>{let{projectId:t,setFormOpen:a,defaultValues:p={},promptDefault:j,handleExperimentSettled:v,handleExperimentSuccess:g,showSDKRunInfoPage:y=!1}=e,N=(0,f.B)(),[b,w]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[I,E]=(0,l.useState)(!1),T=(0,u.lp)({projectId:t,scope:"promptExperiments:CUD"}),R=p.datasetId,F=c.FH.datasets.getRemoteExperiment.useQuery({projectId:t,datasetId:R},{enabled:!!R});return T?F.isLoading&&R?(0,s.jsx)(k.E,{className:"h-48 w-full"}):!y||b||S||I?I&&R&&F.data?(0,s.jsx)(ep,{projectId:t,datasetId:R,remoteExperimentConfig:F.data,setShowTriggerModal:E}):S&&R?(0,s.jsx)(eu,{projectId:t,datasetId:R,existingRemoteExperiment:F.data,setShowRemoteExperimentUpsertForm:C}):(0,s.jsx)(en,{projectId:t,setFormOpen:a,defaultValues:p,promptDefault:j,handleExperimentSettled:v,handleExperimentSuccess:g,"data-sentry-element":"MultiStepExperimentForm","data-sentry-component":"CreateExperimentsForm","data-sentry-source-file":"CreateExperimentsForm.tsx"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.c7,{children:[(0,s.jsx)(x.L3,{children:"Run Experiment"}),(0,s.jsxs)(x.rr,{children:["Experiments allow you to test iterations of your application or prompt on a dataset. Learn more about experiments"," ",(0,s.jsx)(h(),{href:"https://langfuse.com/docs/evaluation/dataset-runs/datasets",target:"_blank",className:"underline",children:"here"}),"."]})]}),(0,s.jsx)(x.R4,{className:"pb-8",children:(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-2 grid-rows-1 gap-2",children:[(0,s.jsxs)(m.Zp,{className:"flex flex-1 flex-col",children:[(0,s.jsxs)(m.aR,{children:[(0,s.jsxs)(m.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,s.jsx)(n.A,{className:"size-4"}),"via User Interface"]}),(0,s.jsx)(m.BT,{children:"Test single prompts and model configurations via Langfuse UI."})]}),(0,s.jsx)(m.Wu,{children:(0,s.jsxs)("ul",{className:"list-disc space-y-2 pl-4 text-sm text-muted-foreground",children:[(0,s.jsx)("li",{children:"Compare prompt versions"}),(0,s.jsx)("li",{children:"Compare model configurations"}),(0,s.jsx)("li",{children:"No code required"})]})}),(0,s.jsxs)(m.wL,{className:"mt-auto flex flex-row gap-2",children:[(0,s.jsx)(r.$,{className:"w-full",onClick:()=>w(!0),children:"Configure"}),(0,s.jsx)(r.$,{variant:"outline",className:"w-full",asChild:!0,onClick:()=>N("dataset_run:view_prompt_experiment_docs"),children:(0,s.jsx)(h(),{href:"https://langfuse.com/docs/evaluation/dataset-runs/native-run",children:"View Docs"})})]})]}),(0,s.jsxs)(m.Zp,{className:"flex flex-1 flex-col",children:[(0,s.jsxs)(m.aR,{children:[(0,s.jsxs)(m.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,s.jsx)(i.A,{className:"size-4"}),"via SDK / API"]}),(0,s.jsx)(m.BT,{children:"Start any dataset run via the Langfuse SDKs. To configure runs via webhook, use the button below."})]}),(0,s.jsx)(m.Wu,{children:(0,s.jsxs)("ul",{className:"list-disc space-y-2 pl-4 text-sm text-muted-foreground",children:[(0,s.jsx)("li",{children:"Full control over dataset run execution"}),(0,s.jsx)("li",{children:"Custom evaluation logic"}),(0,s.jsx)("li",{children:"Integration with your codebase"})]})}),(0,s.jsxs)(m.wL,{className:"mt-auto flex flex-row gap-2",children:[!!F.data&&R&&(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(r.$,{className:"rounded-r-none",onClick:()=>E(!0),children:"Run"}),(0,s.jsx)(r.$,{className:"rounded-l-none rounded-r-md border-l-2 px-2",onClick:()=>C(!0),children:(0,s.jsx)("span",{className:"relative mr-1 text-xs",children:(0,s.jsx)(o.A,{className:"h-3 w-3"})})})]}),(0,s.jsx)(r.$,{className:"flex-1",variant:"outline",asChild:!0,onClick:()=>N("dataset_run:view_custom_experiment_docs"),children:(0,s.jsx)(h(),{href:"https://langfuse.com/docs/evaluation/dataset-runs/remote-run",target:"_blank",children:"View Docs"})}),!F.data&&(0,s.jsx)(r.$,{variant:"outline",title:"Set up remote dataset run in UI trigger",className:"h-8 w-8 flex-shrink-0",size:"icon",onClick:()=>C(!0),children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})]})]})]})})]}):null}},87802:(e,t,a)=>{a.d(t,{r:()=>l});var s=a(93367);function l(e){let{projectId:t}=e,{data:a}=s.FH.defaultLlmModel.fetchDefaultModel.useQuery({projectId:t});return{isTemplateInvalid:e=>(!e.provider||!e.model)&&!a}}},99432:(e,t,a)=>{a.d(t,{U:()=>w});var s=a(73154),l=a(21),r=a(92273),n=a(36932),i=a(72459),o=a(31450),d=a(67716),c=a(97638),m=a(11341),u=a(81509),x=a(86843),p=a(96810),h=a(68389),f=a.n(h),j=a(93367),v=a(53524),g=a(87802),y=a(4672),N=a(5157),b=a(47282);let w=e=>{let{projectId:t,datasetId:a,evalTemplates:h,activeTemplateIds:w,inactiveTemplateIds:S,evaluatorTargetObjects:C,onConfigureTemplate:I,onSelectEvaluator:E,onEvaluatorToggled:T,className:R,disabled:F=!1}=e,[k,D]=(0,p.useState)(!1),[A,M]=(0,p.useState)(""),P=(0,b.o)(),{activeTemplates:L,isTemplateActive:V,isTemplateInactive:O,handleRowClick:B}=function(e){let{projectId:t,datasetId:a,initialActiveTemplateIds:s=[],initialInactiveTemplateIds:l=[],onSelectEvaluator:r,onEvaluatorToggled:n}=e,[i,o]=(0,p.useState)(s),[d,c]=(0,p.useState)(l);(0,p.useEffect)(()=>{o(s)},[s]),(0,p.useEffect)(()=>{c(l)},[l]);let m=j.FH.evals.updateAllDatasetEvalJobStatusByTemplateId.useMutation({onSuccess:(e,t)=>{"INACTIVE"===t.newStatus?(o(e=>e.filter(e=>e!==t.evalTemplateId)),c(e=>[...e,t.evalTemplateId])):(o(e=>[...e,t.evalTemplateId]),c(e=>e.filter(e=>e!==t.evalTemplateId))),null==n||n()}}),u=(0,p.useCallback)(e=>{r&&r(e)},[r]),x=(0,p.useCallback)(e=>i.includes(e),[i]),h=(0,p.useCallback)(e=>d.includes(e),[d]);return{activeTemplates:i,handleRowClick:e=>{x(e)?m.mutate({projectId:t,evalTemplateId:e,datasetId:a,newStatus:"INACTIVE"}):h(e)?m.mutate({projectId:t,evalTemplateId:e,datasetId:a,newStatus:"ACTIVE"}):u(e)},isTemplateActive:x,isTemplateInactive:h,isLoading:m.isPending}}({projectId:t,datasetId:a,initialActiveTemplateIds:w,initialInactiveTemplateIds:S,onSelectEvaluator:E,onEvaluatorToggled:T}),{isTemplateValid:_,hasDefaultModel:$}=function(e){let{projectId:t,selectedTemplateIds:a=[]}=e,[s,l]=(0,p.useState)(!0),{data:r,isLoading:n}=j.FH.defaultLlmModel.fetchDefaultModel.useQuery({projectId:t},{enabled:!!t}),{data:i}=j.FH.evals.allTemplates.useQuery({projectId:t},{enabled:!!t});return(0,p.useEffect)(()=>{n||(r?l(!0):l(!((null==i?void 0:i.templates)||[]).filter(e=>a.includes(e.id)).some(e=>!e.provider||!e.model)))},[r,n,a,null==i?void 0:i.templates]),{isSelectionValid:s,hasDefaultModel:!!r,defaultModel:r,isTemplateValid:e=>{if(!(null==i?void 0:i.templates)||r)return!0;let t=i.templates.find(t=>
1t.id===e);return!t||void 0!==t.provider&&void 0!==t.model}}}({projectId:t,selectedTemplateIds:L}),H=h.reduce((e,t)=>{let a=t.projectId?"custom":"langfuse";return e[a][t.name]||(e[a][t.name]=[]),e[a][t.name].push(t),e},{langfuse:{},custom:{}}),U={langfuse:Object.entries(H.langfuse).filter(e=>{let[t]=e;return t.toLowerCase().includes(A.toLowerCase())}).sort((e,t)=>{var a,s;let[l,r]=e,[n,i]=t,o=null==(a=r[0])?void 0:a.partner,d=null==(s=i[0])?void 0:s.partner;return!o&&d?-1:o&&!d?1:l.localeCompare(n)}),custom:Object.entries(H.custom).filter(e=>{let[t]=e;return t.toLowerCase().includes(A.toLowerCase())}).sort((e,t)=>{let[a]=e,[s]=t;return a.localeCompare(s)})},Z=U.langfuse.length>0||U.custom.length>0,J=(e,t)=>{e.stopPropagation(),_(t)&&I&&I(t)},{isTemplateInvalid:z}=(0,g.r)({projectId:t});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(c.AM,{open:k,onOpenChange:D,"data-sentry-element":"Popover","data-sentry-source-file":"template-selector.tsx",children:[(0,s.jsx)(c.Wv,{asChild:!0,"data-sentry-element":"PopoverTrigger","data-sentry-source-file":"template-selector.tsx",children:(0,s.jsxs)(x.$,{variant:"outline",role:"combobox","aria-expanded":k,className:(0,u.cn)("w-full justify-between px-2 font-normal",R),"data-sentry-element":"Button","data-sentry-source-file":"template-selector.tsx",children:[(0,s.jsx)("div",{className:"flex items-center gap-1 overflow-hidden",children:(0,s.jsx)("span",{className:"mr-1 truncate",children:L.length>0?"".concat(L.length," active evaluators"):"Select evaluators"})}),(0,s.jsx)(l.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-sentry-element":"ChevronDown","data-sentry-source-file":"template-selector.tsx"})]})}),(0,s.jsx)(c.hl,{className:"w-[300px] p-0",align:"start","data-sentry-element":"PopoverContent","data-sentry-source-file":"template-selector.tsx",children:(0,s.jsxs)(m.wJ,{"data-sentry-element":"InputCommand","data-sentry-source-file":"template-selector.tsx",children:[(0,s.jsx)(m.g1,{placeholder:"Search evaluators...",className:"h-9",value:A,onValueChange:M,variant:"bottom","data-sentry-element":"InputCommandInput","data-sentry-source-file":"template-selector.tsx"}),(0,s.jsx)("div",{tabIndex:0,className:"overflow-y-auto focus:outline-none",style:{maxHeight:"300px"},onWheel:e=>{e.stopPropagation()},children:(0,s.jsxs)(m.S2,{className:"max-h-full overflow-visible overflow-x-hidden","data-sentry-element":"InputCommandList","data-sentry-source-file":"template-selector.tsx",children:[!Z&&(0,s.jsx)(m.TD,{children:"No evaluator found."}),U.custom.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.Jf,{heading:"Custom evaluators",className:"max-h-full",children:U.custom.map(e=>{let[a,l]=e,c=l[l.length-1],u=V(c.id),p=O(c.id),h=z(c),j=(null==C?void 0:C[c.id])==="dataset";return(0,s.jsxs)(m.tZ,{onSelect:()=>{B(c.id)},disabled:h||F,children:[u?(0,s.jsx)(r.A,{className:"mr-2 h-4 w-4"}):(0,s.jsx)("div",{className:"mr-2 h-4 w-4"}),a,P&&j&&(0,s.jsx)(d.E,{variant:"outline",className:"ml-2 text-xs",children:"legacy"}),h&&(0,s.jsxs)(v.m_,{children:[(0,s.jsx)(v.k$,{asChild:!0,children:(0,s.jsx)(n.A,{className:"ml-1 h-4 w-4 text-yellow-500"})}),(0,s.jsxs)(v.ZI,{className:"max-h-[50dvh] overflow-y-auto whitespace-normal break-normal text-xs",children:[(0,s.jsx)("p",{children:"Requires project-level evaluation model"}),(0,s.jsxs)(f(),{href:"/project/".concat(t,"/evals/default-model"),className:"mt-2 flex items-center gap-1 text-blue-600 hover:underline",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Configure default model"]})]})]}),p&&(0,s.jsx)("div",{title:"The evaluator has been used in the past but is currently paused. It will not run against outputs created in this dataset run. You can reactivate it if you wish",className:"ml-2 text-xs text-muted-foreground",children:"Paused"}),u&&(0,s.jsx)(x.$,{variant:"ghost",size:"icon-xs",onClick:e=>J(e,c.id),className:"ml-auto",title:h?"Configure default model first":"Configure evaluator",disabled:h||F,children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})]},"custom-".concat(a))})}),U.custom.length>0&&(0,s.jsx)(m.xP,{})]}),U.langfuse.length>0&&(0,s.jsx)(m.Jf,{heading:"Langfuse managed evaluators",className:"max-h-full min-h-0",children:U.langfuse.map(e=>{let[a,l]=e,c=l[l.length-1],u=V(c.id),p=O(c.id),h=z(c),j=(null==C?void 0:C[c.id])==="dataset";return(0,s.jsxs)(m.tZ,{onSelect:()=>{B(c.id)},disabled:h||F,children:[u?(0,s.jsx)(r.A,{className:"mr-2 h-4 w-4"}):(0,s.jsx)("div",{className:"mr-2 h-4 w-4"}),(0,s.jsx)("div",{className:"mr-1",children:a}),(0,s.jsx)(N.q,{maintainer:(0,y.Lb)(c)}),P&&j&&(0,s.jsx)(d.E,{variant:"outline",className:"ml-2 text-xs",children:"legacy"}),h&&(0,s.jsxs)(v.m_,{children:[(0,s.jsx)(v.k$,{asChild:!0,children:(0,s.jsx)(n.A,{className:"ml-1 h-4 w-4 text-yellow-500"})}),(0,s.jsxs)(v.ZI,{className:"max-h-[50dvh] overflow-y-auto whitespace-normal break-normal text-xs",children:[(0,s.jsx)("p",{children:"Requires project-level evaluation model"}),(0,s.jsxs)(f(),{href:"/project/".concat(t,"/evals/default-model"),className:"mt-2 flex items-center gap-1 text-blue-600 hover:underline",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Configure default model"]})]})]}),p&&(0,s.jsx)("div",{title:"The evaluator has been used in the past but is currently paused. It will not run against outputs created in this dataset run. You can reactivate it if you wish",className:"ml-2 text-xs text-muted-foreground",children:"Paused"}),u&&(0,s.jsx)(x.$,{variant:"ghost",size:"icon-xs",className:"ml-auto",onClick:e=>J(e,c.id),title:h?"Configure default model first":"Configure evaluator",disabled:h||F,children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})]},"langfuse-".concat(a))})}),(0,s.jsx)(m.xP,{alwaysRender:!0,"data-sentry-element":"InputCommandSeparator","data-sentry-source-file":"template-selector.tsx"}),(0,s.jsxs)(m.Jf,{forceMount:!0,"data-sentry-element":"InputCommandGroup","data-sentry-source-file":"template-selector.tsx",children:[(0,s.jsxs)(m.tZ,{onSelect:()=>{F||window.open("/project/".concat(t,"/evals/templates/new"),"_blank")},"data-sentry-element":"InputCommandItem","data-sentry-source-file":"template-selector.tsx",children:["Create custom evaluator",(0,s.jsx)(i.A,{className:"ml-auto h-4 w-4","data-sentry-element":"ExternalLink","data-sentry-source-file":"template-selector.tsx"})]}),!$&&(0,s.jsxs)(m.tZ,{onSelect:()=>{F||window.open("/project/".concat(t,"/evals/default-model"),"_blank")},children:["Configure default model",(0,s.jsx)(i.A,{className:"ml-auto h-4 w-4"})]})]})]})})]})})]})})};w.displayName="TemplateSelector"}}]);
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.