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GACN,SAAUyC,EAAA,CACd,EAEA9J,MAAC,MAAG,SAA6B,kCAEjCA,EAAA,IAAC6K,GAAA,CACG,UAAW9K,EAAO,sBAClB,MAAM,oCACN,IAAK,EACL,IAAK,GACL,aAAcoH,EAAc,SAAS,EACrC,SAAU0C,EAAA,CACd,QAECxD,GAAe,qBAAsBE,GAAiCC,EAAiBD,CAAa,EAAG,EAExGvG,MAAC,MAAG,SAAmC,wCAEvCA,EAAA,IAAC4D,GAAA,CACG,UAAW7D,EAAO,sBAClB,aAAcgH,EACd,MAAM,2BACN,UAAS,GACT,iBAAgB,GAChB,SAAU0C,EAAA,CACd,EAEAzJ,EAAA,IAAC8K,GAAA,CACG,UAAW/K,EAAO,sBAClB,MAAM,cACN,IAAK,EACL,IAAK,EACL,KAAM,GACN,aAAckH,EACd,SAAUyC,GACV,UAAS,GACT,WAAU,GACd,EAEA1J,EAAA,IAAC4K,GAAA,CACG,UAAW7K,EAAO,sBAClB,QAASwH,EACT,MAAM,mCACN,SAAUyC,EAAA,CACd,GACJ,GACJ,CACJ,GAER,EClVA,IAAIe,SAAUlL,GAAO,IAErBmL,KAEA,MAAMC,GAASC,GAAiB,CAC5B,CACI,KAAM,IACN,QAASH,GACT,SAAU,CACN,CACI,MAAO,GACP,cAAUnE,GAAK,GACnB,EACA,CACI,KAAM,IACN,KAAM,IAAMuE,GAAA,WAAO,sBAAgB,4DACvC,CACJ,CACJ,CACJ,CAAC,EAEDC,GAAS,WAAW,SAAS,eAAe,MAAM,CAAgB,EAAE,aAC/DC,GAAM,WAAN,CACG,SAACrL,EAAA,IAAAsL,GAAA,CAAe,OAAAL,EAAgB,GACpC,CACJ","names":["Layout","jsxs","styles","jsx","Link","Outlet","RetrievalMode","parseAnswerToHtml","answer","isStreaming","onCitationClicked","citations","parsedAnswer","lastIndex","i","part","index","citationIndex","renderToStaticMarkup","AnswerIcon","Sparkle28Filled","Answer","isSelected","onThoughtProcessClicked","onSupportingContentClicked","onFollowupQuestionClicked","showFollowupQuestions","followupQuestions","messageContent","useMemo","sanitizedAnswerHtml","DOMPurify","Stack","IconButton","rowId","ind","citation","x","AnswerLoading","animatedStyles","useSpring","animated","AnswerError","error","onRetry","ErrorCircle24Regular","PrimaryButton","QuestionInput","onSend","disabled","placeholder","clearOnSend","initQuestion","question","setQuestion","useState","useEffect","sendQuestion","onEnterPress","ev","onQuestionChange","_ev","newValue","TextField","Tooltip","Button","Send28Filled","Example","text","value","onClick","DEFAULT_EXAMPLES","ExampleList","onExampleClicked","UserChatMessage","message","AnalysisPanelTabs","SyntaxHighlighter","json","ThoughtProcess","thoughts","t","k","a11yLight","pivotItemDisabledStyle","AnalysisPanel","activeTab","activeCitation","citationHeight","className","onActiveTabChanged","isDisabledThoughtProcessTab","setCitation","fetchCitation","originalHash","citationContent","citationObjectUrl","Pivot","pivotItem","PivotItem","SettingsButton","Settings24Regular","ClearChatButton","Delete24Regular","VectorSettings","updateRetrievalMode","retrievalMode","setRetrievalMode","onRetrievalModeChange","option","Dropdown","Chat","isConfigPanelOpen","setIsConfigPanelOpen","promptTemplate","setPromptTemplate","temperature","setTemperature","retrieveCount","setRetrieveCount","useAdvancedFlow","setUseAdvancedFlow","shouldStream","setShouldStream","lastQuestionRef","useRef","chatMessageStreamEnd","isLoading","setIsLoading","setIsStreaming","setError","setActiveCitation","activeAnalysisPanelTab","setActiveAnalysisPanelTab","selectedAnswer","setSelectedAnswer","answers","setAnswers","streamedAnswers","setStreamedAnswers","handleAsyncRequest","result","chatCompletion","updateState","newContent","resolve","latestCompletion","response","makeApiRequest","allMessages","options","chatClient","AIChatProtocolClient","parsedResponse","e","clearChat","onPromptTemplateChange","onTemperatureChange","range","event","onRetrieveCountChange","onUseAdvancedFlowChange","checked","onShouldStreamChange","example","onShowCitation","onToggleTab","tab","streamedAnswer","c","q","Fragment","SparkleFilled","Panel","DefaultButton","Checkbox","SpinButton","Slider","layout","initializeIcons","router","createHashRouter","__vitePreload","ReactDOM","React","RouterProvider"],"sources":["../../../frontend/src/pages/layout/Layout.tsx","../../../frontend/src/api/models.ts","../../../frontend/src/components/Answer/AnswerParser.tsx","../../../frontend/src/components/Answer/AnswerIcon.tsx","../../../frontend/src/components/Answer/Answer.tsx","../../../frontend/src/components/Answer/AnswerLoading.tsx","../../../frontend/src/components/Answer/AnswerError.tsx","../../../frontend/src/components/QuestionInput/QuestionInput.tsx","../../../frontend/src/components/Example/Example.tsx","../../../frontend/src/components/Example/ExampleList.tsx","../../../frontend/src/components/UserChatMessage/UserChatMessage.tsx","../../../frontend/src/components/AnalysisPanel/AnalysisPanelTabs.tsx","../../../frontend/src/components/AnalysisPanel/ThoughtProcess.tsx","../../../frontend/src/components/AnalysisPanel/AnalysisPanel.tsx","../../../frontend/src/components/SettingsButton/SettingsButton.tsx","../../../frontend/src/components/ClearChatButton/ClearChatButton.tsx","../../../frontend/src/components/VectorSettings/VectorSettings.tsx","../../../frontend/src/pages/chat/Chat.tsx","../../../frontend/src/index.tsx"],"sourcesContent":["import { Outlet, Link } from \"react-router-dom\";\n\nimport styles from \"./Layout.module.css\";\n\n\nconst Layout = () => {\n return (\n
\n
\n
\n \n

