-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
230 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
|
||
interface RefreshIndexContextType { | ||
totalRecords: number; | ||
refreshIndex: () => Promise<void>; | ||
} | ||
const defaultContext: RefreshIndexContextType = { | ||
totalRecords: 0, | ||
refreshIndex: () => Promise.resolve(), | ||
}; | ||
|
||
const AppContext = React.createContext<RefreshIndexContextType>(defaultContext); | ||
|
||
export default AppContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import React from 'react'; | ||
import { Popover, PopoverHandler, PopoverContent } from "@material-tailwind/react"; | ||
import { IoMdInformationCircleOutline } from "react-icons/io"; | ||
|
||
interface RecursiveSplittingOptionsProps { | ||
chunkSize: number; | ||
setChunkSize: (value: number) => void; | ||
overlap: number; | ||
setOverlap: (value: number) => void; | ||
openChunkSizePopover: boolean; | ||
setOpenChunkSizePopover: (value: boolean) => void; | ||
openOverLapPopover: boolean; | ||
setOpenOverLapPopover: (value: boolean) => void; | ||
} | ||
|
||
export const RecursiveSplittingOptions: React.FC<RecursiveSplittingOptionsProps> = ({ | ||
chunkSize, | ||
setChunkSize, | ||
overlap, | ||
setOverlap, | ||
openChunkSizePopover, | ||
setOpenChunkSizePopover, | ||
openOverLapPopover, | ||
setOpenOverLapPopover | ||
}) => { | ||
const chunkSizePopoverTriggers = { | ||
onMouseEnter: () => setOpenChunkSizePopover(true), | ||
onMouseLeave: () => setOpenChunkSizePopover(false), | ||
}; | ||
|
||
const overLapPopoverTriggers = { | ||
onMouseEnter: () => setOpenOverLapPopover(true), | ||
onMouseLeave: () => setOpenOverLapPopover(false), | ||
}; | ||
|
||
return ( | ||
<div className="w-full"> | ||
<div className="my-4 flex flex-col"> | ||
<div className="flex flex-col w-full"> | ||
<div className="flex gap-1"> | ||
<span>Chunk Size: </span><span className="font-bold">{chunkSize}</span><span> | ||
<div> | ||
<Popover open={openChunkSizePopover} handler={setOpenChunkSizePopover} placement="left"> | ||
<PopoverHandler {...chunkSizePopoverTriggers}> | ||
<div><IoMdInformationCircleOutline className="text-[#72788D] mt-1 text-lg" /></div> | ||
</PopoverHandler> | ||
<PopoverContent {...chunkSizePopoverTriggers} className="z-50 max-w-[24rem]" placeholder=""> | ||
<div className="mb-2 flex items-center justify-between gap-4"> | ||
Chunk size in recursive text splitting is the user defined portion of text that's divided and processed in each recursion step, influencing the accuracy of the operation. | ||
</div> | ||
</PopoverContent> | ||
</Popover> | ||
</div> | ||
</span> | ||
</div> | ||
|
||
<input | ||
className="p-2" | ||
type="range" | ||
id="chunkSize" | ||
min={1} | ||
max={2048} | ||
onChange={(e) => setChunkSize(parseInt(e.target.value))} | ||
/> | ||
</div> | ||
<div className="flex flex-col w-full"> | ||
<div className="flex gap-1"> | ||
<span>Overlap:</span><span className="font-bold">{overlap}</span><span> | ||
<div> | ||
<Popover open={openOverLapPopover} handler={setOpenOverLapPopover} placement="left"> | ||
<PopoverHandler {...overLapPopoverTriggers}> | ||
<div><IoMdInformationCircleOutline className="text-[#72788D] mt-1 text-lg" /></div> | ||
</PopoverHandler> | ||
<PopoverContent {...overLapPopoverTriggers} className="z-50 max-w-[24rem]" placeholder=""> | ||
<div className="mb-2 flex items-center justify-between gap-4"> | ||
Overlap in recursive text splitting is the user-specified section of text that's intentionally repeated across chunks to maintain context and potentially enhance accuracy. | ||
</div> | ||
</PopoverContent> | ||
</Popover> | ||
</div> | ||
</span> | ||
</div> | ||
<input | ||
className="p-2" | ||
type="range" | ||
id="overlap" | ||
min={1} | ||
max={200} | ||
onChange={(e) => setOverlap(parseInt(e.target.value))} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
File renamed without changes.
Oops, something went wrong.