import{a as R}from"/build/_shared/chunk-NID5ZFDO.js";import{a as y}from"/build/_shared/chunk-WL3EVROT.js";import{a as k,b as P}from"/build/_shared/chunk-WHOMLFI6.js";import{a as E}from"/build/_shared/chunk-YGINDR4A.js";import{a as J}from"/build/_shared/chunk-ANUO2FWR.js";import{a as v,b as _,c as w,d,e as i,f as n}from"/build/_shared/chunk-EBHCYYOH.js";import{a as H}from"/build/_shared/chunk-BPD542OA.js";import{N as L,t as c}from"/build/_shared/chunk-FXRQ2H3S.js";import"/build/_shared/chunk-GYJW4R24.js";import"/build/_shared/chunk-VX2L2R2M.js";import"/build/_shared/chunk-ZH5DBAIE.js";import{a as C}from"/build/_shared/chunk-PAEG26CW.js";import"/build/_shared/chunk-F4G4S474.js";import{B as f,C as m,e as g,g as h,o as p,u as D}from"/build/_shared/chunk-XIQ3C74K.js";import{a as Y}from"/build/_shared/chunk-5TRFQBKG.js";import"/build/_shared/chunk-T6T2AEVA.js";import{a as T}from"/build/_shared/chunk-LR6G3KVW.js";import{d as r}from"/build/_shared/chunk-G5WX4PPA.js";var x=r(Y(),1);f();f();f();var F=r(E(),1);var t=r(m(),1),I=({finetune:e})=>{let l=g(),a=e.metadata,{variant:u}=P(e.id),b=`https://platform.openai.com/finetune/${a.id}`;return(0,t.jsxs)(d,{children:[(0,t.jsx)(n,{className:"max-w-36",children:a?.fine_tuned_model?(0,t.jsx)(k,{variant:u,children:a.fine_tuned_model.length>16?`${a.fine_tuned_model.slice(0,16)}...`:a.fine_tuned_model}):"\u2014"}),(0,t.jsx)(n,{children:(0,t.jsxs)(p,{to:T.app.project.env.datasetsId({projectId:l.projectId,envId:l.envId,datasetId:e.dataset.id}),className:"flex gap-1",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),(0,t.jsx)("p",{children:e.dataset.name})]})}),(0,t.jsx)(n,{children:e.provider}),(0,t.jsx)(n,{children:e.model}),(0,t.jsx)(n,{children:e.status}),(0,t.jsx)(n,{children:a.created_at?(0,F.default)(a.created_at*1e3).format("h:mma D/M/YY"):"\u2014"}),(0,t.jsx)(n,{children:a.finished_at?(0,F.default)(a.finished_at*1e3).format("h:mma D/M/YY"):"\u2014"}),(0,t.jsx)(n,{children:(0,t.jsx)(p,{to:b,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(c,{className:"h-4 w-4"})})})]},e.id)};var o=r(m(),1),B=({fineTunes:e})=>(0,o.jsxs)(v,{children:[(0,o.jsx)(_,{children:(0,o.jsxs)(d,{children:[(0,o.jsx)(i,{children:"ID"}),(0,o.jsx)(i,{children:"Dataset"}),(0,o.jsx)(i,{children:"Provider"}),(0,o.jsx)(i,{children:"Model"}),(0,o.jsx)(i,{children:"Status"}),(0,o.jsx)(i,{children:"Started"}),(0,o.jsx)(i,{children:"Ended"}),(0,o.jsx)(i,{children:"Actions"})]})}),(0,o.jsx)(w,{children:e.length?e.map(l=>(0,o.jsx)(I,{finetune:l},l.id)):(0,o.jsx)(d,{children:(0,o.jsx)(n,{colSpan:8,className:"h-24 text-center",children:"No fine-tunes."})})})]});var s=r(m(),1),W=({fineTunes:e})=>(0,s.jsx)(H,{breadcrumbs:[{label:"Fine-Tuning"}],subtitle:()=>(0,s.jsxs)(J,{children:["Fine-tune models using your datasets."," ",(0,s.jsx)(R,{to:T.external.docs.fineTuning,children:"Fine-Tuning Docs."})]}),action:()=>{let{revalidate:b}=h();return(0,s.jsx)(y,{variant:"ghost",size:"icon",onClick:b,children:(0,s.jsx)(L,{className:"h-4 w-4"})})},children:(0,s.jsx)(B,{fineTunes:e})});var S=r(m(),1),se=C(async({api:e,params:l})=>{let a=l.envId,u=await e.fineTuning.fineTuningControllerGetFineTunesForEnv({envId:a});return(0,x.json)({fineTunes:u})});function N(){let{fineTunes:e}=D();return(0,S.jsx)(W,{fineTunes:e})}export{N as default};
