PageSourceSearch

https://app.snapto.ai/assets/Chatgpt-CINwtSlN.js

js snapto.ai collected 2026-10-05 15:07:29 UTC 4,772 bytes, 1 lines download raw bytes

1import{C as $,r as a,p as e,L as C,T as b,v as c,B as i,af as M,x as _,N as d,ba as A,bF as D,z as E}from"./index-C9IH3k-2.js";import{N as w,W as o,T as u,g as L,J as R}from"./TemplateUtil-D1DzmWLm.js";import{P as K}from"./PageDescription-BrOUsEZE.js";import{F as V}from"./Table-isZ0WXp4.js";import"./Wrapper-ChjuDa3w.js";import"./HelperMethods-C-ewwU_x.js";import"./index-BOwvFOZJ.js";import"./Pagination-D1z-xPUv.js";import"./HolderOutlined-YOHjCGKZ.js";const{Text:r}=b,q=()=>{const f=$(),[I,T]=a.useState([]),[k,l]=a.useState(!1),[s,m]=a.useState(null),[S,x]=a.useState(!1),[y,v]=a.useState({current:1,pageSize:10}),j=async()=>{try{l(!0);const t=await _("/api/v1/openai/config/list");t&&t.status===200&&T(t.data||[])}catch{d.error("Failed to fetch configurations. Please try again.")}finally{l(!1)}};a.useEffect(()=>{j()},[]);const z=t=>{m(t),x(!0)},h=t=>{f("/Integrations/Chatgpt/UpdateConfig",{state:{config:t}})},N=t=>{w.confirm({title:"Delete Configuration",content:e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("b",{children:t.name}),"? This action cannot be undone."]}),e.jsx("b",{children:"Warning:"})," If this configuration is currently used in any chatbot, deleting it will break the chatbot functionality."]}),okText:"Yes, Delete",okType:"danger",cancelText:"Cancel",onOk:async()=>{try{l(!0);const n=await E(`/api/v1/openai/config/${t.id}`);n&&n.status===200?(d.success(`Configuration "${t.name}" deleted successfully!`),j()):d.error("Failed to delete configuration. Please try again.")}catch{d.error("Failed to delete configuration. Please try again.")}finally{l(!1)}}})},p=()=>{x(!1),m(null)},F=()=>{f("/Integrations/Chatgpt/CreateConfig")},P=[{title:"Name",dataIndex:"name",key:"name",render:(t,n)=>e.jsx(i,{type:"link",onClick:()=>h(n),children:n?.name})},{title:"Model",dataIndex:["config","model"],key:"model",render:t=>e.jsx(u,{color:"blue",children:t})},{title:"Tools",dataIndex:["config","tools"],key:"tools",render:t=>e.jsx(c,{wrap:!0,children:t?.map((n,g)=>e.jsx(u,{color:n.type==="file_search"?"green":"orange",children:n.type},g))})},{title:"System Instructions",dataIndex:["config","input"],key:"instructions",render:t=>{const n=t?.find(g=>g.role==="system");return e.jsx(r,{ellipsis:!0,style:{maxWidth:200},children:n?.content})}},{title:"Actions",key:"actions",render:(t,n)=>e.jsxs(c,{children:[e.jsx(i,{type:"text",icon:e.jsx(A,{}),size:"small",onClick:()=>z(n),children:"View"}),e.jsx(i,{type:"text",icon:e.jsx(D,{}),size:"small",onClick:()=>h(n),children:"Edit"}),e.jsx(i,{type:"text",icon:e.jsx(R,{}),size:"small",danger:!0,onClick:()=>N(n),children:"Delete"})]})}];return e.jsxs(C,{vertical:!0,gap:"large",children:[e.jsxs(C,{justify:"space-between",wrap:!0,children:[e.jsx(b.Title,{level:4,style:{margin:0},children:"ChatGPT Configurations"}),e.jsx(c,{children:e.jsx(i,{type:"primary",icon:e.jsx(M,{}),onClick:F,children:"Create New Configuration"})})]}),e.jsx(K,{children:"ChatGPT configurations allow you to set up and manage different AI models and their parameters for use in your chatbots. You can create multiple configurations with different models, system instructions, and tools. This enables you to tailor the AI's behavior and responses based on your specific needs and use cases."}),e.jsx(V,{columns:P,dataSource:I,loading:k,rowKey:"id",pagination:{current:y.current,pageSize:y.pageSize,showSizeChanger:!0,showQuickJumper:!0,showTotal:(t,n)=>`${n[0]}-${n[1]} of ${t} items`},onChange:t=>v({current:t.current,pageSize:t.pageSize}),scroll:{x:"max-content"}}),e.jsx(w,{title:"Configuration Details",open:S,onCancel:p,footer:[e.jsx(i,{type:"primary",onClick:()=>{p(),h(s)},children:"Edit Configuration"},"edit"),e.jsx(i,{onClick:p,children:"Close"},"close")],width:800,styles:{body:{maxHeight:"70vh",overflowY:"auto"}},children:s&&e.jsxs(o,{bordered:!0,column:1,children:[e.jsx(o.Item,{label:"Name",children:e.jsx(r,{strong:!0,children:s.name})}),e.jsx(o.Item,{label:"Model",children:e.jsx(u,{color:"blue",children:s.config?.model})}),e.jsx(o.Item,{label:"System Instructions",children:e.jsx(r,{style:{whiteSpace:"pre-wrap"},children:s.config?.input?.find(t=>t.role==="system")?.content||"No system instructions"})}),e.jsx(o.Item,{label:"Tools",children:e.jsx(c,{wrap:!0,children:s.config?.tools?.map((t,n)=>e.jsxs(u,{color:t.type==="file_search"?"green":"orange",children:[t.type,t.vector_store_ids&&` (${t.vector_store_ids.length} files)`]},n))||e.jsx(r,{type:"secondary",children:"No tools configured"})})}),e.jsx(o.Item,{label:"API Key",children:e.jsx(r,{code:!0,children:s.apiKey?s.apiKey.substring(0,10)+"...":"Not set"})}),e.jsx(o.Item,{label:"Created",children:e.jsx(r,{type:"secondary",children:s.creationTime?L(s.creationTime):"Unknown"})})]})})]})};export{q as default};

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.