RAG on Neon Serverless Postgres Database

\n \n

OpenAI + Neon

\n
\n
\n\n \n
\n );\n};\n\nexport default Layout;\n","import { AIChatCompletion, AIChatCompletionDelta, AIChatCompletionOperationOptions } from \"@microsoft/ai-chat-protocol\";\n\nexport const enum RetrievalMode {\n Hybrid = \"hybrid\",\n Vectors = \"vectors\",\n Text = \"text\"\n}\n\nexport type ChatAppRequestOverrides = {\n use_advanced_flow?: boolean;\n retrieval_mode?: RetrievalMode;\n top?: number;\n temperature?: number;\n prompt_template?: string;\n};\n\nexport type ChatAppRequestContext = {\n overrides: ChatAppRequestOverrides;\n};\n\nexport interface ChatAppRequestOptions extends AIChatCompletionOperationOptions {\n context: ChatAppRequestContext\n}\n\nexport type Thoughts = {\n title: string;\n description: any; // It can be any output from the api\n props?: { [key: string]: string };\n};\n\nexport type RAGContext = {\n data_points: { [key: string]: any };\n followup_questions: string[] | null;\n thoughts: Thoughts[];\n};\n\nexport interface RAGChatCompletion extends AIChatCompletion {\n context: RAGContext;\n}\n\nexport interface RAGChatCompletionDelta extends AIChatCompletionDelta {\n context: RAGContext;\n}\n","import { renderToStaticMarkup } from \"react-dom/server\";\n\ntype HtmlParsedAnswer = {\n answerHtml: string;\n citations: string[];\n};\n\nexport function parseAnswerToHtml(answer: string, isStreaming: boolean, onCitationClicked: (citationFilePath: string) => void): HtmlParsedAnswer {\n const citations: string[] = [];\n\n // trim any whitespace from the end of the answer after removing follow-up questions\n let parsedAnswer = answer.trim();\n\n // Omit a citation that is still being typed during streaming\n if (isStreaming) {\n let lastIndex = parsedAnswer.length;\n for (let i = parsedAnswer.length - 1; i >= 0; i--) {\n if (parsedAnswer[i] === \"]\") {\n break;\n } else if (parsedAnswer[i] === \"[\") {\n lastIndex = i;\n break;\n }\n }\n const truncatedAnswer = parsedAnswer.substring(0, lastIndex);\n parsedAnswer = truncatedAnswer;\n }\n\n const parts = parsedAnswer.split(/\\[([^\\]]+)\\]/g);\n\n const fragments: string[] = parts.map((part, index) => {\n if (index % 2 === 0) {\n return part;\n } else {\n let citationIndex: number;\n if (citations.indexOf(part) !== -1) {\n citationIndex = citations.indexOf(part) + 1;\n } else {\n citations.push(part);\n citationIndex = citations.length;\n }\n\n return renderToStaticMarkup(\n \n {citationIndex}\n \n );\n }\n });\n\n return {\n answerHtml: fragments.join(\"\"),\n citations\n };\n}\n","import { Sparkle28Filled } from \"@fluentui/react-icons\";\n\nexport const AnswerIcon = () => {\n return ;\n};\n","import { useMemo } from \"react\";\nimport { Stack, IconButton } from \"@fluentui/react\";\nimport DOMPurify from \"dompurify\";\n\nimport styles from \"./Answer.module.css\";\n\nimport { RAGChatCompletion } from \"../../api/models\";\nimport { parseAnswerToHtml } from \"./AnswerParser\";\nimport { AnswerIcon } from \"./AnswerIcon\";\n\ninterface Props {\n answer: RAGChatCompletion;\n isSelected?: boolean;\n isStreaming: boolean;\n onCitationClicked: (filePath: string) => void;\n onThoughtProcessClicked: () => void;\n onSupportingContentClicked: () => void;\n onFollowupQuestionClicked?: (question: string) => void;\n showFollowupQuestions?: boolean;\n}\n\nexport const Answer = ({\n answer,\n isSelected,\n isStreaming,\n onCitationClicked,\n onThoughtProcessClicked,\n onSupportingContentClicked,\n onFollowupQuestionClicked,\n showFollowupQuestions\n}: Props) => {\n const followupQuestions = answer.context.followup_questions;\n const messageContent = answer.message.content;\n const parsedAnswer = useMemo(() => parseAnswerToHtml(messageContent, isStreaming, onCitationClicked), [answer]);\n\n const sanitizedAnswerHtml = DOMPurify.sanitize(parsedAnswer.answerHtml);\n\n return (\n \n \n \n \n
\n onThoughtProcessClicked()}\n disabled={!answer.context.thoughts?.length}\n />\n
\n
\n
\n\n \n
\n
\n\n {!!parsedAnswer.citations.length && (\n \n \n References:\n
    \n {parsedAnswer.citations.map((rowId, ind) => {\n const citation = answer.context.data_points[rowId];\n if (!citation) return null;\n return (\n
  1. \n

    {citation.name}

    \n

    Brand: {citation.brand}

    \n

    Price: {citation.price}

    \n

    {citation.description}

    \n
  2. \n );\n })}\n
\n
\n
\n )}\n\n {!!followupQuestions?.length && showFollowupQuestions && onFollowupQuestionClicked && (\n \n \n Follow-up questions:\n {followupQuestions.map((x, i) => {\n return (\n onFollowupQuestionClicked(x)}>\n {`${x}`}\n \n );\n })}\n \n \n )}\n
\n );\n};\n","import { Stack } from \"@fluentui/react\";\nimport { animated, useSpring } from \"@react-spring/web\";\n\nimport styles from \"./Answer.module.css\";\nimport { AnswerIcon } from \"./AnswerIcon\";\n\nexport const AnswerLoading = () => {\n const animatedStyles = useSpring({\n from: { opacity: 0 },\n to: { opacity: 1 }\n });\n\n return (\n \n \n \n \n

