abadesalex commited on
Commit
984d2f5
β€’
1 Parent(s): fe7c659
Api/app/__pycache__/main.cpython-310.pyc CHANGED
Binary files a/Api/app/__pycache__/main.cpython-310.pyc and b/Api/app/__pycache__/main.cpython-310.pyc differ
 
Api/app/main.py CHANGED
@@ -39,12 +39,12 @@ async def root():
39
 
40
 
41
  # Serve static files from the 'out/_next/static' directory
42
- app.mount("/_next/static", StaticFiles(directory="src/out/_next/static"), name="static")
43
 
44
  # Serve the main index.html
45
  @app.get("/")
46
  def read_root():
47
- return FileResponse("src/out/index.html")
48
 
49
 
50
 
 
39
 
40
 
41
  # Serve static files from the 'out/_next/static' directory
42
+ app.mount("/_next/static", StaticFiles(directory="app/out/_next/static"), name="static")
43
 
44
  # Serve the main index.html
45
  @app.get("/")
46
  def read_root():
47
+ return FileResponse("app/out/index.html")
48
 
49
 
50
 
Api/app/modules/querySearch/controllers/__pycache__/querySearch_controller.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/querySearch/controllers/__pycache__/querySearch_controller.cpython-310.pyc and b/Api/app/modules/querySearch/controllers/__pycache__/querySearch_controller.cpython-310.pyc differ
 
Api/app/modules/querySearch/features/__pycache__/querySearch_feature.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/querySearch/features/__pycache__/querySearch_feature.cpython-310.pyc and b/Api/app/modules/querySearch/features/__pycache__/querySearch_feature.cpython-310.pyc differ
 
Api/app/modules/querySearch/routes/__pycache__/querySearch_route.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/querySearch/routes/__pycache__/querySearch_route.cpython-310.pyc and b/Api/app/modules/querySearch/routes/__pycache__/querySearch_route.cpython-310.pyc differ
 
Api/app/modules/uploadDocument/controllers/__pycache__/file_upload_controller.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/uploadDocument/controllers/__pycache__/file_upload_controller.cpython-310.pyc and b/Api/app/modules/uploadDocument/controllers/__pycache__/file_upload_controller.cpython-310.pyc differ
 
Api/app/modules/uploadDocument/features/__pycache__/createEmbeddings_feature.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/uploadDocument/features/__pycache__/createEmbeddings_feature.cpython-310.pyc and b/Api/app/modules/uploadDocument/features/__pycache__/createEmbeddings_feature.cpython-310.pyc differ
 
Api/app/modules/uploadDocument/features/__pycache__/extractText_feature.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/uploadDocument/features/__pycache__/extractText_feature.cpython-310.pyc and b/Api/app/modules/uploadDocument/features/__pycache__/extractText_feature.cpython-310.pyc differ
 
Api/app/modules/uploadDocument/features/__pycache__/uploadDocument_feature.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/uploadDocument/features/__pycache__/uploadDocument_feature.cpython-310.pyc and b/Api/app/modules/uploadDocument/features/__pycache__/uploadDocument_feature.cpython-310.pyc differ
 
Api/app/modules/uploadDocument/routes/__pycache__/uploadDocument_route.cpython-310.pyc CHANGED
Binary files a/Api/app/modules/uploadDocument/routes/__pycache__/uploadDocument_route.cpython-310.pyc and b/Api/app/modules/uploadDocument/routes/__pycache__/uploadDocument_route.cpython-310.pyc differ
 
