@@ -6,8 +6,12 @@ import { zodResolver } from '@hookform/resolvers/zod'
6
6
import { useMutation , useQuery } from '@tanstack/react-query'
7
7
import { useForm } from 'react-hook-form'
8
8
9
- import { addUpdateConfiguration , getConfiguration } from '@/apis/admin/configuration'
9
+ import {
10
+ addUpdateConfiguration ,
11
+ getConfiguration ,
12
+ } from '@/apis/admin/configuration'
10
13
import { Button } from '@/components/ui/button'
14
+ import { Input } from '@/components/ui/input'
11
15
import { Label } from '@/components/ui/label'
12
16
import { useToast } from '@/hooks/use-toast'
13
17
import { InputWithToggle } from './_components/InputWithToggle'
@@ -54,6 +58,7 @@ export default function Configuration() {
54
58
xAccessKey : creds . providers ?. x ?. accessKey || '' ,
55
59
xBaseUrl : creds . providers ?. x ?. baseUrl || '' ,
56
60
pineconeApiKey : creds . providers ?. pinecone ?. apiKey || '' ,
61
+ pineconeIndexName : creds . providers ?. pinecone ?. indexName || '' ,
57
62
calendlyMeetingLink : creds . calendlyMeetingLink || '' ,
58
63
} )
59
64
}
@@ -62,7 +67,7 @@ export default function Configuration() {
62
67
// Disable automatic refetching
63
68
refetchOnMount : false ,
64
69
refetchOnWindowFocus : false ,
65
- refetchOnReconnect : false
70
+ refetchOnReconnect : false ,
66
71
} )
67
72
68
73
const handleClick = ( data : TUpdateSchema ) => {
@@ -243,6 +248,34 @@ export default function Configuration() {
243
248
error = { errors . pineconeApiKey }
244
249
/>
245
250
</ div >
251
+
252
+ < div className = 'flex w-full flex-col space-y-2' >
253
+ < Label className = 'flex items-center gap-2 text-dashboardText' >
254
+ < span > Pinecone Index Name</ span >
255
+ < span className = 'relative -top-1.5 mt-1' >
256
+ < Image
257
+ src = '/assets/knowledgebase/required.svg'
258
+ alt = 'required'
259
+ width = { 4 }
260
+ height = { 4 }
261
+ />
262
+ </ span >
263
+ </ Label >
264
+ < Input
265
+ { ...register ( 'pineconeIndexName' ) }
266
+ placeholder = 'your-pinecone-index'
267
+ className = 'h-10 bg-white'
268
+ />
269
+ < p className = 'mt-1 text-xs text-muted-foreground' >
270
+ You can find your index name in the Pinecone dashboard
271
+ under 'Indexes'
272
+ </ p >
273
+ { errors . pineconeIndexName && (
274
+ < p className = 'text-xs text-red-500' >
275
+ { errors . pineconeIndexName . message }
276
+ </ p >
277
+ ) }
278
+ </ div >
246
279
</ div >
247
280
</ div >
248
281
0 commit comments