main
reng 1 month ago
parent 506a98cb7d
commit 503ed29ffd
  1. 4
      v2/app/src/App.jsx
  2. 7
      v2/app/src/components/graph.jsx
  3. 4
      v2/app/src/components/point.jsx
  4. 2
      v2/app/src/utils/parsing.js

@ -49,7 +49,7 @@ function App() {
</div> </div>
<p id="embeddings"></p> <p id="embeddings"></p>
<form> {/* <form>
<p>search by any text</p> <p>search by any text</p>
<input type="text" name="query" placeholder="Enter your query" /> <input type="text" name="query" placeholder="Enter your query" />
<button type="button" onClick={()=>{ <button type="button" onClick={()=>{
@ -60,7 +60,7 @@ function App() {
}}> }}>
Search Search
</button> </button>
</form> </form> */}
<form> <form>
<p>search by theme</p> <p>search by theme</p>
<select name="collection"> <select name="collection">

@ -11,6 +11,7 @@ export default function Graph({results}){
const [points, setPoints]=useState(); const [points, setPoints]=useState();
const [lines, setLines]=useState(); const [lines, setLines]=useState();
const [drawLines, setDrawLines]=useState(false);
const [showContent, setShowContent]=useState(false); const [showContent, setShowContent]=useState(false);
const bounds = useBounds(); const bounds = useBounds();
@ -57,6 +58,10 @@ export default function Graph({results}){
<input type="checkbox" id="toggle-content" className='self-end mr-2' defaultChecked={showContent} <input type="checkbox" id="toggle-content" className='self-end mr-2' defaultChecked={showContent}
onChange={(e)=>setShowContent(e.target.checked)} /> onChange={(e)=>setShowContent(e.target.checked)} />
<label htmlFor="toggle-content" className='self-end text-xs mr-4'>Show Content</label> <label htmlFor="toggle-content" className='self-end text-xs mr-4'>Show Content</label>
<input type="checkbox" id="toggle-content" className='self-end mr-2' defaultChecked={drawLines}
onChange={(e)=>setDrawLines(e.target.checked)} />
<label htmlFor="toggle-content" className='self-end text-xs mr-4'>Draw line</label>
</div> </div>
<Canvas className='w-full aspect-[16/9] border border-gray-300'> <Canvas className='w-full aspect-[16/9] border border-gray-300'>
<color attach="background" args={['#000000']} /> <color attach="background" args={['#000000']} />
@ -74,7 +79,7 @@ export default function Graph({results}){
</group> </group>
<group> <group>
{Array.isArray(lines) && lines?.map((line, index)=>( {drawLines && Array.isArray(lines) && lines?.map((line, index)=>(
<Line <Line
key={index} key={index}
points={line} // Array of [x, y, z] or Three.Vector3 points={line} // Array of [x, y, z] or Three.Vector3

@ -7,7 +7,7 @@ import gsap from 'gsap';
export const PointScale=200; export const PointScale=200;
const PointSize=6; const PointSize=6;
const PointDuration=5; const PointDuration=3;
const KeywordOffset=0; const KeywordOffset=0;
export default function Point({point, index, totalPoints, result, showContent}) { export default function Point({point, index, totalPoints, result, showContent}) {
@ -40,7 +40,7 @@ export default function Point({point, index, totalPoints, result, showContent})
}, { }, {
x: PointSize, y: PointSize, z: PointSize, x: PointSize, y: PointSize, z: PointSize,
duration:PointDuration, duration:PointDuration,
delay: lifeTime *5, delay: lifeTime *PointDuration,
ease: "power3.in", ease: "power3.in",
onUpdate:()=>{ onUpdate:()=>{
if(refText.current){ if(refText.current){

@ -137,7 +137,7 @@ async function writeToQdrant(id,embeddings, text, collection){
return data; return data;
} }
export async function searchByText(text){ export async function searchByText(query){
const queryEmbeddings=await textToEmbeddings(query); const queryEmbeddings=await textToEmbeddings(query);
return await searchQdrant(queryEmbeddings); return await searchQdrant(queryEmbeddings);
} }

Loading…
Cancel
Save