Api/app/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-17abec1bd4bca978.js"/><script src="/_next/static/chunks/fd9d1056-90960e0a7e77703c.js" async=""></script><script src="/_next/static/chunks/23-e94121395991ed2e.js" async=""></script><script src="/_next/static/chunks/main-app-f4f564f56624dcb5.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js</title><meta name="description" content="Generated by Next.js"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-17abec1bd4bca978.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[5751,[],\"\"]\n3:I[9275,[],\"\"]\n4:I[1343,[],\"\"]\na:I[6130,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[null,[\"$\",\"$L1\",null,{\"buildId\":\"8pPextYjcRlStoVtEQkF_\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Generated by Next.js\"}]]\n2:null\n"])</script></body></html>
 
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-17abec1bd4bca978.js"/><script src="/_next/static/chunks/fd9d1056-90960e0a7e77703c.js" async=""></script><script src="/_next/static/chunks/23-e94121395991ed2e.js" async=""></script><script src="/_next/static/chunks/main-app-f4f564f56624dcb5.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js</title><meta name="description" content="Generated by Next.js"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-17abec1bd4bca978.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[5751,[],\"\"]\n3:I[9275,[],\"\"]\n4:I[1343,[],\"\"]\na:I[6130,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[null,[\"$\",\"$L1\",null,{\"buildId\":\"712tZvFdh_fWSO8A2IHC_\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Generated by Next.js\"}]]\n2:null\n"])</script></body></html>
Api/app/out/_next/static/{8pPextYjcRlStoVtEQkF_ β†’ 712tZvFdh_fWSO8A2IHC_}/_buildManifest.js RENAMED
File without changes
Api/app/out/_next/static/{8pPextYjcRlStoVtEQkF_ β†’ 712tZvFdh_fWSO8A2IHC_}/_ssgManifest.js RENAMED
File without changes
Api/app/out/_next/static/chunks/app/page-10e8a35fca12752e.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8278:function(e,t,r){Promise.resolve().then(r.bind(r,9471))},9471:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return z}});var n=r(7437),o=r(8364),l=r(6031),i=r(9380),a=r(9178);let d={palette:{primary:{main:"#EDE8D0"},secondary:{main:(0,l.Fq)("#8B5A2B",.4)},border:{default:(0,l.Fq)("#000000",.23)},background:{default:(0,l.Fq)("#EDE8D0",.35),base:"#EDE8D0"}},typography:{fontFamily:" 'DM Sans', Inter,sans-serif",body1:{fontSize:"1rem",fontWeight:400,lineHeight:1.5},h1:{fontSize:"2.5rem",fontWeight:600,lineHeight:1.2},h2:{fontSize:"2rem",fontWeight:600,lineHeight:1.3},h3:{fontSize:"1.9rem",fontWeight:600,lineHeight:1.4},h4:{fontSize:"1.2rem",fontWeight:500,lineHeight:1.5},h5:{fontSize:"1rem",fontWeight:400,lineHeight:1.6},h6:{fontSize:"0.9rem",fontWeight:400,lineHeight:1.6},h7:{fontSize:"0.8rem",fontWeight:400,lineHeight:1.6}}};var s="http://localhost:8000/api",c=r(2960),u=r(5961),h=r(2265),x=r(7156),m=r(511);function f(e){let{text:t,isSender:r}=e;return(0,c.Z)(),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(u.Z,{item:!0,xs:12,container:!0,justifyContent:r?"flex-end":"flex-start",sx:{flexGrow:0},mb:1,children:(0,n.jsx)(u.Z,{item:!0,sx:{backgroundColor:r?"#d1e7dd":"#f5f5f5",padding:"8px 12px",borderRadius:"20px",maxWidth:"80%",border:"1px solid #ccc"},children:(0,n.jsx)(m.Z,{variant:"h5",children:t})})})})}function b(e){let{messages:t}=e,r=(0,c.Z)(),o=(0,h.useRef)(null);return(0,h.useEffect)(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[t]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{mb:2,display:"flex",flexDirection:"column",flexGrow:1,padding:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:r.palette.background.default},children:t.map((e,t)=>(0,n.jsx)(f,{text:e.text,isSender:e.isSender},t))})})}function g(e){let{chunkTest:t}=e,r=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:r.palette.background.default,height:"50%"},children:t?(0,n.jsx)(f,{text:t.text,isSender:!1}):null})})}function p(e){let{chunks:t,documents:r}=e,o=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,border:1,mb:2,borderColor:o.palette.border.default,borderRadius:2,padding:1.2,sx:{backgroundColor:o.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:5.5,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h6",children:["N\xba chunks: ",(0,n.jsx)("br",{})," ",t," "]})}),(0,n.jsx)(u.Z,{item:!0,ml:1,sm:5.5,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h6",children:["N\xba Doc: ",(0,n.jsx)("br",{}),r]})})]})})}var j=r(4875);function Z(){let e=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,mb:2,alignItems:"center",border:1,borderColor:e.palette.border.default,borderRadius:2,padding:2,sx:{backgroundColor:e.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:3,children:(0,n.jsx)(m.Z,{variant:"h4",children:"Select Model:"})}),(0,n.jsx)(u.Z,{item:!0,container:!0,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 1"})})}),(0,n.jsx)(u.Z,{item:!0,container:!0,ml:2,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 2"})})}),(0,n.jsx)(u.Z,{item:!0,ml:2,container:!0,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 3"})})})]})})}function C(e){let{documentName:t,documentId:r,documentNumber:o,onSelectedChunk:l}=e,i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(j.Z,{onClick:()=>l({documentNumber:o}),sx:{textTransform:"none",color:"inherit",padding:0},children:(0,n.jsxs)(u.Z,{item:!0,container:!0,alignItems:"center",xs:12,mb:1,sx:{backgroundColor:i.palette.secondary.main,padding:"8px 12px",borderRadius:"10px",border:"1px solid",borderColor:i.palette.border.default},children:[(0,n.jsx)(u.Z,{item:!0,container:!0,borderRadius:20,justifyContent:"center",alignContent:"center",border:1,sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(m.Z,{variant:"h5",children:o})}),(0,n.jsx)(u.Z,{container:!0,alignItems:"center",justifyContent:"space-between",sx:{flexGrow:1,marginLeft:1},children:(0,n.jsxs)(u.Z,{item:!0,container:!0,direction:"column",ml:1,alignItems:"flex-start",children:[(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h5",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.substring(0,8)})}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h7",color:i.palette.border.default,children:r})})]})})]})})})}function k(e){let{chunks:t,onSelectedChunk:r}=e,l=(0,o.u)();return(0,h.useEffect)(()=>{},[t]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,mb:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:l.palette.background.default,height:"60%"},children:t.map((e,t)=>(0,n.jsx)(C,{documentName:"Chunk ".concat(e.id),documentId:"Document_".concat(e.id),documentNumber:t,onSelectedChunk:r},t))})})}var w=r(7630);function y(e){let{documentName:t,documentId:r,documentNumber:o,deleteDocument:l}=e,i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{item:!0,container:!0,alignItems:"center",xs:12,mb:1,sx:{backgroundColor:i.palette.secondary.main,padding:"8px 12px",borderRadius:"10px",border:"1px solid",borderColor:i.palette.border.default},children:[(0,n.jsx)(u.Z,{item:!0,container:!0,borderRadius:20,justifyContent:"center",alignContent:"center",border:1,sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(m.Z,{variant:"h5",children:o})}),(0,n.jsxs)(u.Z,{container:!0,alignItems:"center",justifyContent:"space-between",sx:{flexGrow:1,marginLeft:1},children:[(0,n.jsxs)(u.Z,{item:!0,container:!0,direction:"column",ml:1,children:[(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h5",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.substring(0,8)})}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h7",color:i.palette.border.default,children:r})})]}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(j.Z,{onClick:()=>l(o),sx:{minWidth:"auto",padding:0,margin:0},children:(0,n.jsx)(w.Z,{fontSize:"small",sx:{color:"black"}})})})]})]})})}function v(e){let{documents:t,fetchDocuments:r,fetchChunks:l}=e,i=(0,o.u)(),a=async e=>{let t="".concat(s,"/upload/delete_document/").concat(e);await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json"}}).then(r()).then(l())};return(0,h.useEffect)(()=>{},[t]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,mb:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:i.palette.background.default,height:"40%"},children:t.map((e,t)=>(0,n.jsx)(y,{documentName:e.filename,documentId:"Document_".concat(e.id),documentNumber:e.id,deleteDocument:a},t))})})}function S(e){let{chunks:t,tokens:r}=e,o=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,border:1,borderColor:o.palette.border.default,borderRadius:2,mb:2,padding:1.2,sx:{backgroundColor:o.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:5,ml:1,p:1.2,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h5",children:["N\xba chunks: ",(0,n.jsx)("br",{})," ",t," "]})}),(0,n.jsx)(u.Z,{item:!0,ml:10,sm:5,p:1.2,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h5",children:["N\xba tokens: ",(0,n.jsx)("br",{})," ",t," "]})})]})})}var R=r(559),D=r(8410),F=r(5041);let E=async(e,t)=>{let r=new URLSearchParams;for(let e in t)r.append(e,t[e]);let n=await fetch(s+e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()});if(!n.ok){let e=await n.json(),t=Error("HTTP error");throw t.status=n.status,t.detail=e.detail||"Something went wrong",t}return n.json()};function I(e){let{fetchMessages:t}=e,[r,o]=(0,h.useState)(""),{enqueueSnackbar:l}=(0,F.Ds)(),i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,alignItems:"center",xs:12,sm:12,p:2,pl:3,border:1,borderRadius:2,borderColor:i.palette.border.default,sx:{backgroundColor:i.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,xs:12,sm:10,children:(0,n.jsx)(D.Z,{fullWidth:!0,size:"small",label:"Ask me anything",onChange:e=>{o(e.target.value)},slotProps:{input:{sx:{backgroundColor:"white",borderRadius:"4px"}}}})}),(0,n.jsx)(u.Z,{ml:4,item:!0,xs:12,border:1,borderColor:i.palette.border.default,borderRadius:20,display:"flex",justifyContent:"center",alignItems:"center",sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(j.Z,{onClick:()=>{if(!r.trim()){l("Please enter a message.",{variant:"warning"});return}E("/query/query_search",{q:r}).then(t).catch(e=>{l(e.detail||e.message,{variant:"error"})}),o("")},children:(0,n.jsx)(R.Z,{fontSize:"small",sx:{color:i.palette.border.default}})})})]})})}var T=r(1867);let _=async(e,t)=>{let r=await fetch(s+e,{method:"POST",body:t});if(!r.ok){let e=await r.json(),t=Error("HTTP error");throw t.status=r.status,t.detail=e.detail||"Something went wrong",t}return r.json()};function N(e){let{fetchDocuments:t,fetchChunks:r}=e,o=(0,c.Z)(),l=(0,h.useRef)(null);return(0,n.jsx)(u.Z,{container:!0,border:1,borderColor:o.palette.border.default,borderRadius:2,p:1,sx:{backgroundColor:o.palette.background.default},children:(0,n.jsx)(j.Z,{fullWidth:!0,sx:{textTransform:"none"},onClick:()=>{l.current.click()},children:(0,n.jsxs)(u.Z,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",border:1,borderColor:o.palette.divider,borderRadius:1,p:1,sx:{backgroundColor:"white"},children:[(0,n.jsx)("input",{type:"file",ref:l,style:{display:"none"},onChange:e=>{let n=e.target.files[0];if(!n)return;let o=new FormData;o.append("file",n),_("/upload/document",o).then(t()).then(r()).catch(e=>{(0,F.yv)(e.detail||e.message,{variant:"error"})})},accept:".pdf"}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Upload File"})}),(0,n.jsx)(T.Z,{sx:{color:"black"}})]})})})}function W(){(0,c.Z)();let[e,t]=(0,h.useState)([]),[r,o]=(0,h.useState)([]),[l,i]=(0,h.useState)([]),[a,d]=(0,h.useState)(null);console.log(l[a]);let x=async()=>{let e="".concat(s,"/query/get_messages"),r=await fetch(e);t((await r.json()).data)},m=async()=>{let e="".concat(s,"/upload/get_documents"),t=await fetch(e);o((await t.json()).data)},f=async()=>{let e="".concat(s,"/upload/get_embeddings"),t=await fetch(e),r=await t.json(),n=1;i(Object.keys(r.data).flatMap(e=>r.data[e].data.map(e=>({id:n++,text:e.metadata.original_text}))))};return(0,h.useEffect)(()=>{x(),m(),f()},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,mt:1,style:{height:"97vh"},children:[(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:5,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(Z,{}),(0,n.jsx)(b,{messages:e}),(0,n.jsx)(I,{fetchMessages:x})]}),(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:2,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(p,{chunks:2,documents:1}),(0,n.jsx)(k,{chunks:l,onSelectedChunk:e=>{if(e.documentNumber===a){d(null);return}d(e.documentNumber)}}),(0,n.jsx)(v,{documents:r,fetchDocuments:m,fetchChunks:f}),(0,n.jsx)(N,{fetchDocuments:m,fetchChunks:f})]}),(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:5,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(S,{}),(0,n.jsx)(g,{chunkTest:l[a]})]})]})})}function z(){return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o.a,{theme:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0],(0,i.Z)((0,a.Z)({...d}))}(),children:(0,n.jsx)(F.wT,{children:(0,n.jsx)(W,{})})})})}}},function(e){e.O(0,[324,971,23,744],function(){return e(e.s=8278)}),_N_E=e.O()}]);
 
 
Api/app/out/_next/static/chunks/app/page-9c40dbe969a6cf5a.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8278:function(e,r,t){Promise.resolve().then(t.bind(t,9471))},9471:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return z}});var n=t(7437),o=t(8364),l=t(6031),i=t(9380),a=t(9178);let d={palette:{primary:{main:"#EDE8D0"},secondary:{main:(0,l.Fq)("#8B5A2B",.4)},border:{default:(0,l.Fq)("#000000",.23)},background:{default:(0,l.Fq)("#EDE8D0",.35),base:"#EDE8D0"}},typography:{fontFamily:" 'DM Sans', Inter,sans-serif",body1:{fontSize:"1rem",fontWeight:400,lineHeight:1.5},h1:{fontSize:"2.5rem",fontWeight:600,lineHeight:1.2},h2:{fontSize:"2rem",fontWeight:600,lineHeight:1.3},h3:{fontSize:"1.9rem",fontWeight:600,lineHeight:1.4},h4:{fontSize:"1.2rem",fontWeight:500,lineHeight:1.5},h5:{fontSize:"1rem",fontWeight:400,lineHeight:1.6},h6:{fontSize:"0.9rem",fontWeight:400,lineHeight:1.6},h7:{fontSize:"0.8rem",fontWeight:400,lineHeight:1.6}}};var s="https://abadesalex-docurag.hf.space/api",c=t(2960),u=t(5961),h=t(2265),x=t(7156),m=t(511);function f(e){let{text:r,isSender:t}=e;return(0,c.Z)(),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(u.Z,{item:!0,xs:12,container:!0,justifyContent:t?"flex-end":"flex-start",sx:{flexGrow:0},mb:1,children:(0,n.jsx)(u.Z,{item:!0,sx:{backgroundColor:t?"#d1e7dd":"#f5f5f5",padding:"8px 12px",borderRadius:"20px",maxWidth:"80%",border:"1px solid #ccc"},children:(0,n.jsx)(m.Z,{variant:"h5",children:r})})})})}function b(e){let{messages:r}=e,t=(0,c.Z)(),o=(0,h.useRef)(null);return(0,h.useEffect)(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{mb:2,display:"flex",flexDirection:"column",flexGrow:1,padding:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:t.palette.background.default},children:r.map((e,r)=>(0,n.jsx)(f,{text:e.text,isSender:e.isSender},r))})})}function g(e){let{chunkTest:r}=e,t=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:t.palette.background.default,height:"50%"},children:r?(0,n.jsx)(f,{text:r.text,isSender:!1}):null})})}function p(e){let{chunks:r,documents:t}=e,o=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,border:1,mb:2,borderColor:o.palette.border.default,borderRadius:2,padding:1.2,sx:{backgroundColor:o.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:5.5,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h6",children:["N\xba chunks: ",(0,n.jsx)("br",{})," ",r," "]})}),(0,n.jsx)(u.Z,{item:!0,ml:1,sm:5.5,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h6",children:["N\xba Doc: ",(0,n.jsx)("br",{}),t]})})]})})}var j=t(4875);function Z(){let e=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,mb:2,alignItems:"center",border:1,borderColor:e.palette.border.default,borderRadius:2,padding:2,sx:{backgroundColor:e.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:3,children:(0,n.jsx)(m.Z,{variant:"h4",children:"Select Model:"})}),(0,n.jsx)(u.Z,{item:!0,container:!0,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 1"})})}),(0,n.jsx)(u.Z,{item:!0,container:!0,ml:2,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 2"})})}),(0,n.jsx)(u.Z,{item:!0,ml:2,container:!0,alignItems:"center",justifyContent:"center",sm:2.5,border:1,borderColor:e.palette.border.default,borderRadius:2,sx:{backgroundColor:"white"},children:(0,n.jsx)(j.Z,{children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Model 3"})})})]})})}function C(e){let{documentName:r,documentId:t,documentNumber:o,onSelectedChunk:l}=e,i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(j.Z,{onClick:()=>l({documentNumber:o}),sx:{textTransform:"none",color:"inherit",padding:0},children:(0,n.jsxs)(u.Z,{item:!0,container:!0,alignItems:"center",xs:12,mb:1,sx:{backgroundColor:i.palette.secondary.main,padding:"8px 12px",borderRadius:"10px",border:"1px solid",borderColor:i.palette.border.default},children:[(0,n.jsx)(u.Z,{item:!0,container:!0,borderRadius:20,justifyContent:"center",alignContent:"center",border:1,sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(m.Z,{variant:"h5",children:o})}),(0,n.jsx)(u.Z,{container:!0,alignItems:"center",justifyContent:"space-between",sx:{flexGrow:1,marginLeft:1},children:(0,n.jsxs)(u.Z,{item:!0,container:!0,direction:"column",ml:1,alignItems:"flex-start",children:[(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h5",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.substring(0,8)})}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h7",color:i.palette.border.default,children:t})})]})})]})})})}function k(e){let{chunks:r,onSelectedChunk:t}=e,l=(0,o.u)();return(0,h.useEffect)(()=>{},[r]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,mb:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:l.palette.background.default,height:"60%"},children:r.map((e,r)=>(0,n.jsx)(C,{documentName:"Chunk ".concat(e.id),documentId:"Document_".concat(e.id),documentNumber:r,onSelectedChunk:t},r))})})}var w=t(7630);function y(e){let{documentName:r,documentId:t,documentNumber:o,deleteDocument:l}=e,i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{item:!0,container:!0,alignItems:"center",xs:12,mb:1,sx:{backgroundColor:i.palette.secondary.main,padding:"8px 12px",borderRadius:"10px",border:"1px solid",borderColor:i.palette.border.default},children:[(0,n.jsx)(u.Z,{item:!0,container:!0,borderRadius:20,justifyContent:"center",alignContent:"center",border:1,sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(m.Z,{variant:"h5",children:o})}),(0,n.jsxs)(u.Z,{container:!0,alignItems:"center",justifyContent:"space-between",sx:{flexGrow:1,marginLeft:1},children:[(0,n.jsxs)(u.Z,{item:!0,container:!0,direction:"column",ml:1,children:[(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h5",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.substring(0,8)})}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h7",color:i.palette.border.default,children:t})})]}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(j.Z,{onClick:()=>l(o),sx:{minWidth:"auto",padding:0,margin:0},children:(0,n.jsx)(w.Z,{fontSize:"small",sx:{color:"black"}})})})]})]})})}function v(e){let{documents:r,fetchDocuments:t,fetchChunks:l}=e,i=(0,o.u)(),a=async e=>{let r="".concat(s,"/upload/delete_document/").concat(e);await fetch(r,{method:"DELETE",headers:{"Content-Type":"application/json"}}).then(t()).then(l())};return(0,h.useEffect)(()=>{},[r]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(x.Z,{display:"flex",flexDirection:"column",flexGrow:1,padding:2,mb:2,style:{border:"2px solid black",overflow:"hidden",overflowY:"scroll",borderRadius:"8px",border:"1px solid #ccc",backgroundColor:i.palette.background.default,height:"40%"},children:r.map((e,r)=>(0,n.jsx)(y,{documentName:e.filename,documentId:"Document_".concat(e.id),documentNumber:e.id,deleteDocument:a},r))})})}function S(e){let{chunks:r,tokens:t}=e,o=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,border:1,borderColor:o.palette.border.default,borderRadius:2,mb:2,padding:1.2,sx:{backgroundColor:o.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,sm:5,ml:1,p:1.2,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h5",children:["N\xba chunks: ",(0,n.jsx)("br",{})," ",r," "]})}),(0,n.jsx)(u.Z,{item:!0,ml:10,sm:5,p:1.2,border:1,borderColor:o.palette.border.default,borderRadius:2,alignContent:"center",textAlign:"center",sx:{backgroundColor:"white"},children:(0,n.jsxs)(m.Z,{variant:"h5",children:["N\xba tokens: ",(0,n.jsx)("br",{})," ",r," "]})})]})})}var R=t(559),D=t(8410),F=t(5041);let E=async(e,r)=>{let t=new URLSearchParams;for(let e in r)t.append(e,r[e]);let n=await fetch(s+e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.toString()});if(!n.ok){let e=await n.json(),r=Error("HTTP error");throw r.status=n.status,r.detail=e.detail||"Something went wrong",r}return n.json()};function I(e){let{fetchMessages:r}=e,[t,o]=(0,h.useState)(""),{enqueueSnackbar:l}=(0,F.Ds)(),i=(0,c.Z)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,alignItems:"center",xs:12,sm:12,p:2,pl:3,border:1,borderRadius:2,borderColor:i.palette.border.default,sx:{backgroundColor:i.palette.background.default},children:[(0,n.jsx)(u.Z,{item:!0,xs:12,sm:10,children:(0,n.jsx)(D.Z,{fullWidth:!0,size:"small",label:"Ask me anything",onChange:e=>{o(e.target.value)},slotProps:{input:{sx:{backgroundColor:"white",borderRadius:"4px"}}}})}),(0,n.jsx)(u.Z,{ml:4,item:!0,xs:12,border:1,borderColor:i.palette.border.default,borderRadius:20,display:"flex",justifyContent:"center",alignItems:"center",sx:{backgroundColor:i.palette.secondary.main,width:35,height:35},children:(0,n.jsx)(j.Z,{onClick:()=>{if(!t.trim()){l("Please enter a message.",{variant:"warning"});return}E("/query/query_search",{q:t}).then(r).catch(e=>{l(e.detail||e.message,{variant:"error"})}),o("")},children:(0,n.jsx)(R.Z,{fontSize:"small",sx:{color:i.palette.border.default}})})})]})})}var T=t(1867);let _=async(e,r)=>{let t=await fetch(s+e,{method:"POST",body:r});if(!t.ok){let e=await t.json(),r=Error("HTTP error");throw r.status=t.status,r.detail=e.detail||"Something went wrong",r}return t.json()};function N(e){let{fetchDocuments:r,fetchChunks:t}=e,o=(0,c.Z)(),l=(0,h.useRef)(null);return(0,n.jsx)(u.Z,{container:!0,border:1,borderColor:o.palette.border.default,borderRadius:2,p:1,sx:{backgroundColor:o.palette.background.default},children:(0,n.jsx)(j.Z,{fullWidth:!0,sx:{textTransform:"none"},onClick:()=>{l.current.click()},children:(0,n.jsxs)(u.Z,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",border:1,borderColor:o.palette.divider,borderRadius:1,p:1,sx:{backgroundColor:"white"},children:[(0,n.jsx)("input",{type:"file",ref:l,style:{display:"none"},onChange:e=>{let n=e.target.files[0];if(!n)return;let o=new FormData;o.append("file",n),_("/upload/document",o).then(r()).then(t()).catch(e=>{(0,F.yv)(e.detail||e.message,{variant:"error"})})},accept:".pdf"}),(0,n.jsx)(u.Z,{item:!0,children:(0,n.jsx)(m.Z,{variant:"h6",color:"black",children:"Upload File"})}),(0,n.jsx)(T.Z,{sx:{color:"black"}})]})})})}function W(){(0,c.Z)();let[e,r]=(0,h.useState)([]),[t,o]=(0,h.useState)([]),[l,i]=(0,h.useState)([]),[a,d]=(0,h.useState)(null);console.log(l[a]);let x=async()=>{let e="".concat(s,"/query/get_messages"),t=await fetch(e);r((await t.json()).data)},m=async()=>{let e="".concat(s,"/upload/get_documents"),r=await fetch(e);o((await r.json()).data)},f=async()=>{let e="".concat(s,"/upload/get_embeddings"),r=await fetch(e),t=await r.json(),n=1;i(Object.keys(t.data).flatMap(e=>t.data[e].data.map(e=>({id:n++,text:e.metadata.original_text}))))};return(0,h.useEffect)(()=>{x(),m(),f()},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(u.Z,{container:!0,mt:1,style:{height:"97vh"},children:[(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:5,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(Z,{}),(0,n.jsx)(b,{messages:e}),(0,n.jsx)(I,{fetchMessages:x})]}),(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:2,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(p,{chunks:2,documents:1}),(0,n.jsx)(k,{chunks:l,onSelectedChunk:e=>{if(e.documentNumber===a){d(null);return}d(e.documentNumber)}}),(0,n.jsx)(v,{documents:t,fetchDocuments:m,fetchChunks:f}),(0,n.jsx)(N,{fetchDocuments:m,fetchChunks:f})]}),(0,n.jsxs)(u.Z,{item:!0,xs:12,sm:5,p:1,style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsx)(S,{}),(0,n.jsx)(g,{chunkTest:l[a]})]})]})})}function z(){return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o.a,{theme:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0],(0,i.Z)((0,a.Z)({...d}))}(),children:(0,n.jsx)(F.wT,{children:(0,n.jsx)(W,{})})})})}}},function(e){e.O(0,[324,971,23,744],function(){return e(e.s=8278)}),_N_E=e.O()}]);
Api/app/out/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
Api/app/out/index.txt CHANGED
@@ -1,7 +1,7 @@
1
  2:I[6513,[],"ClientPageRoot"]