\n Generating answer\n \n

\n
\n
\n
\n );\n};\n","import { Stack, PrimaryButton } from \"@fluentui/react\";\nimport { ErrorCircle24Regular } from \"@fluentui/react-icons\";\n\nimport styles from \"./Answer.module.css\";\n\ninterface Props {\n error: string;\n onRetry: () => void;\n}\n\nexport const AnswerError = ({ error, onRetry }: Props) => {\n return (\n \n \n\n \n

{error}

\n
\n\n \n
\n );\n};\n","import { useEffect, useState } from \"react\";\nimport { Stack, TextField } from \"@fluentui/react\";\nimport { Button, Tooltip } from \"@fluentui/react-components\";\nimport { Send28Filled } from \"@fluentui/react-icons\";\n\nimport styles from \"./QuestionInput.module.css\";\n\ninterface Props {\n onSend: (question: string) => void;\n disabled: boolean;\n initQuestion?: string;\n placeholder?: string;\n clearOnSend?: boolean;\n}\n\nexport const QuestionInput = ({ onSend, disabled, placeholder, clearOnSend, initQuestion }: Props) => {\n const [question, setQuestion] = useState(\"\");\n\n useEffect(() => {\n initQuestion && setQuestion(initQuestion);\n }, [initQuestion]);\n\n const sendQuestion = () => {\n if (disabled || !question.trim()) {\n return;\n }\n\n onSend(question);\n\n if (clearOnSend) {\n setQuestion(\"\");\n }\n };\n\n const onEnterPress = (ev: React.KeyboardEvent) => {\n if (ev.key === \"Enter\" && !ev.shiftKey) {\n ev.preventDefault();\n sendQuestion();\n }\n };\n\n const onQuestionChange = (_ev: React.FormEvent, newValue?: string) => {\n if (!newValue) {\n setQuestion(\"\");\n } else if (newValue.length <= 1000) {\n setQuestion(newValue);\n }\n };\n\n return (\n \n \n
\n \n
\n
\n );\n};\n","import styles from \"./Example.module.css\";\n\ninterface Props {\n text: string;\n value: string;\n onClick: (value: string) => void;\n}\n\nexport const Example = ({ text, value, onClick }: Props) => {\n return (\n
onClick(value)}>\n