2
- 3:I[9471,["324","static/chunks/324-5c86793bec652c55.js","931","static/chunks/app/page-10e8a35fca12752e.js"],"default"]
3
  4:I[9275,[],""]
4
  5:I[1343,[],""]
5
- 0:["8pPextYjcRlStoVtEQkF_",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},[["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null],null],[null,[null,"$L6"]]]]]
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Next.js"}],["$","meta","3",{"name":"description","content":"Generated by Next.js"}]]
7
  1:null
 
1
  2:I[6513,[],"ClientPageRoot"]
2
+ 3:I[9471,["324","static/chunks/324-5c86793bec652c55.js","931","static/chunks/app/page-9c40dbe969a6cf5a.js"],"default"]
3
  4:I[9275,[],""]
4
  5:I[1343,[],""]
5
+ 0:["712tZvFdh_fWSO8A2IHC_",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},[["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null],null],[null,[null,"$L6"]]]]]
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Next.js"}],["$","meta","3",{"name":"description","content":"Generated by Next.js"}]]
7
  1:null
App/my-app/src/services/api/api.config.js CHANGED
@@ -1,4 +1,4 @@
1
- const baseUrl = "http://localhost:8000/api";
2
- // const baseUrl = "https://abadesalex-docurag.hf.space/api";
3
 
4
  export default baseUrl;
 
1
+ // const baseUrl = "http://localhost:8000/api";
2
+ const baseUrl = "https://abadesalex-docurag.hf.space/api";
3
 
4
  export default baseUrl;
Dockerfile CHANGED
@@ -31,4 +31,4 @@ COPY --chown=user ./Api/app /home/user/app/app
31
  EXPOSE 8000
32
 
33
  # Command to run the application
34
- CMD ["uvicorn", "app.api:app", "--host", "0.0.0.0", "--port", "8000"]
 
31
  EXPOSE 8000
32
 
33
  # Command to run the application
34
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]