{text}

\n
\n );\n};\n","import { Example } from \"./Example\";\n\nimport styles from \"./Example.module.css\";\n\nconst DEFAULT_EXAMPLES: string[] = [\n \"Best shoe for hiking?\",\n \"Climbing gear cheaper than $30?\",\n \"Waterproof camping gear?\",\n];\n\ninterface Props {\n onExampleClicked: (value: string) => void\n}\n\nexport const ExampleList = ({ onExampleClicked }: Props) => {\n return (\n
    \n {DEFAULT_EXAMPLES.map((question, i) => (\n
  • \n \n
  • \n ))}\n
\n );\n};\n","import styles from \"./UserChatMessage.module.css\";\n\ninterface Props {\n message: string;\n}\n\nexport const UserChatMessage = ({ message }: Props) => {\n return (\n
\n
{message}
\n
\n );\n};\n","export enum AnalysisPanelTabs {\n ThoughtProcessTab = \"thoughtProcess\",\n SupportingContentTab = \"supportingContent\",\n CitationTab = \"citation\"\n}\n","import { Stack } from \"@fluentui/react\";\nimport { Light as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport json from \"react-syntax-highlighter/dist/esm/languages/hljs/json\";\nimport { a11yLight } from \"react-syntax-highlighter/dist/esm/styles/hljs\";\n\nimport styles from \"./AnalysisPanel.module.css\";\n\nimport { Thoughts } from \"../../api\";\n\nSyntaxHighlighter.registerLanguage(\"json\", json);\n\ninterface Props {\n thoughts: Thoughts[];\n}\n\nexport const ThoughtProcess = ({ thoughts }: Props) => {\n return (\n
    \n {thoughts.map((t, ind) => {\n return (\n
  • \n
    {t.title}
    \n \n {t.props &&\n (Object.keys(t.props) || []).map((k: any) => (\n \n {k}: {JSON.stringify(t.props?.[k])}\n \n ))}\n \n {Array.isArray(t.description) ? (\n \n {JSON.stringify(t.description, null, 2)}\n \n ) : (\n
    {t.description}
    \n )}\n
  • \n );\n })}\n
\n );\n};\n","import { Stack, Pivot, PivotItem } from \"@fluentui/react\";\n\nimport styles from \"./AnalysisPanel.module.css\";\n\nimport { SupportingContent } from \"../SupportingContent\";\nimport { RAGChatCompletion } from \"../../api\";\nimport { AnalysisPanelTabs } from \"./AnalysisPanelTabs\";\nimport { ThoughtProcess } from \"./ThoughtProcess\";\nimport { MarkdownViewer } from \"../MarkdownViewer\";\nimport { useState, useEffect } from \"react\";\n\ninterface Props {\n className: string;\n activeTab: AnalysisPanelTabs;\n onActiveTabChanged: (tab: AnalysisPanelTabs) => void;\n activeCitation: string | undefined;\n citationHeight: string;\n answer: RAGChatCompletion;\n}\n\nconst pivotItemDisabledStyle = { disabled: true, style: { color: \"grey\" } };\n\nexport const AnalysisPanel = ({ answer, activeTab, activeCitation, citationHeight, className, onActiveTabChanged }: Props) => {\n const isDisabledThoughtProcessTab: boolean = !answer.context.thoughts;\n const isDisabledSupportingContentTab: boolean = !answer.context.data_points;\n const isDisabledCitationTab: boolean = !activeCitation;\n const [citation, setCitation] = useState(\"\");\n\n\n const fetchCitation = async () => {\n if (activeCitation) {\n // Get hash from the URL as it may contain #page=N\n // which helps browser PDF renderer jump to correct page N\n const originalHash = activeCitation.indexOf(\"#\") ? activeCitation.split(\"#\")[1] : \"\";\n const response = await fetch(activeCitation, {\n method: \"GET\"\n });\n const citationContent = await response.blob();\n let citationObjectUrl = URL.createObjectURL(citationContent);\n // Add hash back to the new blob URL\n if (originalHash) {\n citationObjectUrl += \"#\" + originalHash;\n }\n setCitation(citationObjectUrl);\n }\n };\n useEffect(() => {\n fetchCitation();\n }, []);\n\n const renderFileViewer = () => {\n if (!activeCitation) {\n return null;\n }\n\n const fileExtension = activeCitation.split(\".\").pop()?.toLowerCase();\n switch (fileExtension) {\n case \"png\":\n return \"Citation;\n case \"md\":\n return ;\n default:\n return