diff --git a/app/backend/app.py b/app/backend/app.py index dba27f3e..114186a6 100644 --- a/app/backend/app.py +++ b/app/backend/app.py @@ -6,6 +6,7 @@ import os from pathlib import Path from typing import Any, AsyncGenerator, Dict, Union, cast +from dotenv import load_dotenv from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential @@ -63,6 +64,8 @@ mimetypes.add_type("application/javascript", ".js") mimetypes.add_type("text/css", ".css") +load_dotenv() + @bp.route("/") async def index(): diff --git a/app/backend/requirements.txt b/app/backend/requirements.txt index 9274b786..a8618ac2 100644 --- a/app/backend/requirements.txt +++ b/app/backend/requirements.txt @@ -281,6 +281,8 @@ pydantic-core==2.16.2 pyjwt[crypto]==2.8.0 # via msal python-dateutil==2.8.2 + +python-dotenv # via pandas python-jose[cryptography]==3.3.0 # via -r requirements.in diff --git a/app/backend/static/assets/Ask-3c4f5122.js b/app/backend/static/assets/Ask-2a9371aa.js similarity index 97% rename from app/backend/static/assets/Ask-3c4f5122.js rename to app/backend/static/assets/Ask-2a9371aa.js index f6335c03..7abe456a 100644 --- a/app/backend/static/assets/Ask-3c4f5122.js +++ b/app/backend/static/assets/Ask-2a9371aa.js @@ -1,2 +1,2 @@ -import{r as s,bE as fe,bF as t}from"./vendor-3b0eb66e.js";import{R as Q,G as be,V as L,u as d,S as ye,Q as Ae,E as Pe,A as je,a as m,b as we,c as Ve,d as Oe,e as Re,r as S,i as D,T as Ne,g as M,f as Ie,h as Ge}from"./index-cf2ac81c.js";import{p as Ee,m as Ue,D as Be,T as q,n as Fe,o as Qe,l as g}from"./fluentui-react-cc049b91.js";import"./fluentui-icons-cc979dd7.js";const Le="_askContainer_1vvbs_1",De="_askTopSection_1vvbs_8",Me="_askBottomSection_1vvbs_15",qe="_askTitle_1vvbs_25",He="_askQuestionInput_1vvbs_39",ze="_askAnswerContainer_1vvbs_46",Je="_askAnalysisPanel_1vvbs_53",Ke="_askSettingsSeparator_1vvbs_58",We="_settingsButton_1vvbs_62",n={askContainer:Le,askTopSection:De,askBottomSection:Me,askTitle:qe,askQuestionInput:He,askAnswerContainer:ze,askAnalysisPanel:Je,askSettingsSeparator:Ke,settingsButton:We};function Xe(){const[f,v]=s.useState(!1),[k,H]=s.useState(""),[b,Ye]=s.useState(""),[y,Ze]=s.useState(""),[A,z]=s.useState(.3),[J,P]=s.useState(Q.Hybrid),[j,K]=s.useState(3),[h,w]=s.useState(!0),[V,W]=s.useState(!1),[l,X]=s.useState(!1),[O,Y]=s.useState(be.TextAndImages),[R,Z]=s.useState(""),[$,ee]=s.useState(""),[te,se]=s.useState([L.Embedding,L.ImageEmbedding]),[N,ae]=s.useState(!1),[I,ne]=s.useState(!1),[G,oe]=s.useState(!1),[ie,re]=s.useState(!1),[le,ce]=s.useState(!1),C=s.useRef(""),[x,E]=s.useState(!1),[c,U]=s.useState(),[o,ue]=s.useState(),[B,F]=s.useState(),[u,r]=s.useState(void 0),i=d?fe().instance:void 0,pe=async()=>{const e=i?await M(i):void 0;Ie(e).then(a=>{oe(a.showGPT4VOptions),w(a.showSemanticRankerOption),re(a.showSemanticRankerOption),ce(a.showVectorOption),a.showVectorOption||P(Q.Text)})};s.useEffect(()=>{pe()},[]);const _=async e=>{C.current=e,c&&U(void 0),E(!0),F(void 0),r(void 0);const a=i?await M(i):void 0;try{const p={messages:[{content:e,role:"user"}],context:{overrides:{prompt_template:k.length===0?void 0:k,prompt_template_prefix:b.length===0?void 0:b,prompt_template_suffix:y.length===0?void 0:y,exclude_category:R.length===0?void 0:R,top:j,temperature:A,retrieval_mode:J,semantic_ranker:h,semantic_captions:V,use_oid_security_filter:N,use_groups_security_filter:I,vector_fields:te,use_gpt4v:l,gpt4v_input:O}},session_state:o?o.choices[0].session_state:null},Te=await Ge(p,a);ue(Te)}catch(p){U(p)}finally{E(!1)}},de=(e,a)=>{H(a||"")},me=(e,a,p)=>{z(e)},Se=(e,a)=>{K(parseInt(a||"3"))},ge=(e,a)=>{w(!!a)},ve=(e,a)=>{W(!!a)},ke=(e,a)=>{Z(a||"")},he=e=>{_(e),ee(e)},Ce=e=>{B===e&&u===m.CitationTab?r(void 0):(F(e),r(m.CitationTab))},T=e=>{r(u===e?void 0:e)},xe=(e,a)=>{ae(!!a)},_e=(e,a)=>{ne(!!a)};return t.jsxs("div",{className:n.askContainer,children:[t.jsxs("div",{className:n.askTopSection,children:[t.jsx(ye,{className:n.settingsButton,onClick:()=>v(!f)}),t.jsx("h1",{className:n.askTitle,children:"Ask your data"}),t.jsx("div",{className:n.askQuestionInput,children:t.jsx(Ae,{placeholder:"Example: Does my plan cover annual eye exams?",disabled:x,initQuestion:$,onSend:e=>_(e)})})]}),t.jsxs("div",{className:n.askBottomSection,children:[x&&t.jsx(Ee,{label:"Generating answer"}),!C.current&&t.jsx(Pe,{onExampleClicked:he,useGPT4V:l}),!x&&o&&!c&&t.jsx("div",{className:n.askAnswerContainer,children:t.jsx(je,{answer:o,isStreaming:!1,onCitationClicked:e=>Ce(e),onThoughtProcessClicked:()=>T(m.ThoughtProcessTab),onSupportingContentClicked:()=>T(m.SupportingContentTab)})}),c?t.jsx("div",{className:n.askAnswerContainer,children:t.jsx(we,{error:c.toString(),onRetry:()=>_(C.current)})}):null,u&&o&&t.jsx(Ve,{className:n.askAnalysisPanel,activeCitation:B,onActiveTabChanged:e=>T(e),citationHeight:"600px",answer:o,activeTab:u})]}),t.jsxs(Ue,{headerText:"Configure answer generation",isOpen:f,isBlocking:!1,onDismiss:()=>v(!1),closeButtonAriaLabel:"Close",onRenderFooterContent:()=>t.jsx(Be,{onClick:()=>v(!1),children:"Close"}),isFooterAtBottom:!0,children:[t.jsx(q,{className:n.askSettingsSeparator,defaultValue:k,label:"Override prompt template",multiline:!0,autoAdjustHeight:!0,onChange:de}),t.jsx(Fe,{className:n.chatSettingsSeparator,label:"Temperature",min:0,max:1,step:.1,defaultValue:A,onChange:me,showValue:!0,snapToStep:!0}),t.jsx(Qe,{className:n.askSettingsSeparator,label:"Retrieve this many search results:",min:1,max:50,defaultValue:j.toString(),onChange:Se}),t.jsx(q,{className:n.askSettingsSeparator,label:"Exclude category",onChange:ke}),ie&&t.jsx(g,{className:n.askSettingsSeparator,checked:h,label:"Use semantic ranker for retrieval",onChange:ge}),t.jsx(g,{className:n.askSettingsSeparator,checked:V,label:"Use query-contextual summaries instead of whole documents",onChange:ve,disabled:!h}),G&&t.jsx(Oe,{gpt4vInputs:O,isUseGPT4V:l,updateUseGPT4V:e=>{X(e)},updateGPT4VInputs:e=>Y(e)}),le&&t.jsx(Re,{showImageOptions:l&&G,updateVectorFields:e=>se(e),updateRetrievalMode:e=>P(e)}),d&&t.jsx(g,{className:n.askSettingsSeparator,checked:N||S,label:"Use oid security filter",disabled:!D(i)||S,onChange:xe}),d&&t.jsx(g,{className:n.askSettingsSeparator,checked:I||S,label:"Use groups security filter",disabled:!D(i)||S,onChange:_e}),d&&t.jsx(Ne,{})]})]})}Xe.displayName="Ask";export{Xe as Component}; -//# sourceMappingURL=Ask-3c4f5122.js.map +import{r as s,bE as fe,bF as t}from"./vendor-3b0eb66e.js";import{R as Q,G as be,V as L,u as d,S as ye,Q as Ae,E as Pe,A as je,a as m,b as we,c as Ve,d as Oe,e as Re,r as S,i as D,T as Ne,g as M,f as Ie,h as Ge}from"./index-9a71f1dd.js";import{p as Ee,m as Ue,D as Be,T as q,n as Fe,o as Qe,l as g}from"./fluentui-react-cc049b91.js";import"./fluentui-icons-cc979dd7.js";const Le="_askContainer_1vvbs_1",De="_askTopSection_1vvbs_8",Me="_askBottomSection_1vvbs_15",qe="_askTitle_1vvbs_25",He="_askQuestionInput_1vvbs_39",ze="_askAnswerContainer_1vvbs_46",Je="_askAnalysisPanel_1vvbs_53",Ke="_askSettingsSeparator_1vvbs_58",We="_settingsButton_1vvbs_62",n={askContainer:Le,askTopSection:De,askBottomSection:Me,askTitle:qe,askQuestionInput:He,askAnswerContainer:ze,askAnalysisPanel:Je,askSettingsSeparator:Ke,settingsButton:We};function Xe(){const[f,v]=s.useState(!1),[k,H]=s.useState(""),[b,Ye]=s.useState(""),[y,Ze]=s.useState(""),[A,z]=s.useState(.3),[J,P]=s.useState(Q.Hybrid),[j,K]=s.useState(3),[h,w]=s.useState(!0),[V,W]=s.useState(!1),[l,X]=s.useState(!1),[O,Y]=s.useState(be.TextAndImages),[R,Z]=s.useState(""),[$,ee]=s.useState(""),[te,se]=s.useState([L.Embedding,L.ImageEmbedding]),[N,ae]=s.useState(!1),[I,ne]=s.useState(!1),[G,oe]=s.useState(!1),[ie,re]=s.useState(!1),[le,ce]=s.useState(!1),C=s.useRef(""),[x,E]=s.useState(!1),[c,U]=s.useState(),[o,ue]=s.useState(),[B,F]=s.useState(),[u,r]=s.useState(void 0),i=d?fe().instance:void 0,pe=async()=>{const e=i?await M(i):void 0;Ie(e).then(a=>{oe(a.showGPT4VOptions),w(a.showSemanticRankerOption),re(a.showSemanticRankerOption),ce(a.showVectorOption),a.showVectorOption||P(Q.Text)})};s.useEffect(()=>{pe()},[]);const _=async e=>{C.current=e,c&&U(void 0),E(!0),F(void 0),r(void 0);const a=i?await M(i):void 0;try{const p={messages:[{content:e,role:"user"}],context:{overrides:{prompt_template:k.length===0?void 0:k,prompt_template_prefix:b.length===0?void 0:b,prompt_template_suffix:y.length===0?void 0:y,exclude_category:R.length===0?void 0:R,top:j,temperature:A,retrieval_mode:J,semantic_ranker:h,semantic_captions:V,use_oid_security_filter:N,use_groups_security_filter:I,vector_fields:te,use_gpt4v:l,gpt4v_input:O}},session_state:o?o.choices[0].session_state:null},Te=await Ge(p,a);ue(Te)}catch(p){U(p)}finally{E(!1)}},de=(e,a)=>{H(a||"")},me=(e,a,p)=>{z(e)},Se=(e,a)=>{K(parseInt(a||"3"))},ge=(e,a)=>{w(!!a)},ve=(e,a)=>{W(!!a)},ke=(e,a)=>{Z(a||"")},he=e=>{_(e),ee(e)},Ce=e=>{B===e&&u===m.CitationTab?r(void 0):(F(e),r(m.CitationTab))},T=e=>{r(u===e?void 0:e)},xe=(e,a)=>{ae(!!a)},_e=(e,a)=>{ne(!!a)};return t.jsxs("div",{className:n.askContainer,children:[t.jsxs("div",{className:n.askTopSection,children:[t.jsx(ye,{className:n.settingsButton,onClick:()=>v(!f)}),t.jsx("h1",{className:n.askTitle,children:"Ask your data"}),t.jsx("div",{className:n.askQuestionInput,children:t.jsx(Ae,{placeholder:"Example: Does my plan cover annual eye exams?",disabled:x,initQuestion:$,onSend:e=>_(e)})})]}),t.jsxs("div",{className:n.askBottomSection,children:[x&&t.jsx(Ee,{label:"Generating answer"}),!C.current&&t.jsx(Pe,{onExampleClicked:he,useGPT4V:l}),!x&&o&&!c&&t.jsx("div",{className:n.askAnswerContainer,children:t.jsx(je,{answer:o,isStreaming:!1,onCitationClicked:e=>Ce(e),onThoughtProcessClicked:()=>T(m.ThoughtProcessTab),onSupportingContentClicked:()=>T(m.SupportingContentTab)})}),c?t.jsx("div",{className:n.askAnswerContainer,children:t.jsx(we,{error:c.toString(),onRetry:()=>_(C.current)})}):null,u&&o&&t.jsx(Ve,{className:n.askAnalysisPanel,activeCitation:B,onActiveTabChanged:e=>T(e),citationHeight:"600px",answer:o,activeTab:u})]}),t.jsxs(Ue,{headerText:"Configure answer generation",isOpen:f,isBlocking:!1,onDismiss:()=>v(!1),closeButtonAriaLabel:"Close",onRenderFooterContent:()=>t.jsx(Be,{onClick:()=>v(!1),children:"Close"}),isFooterAtBottom:!0,children:[t.jsx(q,{className:n.askSettingsSeparator,defaultValue:k,label:"Override prompt template",multiline:!0,autoAdjustHeight:!0,onChange:de}),t.jsx(Fe,{className:n.chatSettingsSeparator,label:"Temperature",min:0,max:1,step:.1,defaultValue:A,onChange:me,showValue:!0,snapToStep:!0}),t.jsx(Qe,{className:n.askSettingsSeparator,label:"Retrieve this many search results:",min:1,max:50,defaultValue:j.toString(),onChange:Se}),t.jsx(q,{className:n.askSettingsSeparator,label:"Exclude category",onChange:ke}),ie&&t.jsx(g,{className:n.askSettingsSeparator,checked:h,label:"Use semantic ranker for retrieval",onChange:ge}),t.jsx(g,{className:n.askSettingsSeparator,checked:V,label:"Use query-contextual summaries instead of whole documents",onChange:ve,disabled:!h}),G&&t.jsx(Oe,{gpt4vInputs:O,isUseGPT4V:l,updateUseGPT4V:e=>{X(e)},updateGPT4VInputs:e=>Y(e)}),le&&t.jsx(Re,{showImageOptions:l&&G,updateVectorFields:e=>se(e),updateRetrievalMode:e=>P(e)}),d&&t.jsx(g,{className:n.askSettingsSeparator,checked:N||S,label:"Use oid security filter",disabled:!D(i)||S,onChange:xe}),d&&t.jsx(g,{className:n.askSettingsSeparator,checked:I||S,label:"Use groups security filter",disabled:!D(i)||S,onChange:_e}),d&&t.jsx(Ne,{})]})]})}Xe.displayName="Ask";export{Xe as Component}; +//# sourceMappingURL=Ask-2a9371aa.js.map diff --git a/app/backend/static/assets/Ask-3c4f5122.js.map b/app/backend/static/assets/Ask-2a9371aa.js.map similarity index 99% rename from app/backend/static/assets/Ask-3c4f5122.js.map rename to app/backend/static/assets/Ask-2a9371aa.js.map index 9cc80d43..abb2a46e 100644 --- a/app/backend/static/assets/Ask-3c4f5122.js.map +++ b/app/backend/static/assets/Ask-2a9371aa.js.map @@ -1 +1 @@ -{"version":3,"file":"Ask-3c4f5122.js","sources":["../../../frontend/src/pages/ask/Ask.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { Checkbox, Panel, DefaultButton, Spinner, Slider, TextField, SpinButton, IDropdownOption, Dropdown } from \"@fluentui/react\";\n\nimport styles from \"./Ask.module.css\";\n\nimport { askApi, configApi, ChatAppResponse, ChatAppRequest, RetrievalMode, VectorFieldOptions, GPT4VInput } from \"../../api\";\nimport { Answer, AnswerError } from \"../../components/Answer\";\nimport { QuestionInput } from \"../../components/QuestionInput\";\nimport { ExampleList } from \"../../components/Example\";\nimport { AnalysisPanel, AnalysisPanelTabs } from \"../../components/AnalysisPanel\";\nimport { SettingsButton } from \"../../components/SettingsButton/SettingsButton\";\nimport { useLogin, getToken, isLoggedIn, requireAccessControl } from \"../../authConfig\";\nimport { VectorSettings } from \"../../components/VectorSettings\";\nimport { GPT4VSettings } from \"../../components/GPT4VSettings\";\n\nimport { useMsal } from \"@azure/msal-react\";\nimport { TokenClaimsDisplay } from \"../../components/TokenClaimsDisplay\";\n\nexport function Component(): JSX.Element {\n const [isConfigPanelOpen, setIsConfigPanelOpen] = useState(false);\n const [promptTemplate, setPromptTemplate] = useState(\"\");\n const [promptTemplatePrefix, setPromptTemplatePrefix] = useState(\"\");\n const [promptTemplateSuffix, setPromptTemplateSuffix] = useState(\"\");\n const [temperature, setTemperature] = useState(0.3);\n const [retrievalMode, setRetrievalMode] = useState(RetrievalMode.Hybrid);\n const [retrieveCount, setRetrieveCount] = useState(3);\n const [useSemanticRanker, setUseSemanticRanker] = useState(true);\n const [useSemanticCaptions, setUseSemanticCaptions] = useState(false);\n const [useGPT4V, setUseGPT4V] = useState(false);\n const [gpt4vInput, setGPT4VInput] = useState(GPT4VInput.TextAndImages);\n const [excludeCategory, setExcludeCategory] = useState(\"\");\n const [question, setQuestion] = useState(\"\");\n const [vectorFieldList, setVectorFieldList] = useState([VectorFieldOptions.Embedding, VectorFieldOptions.ImageEmbedding]);\n const [useOidSecurityFilter, setUseOidSecurityFilter] = useState(false);\n const [useGroupsSecurityFilter, setUseGroupsSecurityFilter] = useState(false);\n const [showGPT4VOptions, setShowGPT4VOptions] = useState(false);\n const [showSemanticRankerOption, setShowSemanticRankerOption] = useState(false);\n const [showVectorOption, setShowVectorOption] = useState(false);\n\n const lastQuestionRef = useRef(\"\");\n\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState();\n const [answer, setAnswer] = useState();\n\n const [activeCitation, setActiveCitation] = useState();\n const [activeAnalysisPanelTab, setActiveAnalysisPanelTab] = useState(undefined);\n\n const client = useLogin ? useMsal().instance : undefined;\n\n const getConfig = async () => {\n const token = client ? await getToken(client) : undefined;\n\n configApi(token).then(config => {\n setShowGPT4VOptions(config.showGPT4VOptions);\n setUseSemanticRanker(config.showSemanticRankerOption);\n setShowSemanticRankerOption(config.showSemanticRankerOption);\n setShowVectorOption(config.showVectorOption);\n if (!config.showVectorOption) {\n setRetrievalMode(RetrievalMode.Text);\n }\n });\n };\n\n useEffect(() => {\n getConfig();\n }, []);\n\n const makeApiRequest = async (question: string) => {\n lastQuestionRef.current = question;\n\n error && setError(undefined);\n setIsLoading(true);\n setActiveCitation(undefined);\n setActiveAnalysisPanelTab(undefined);\n\n const token = client ? await getToken(client) : undefined;\n\n try {\n const request: ChatAppRequest = {\n messages: [\n {\n content: question,\n role: \"user\"\n }\n ],\n context: {\n overrides: {\n prompt_template: promptTemplate.length === 0 ? undefined : promptTemplate,\n prompt_template_prefix: promptTemplatePrefix.length === 0 ? undefined : promptTemplatePrefix,\n prompt_template_suffix: promptTemplateSuffix.length === 0 ? undefined : promptTemplateSuffix,\n exclude_category: excludeCategory.length === 0 ? undefined : excludeCategory,\n top: retrieveCount,\n temperature: temperature,\n retrieval_mode: retrievalMode,\n semantic_ranker: useSemanticRanker,\n semantic_captions: useSemanticCaptions,\n use_oid_security_filter: useOidSecurityFilter,\n use_groups_security_filter: useGroupsSecurityFilter,\n vector_fields: vectorFieldList,\n use_gpt4v: useGPT4V,\n gpt4v_input: gpt4vInput\n }\n },\n // ChatAppProtocol: Client must pass on any session state received from the server\n session_state: answer ? answer.choices[0].session_state : null\n };\n const result = await askApi(request, token);\n setAnswer(result);\n } catch (e) {\n setError(e);\n } finally {\n setIsLoading(false);\n }\n };\n\n const onPromptTemplateChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplate(newValue || \"\");\n };\n\n const onPromptTemplatePrefixChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplatePrefix(newValue || \"\");\n };\n\n const onPromptTemplateSuffixChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplateSuffix(newValue || \"\");\n };\n\n const onTemperatureChange = (\n newValue: number,\n range?: [number, number],\n event?: React.MouseEvent | React.TouchEvent | MouseEvent | TouchEvent | React.KeyboardEvent\n ) => {\n setTemperature(newValue);\n };\n\n const onRetrieveCountChange = (_ev?: React.SyntheticEvent, newValue?: string) => {\n setRetrieveCount(parseInt(newValue || \"3\"));\n };\n\n const onRetrievalModeChange = (_ev: React.FormEvent, option?: IDropdownOption | undefined, index?: number | undefined) => {\n setRetrievalMode(option?.data || RetrievalMode.Hybrid);\n };\n\n const onUseSemanticRankerChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseSemanticRanker(!!checked);\n };\n\n const onUseSemanticCaptionsChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseSemanticCaptions(!!checked);\n };\n\n const onExcludeCategoryChanged = (_ev?: React.FormEvent, newValue?: string) => {\n setExcludeCategory(newValue || \"\");\n };\n\n const onExampleClicked = (example: string) => {\n makeApiRequest(example);\n setQuestion(example);\n };\n\n const onShowCitation = (citation: string) => {\n if (activeCitation === citation && activeAnalysisPanelTab === AnalysisPanelTabs.CitationTab) {\n setActiveAnalysisPanelTab(undefined);\n } else {\n setActiveCitation(citation);\n setActiveAnalysisPanelTab(AnalysisPanelTabs.CitationTab);\n }\n };\n\n const onToggleTab = (tab: AnalysisPanelTabs) => {\n if (activeAnalysisPanelTab === tab) {\n setActiveAnalysisPanelTab(undefined);\n } else {\n setActiveAnalysisPanelTab(tab);\n }\n };\n\n const onUseOidSecurityFilterChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseOidSecurityFilter(!!checked);\n };\n\n const onUseGroupsSecurityFilterChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseGroupsSecurityFilter(!!checked);\n };\n\n return (\n
\n
\n setIsConfigPanelOpen(!isConfigPanelOpen)} />\n

Ask your data

\n
\n makeApiRequest(question)}\n />\n
\n
\n
\n {isLoading && }\n {!lastQuestionRef.current && }\n {!isLoading && answer && !error && (\n
\n onShowCitation(x)}\n onThoughtProcessClicked={() => onToggleTab(AnalysisPanelTabs.ThoughtProcessTab)}\n onSupportingContentClicked={() => onToggleTab(AnalysisPanelTabs.SupportingContentTab)}\n />\n
\n )}\n {error ? (\n
\n makeApiRequest(lastQuestionRef.current)} />\n
\n ) : null}\n {activeAnalysisPanelTab && answer && (\n onToggleTab(x)}\n citationHeight=\"600px\"\n answer={answer}\n activeTab={activeAnalysisPanelTab}\n />\n )}\n
\n\n setIsConfigPanelOpen(false)}\n closeButtonAriaLabel=\"Close\"\n onRenderFooterContent={() => setIsConfigPanelOpen(false)}>Close}\n isFooterAtBottom={true}\n >\n \n\n \n\n \n \n\n {showSemanticRankerOption && (\n \n )}\n\n \n\n {showGPT4VOptions && (\n {\n setUseGPT4V(useGPT4V);\n }}\n updateGPT4VInputs={inputs => setGPT4VInput(inputs)}\n />\n )}\n\n {showVectorOption && (\n setVectorFieldList(options)}\n updateRetrievalMode={(retrievalMode: RetrievalMode) => setRetrievalMode(retrievalMode)}\n />\n )}\n\n {useLogin && (\n \n )}\n {useLogin && (\n \n )}\n {useLogin && }\n \n
\n );\n}\n\nComponent.displayName = \"Ask\";\n"],"names":["Component","isConfigPanelOpen","setIsConfigPanelOpen","useState","promptTemplate","setPromptTemplate","promptTemplatePrefix","setPromptTemplatePrefix","promptTemplateSuffix","setPromptTemplateSuffix","temperature","setTemperature","retrievalMode","setRetrievalMode","RetrievalMode","retrieveCount","setRetrieveCount","useSemanticRanker","setUseSemanticRanker","useSemanticCaptions","setUseSemanticCaptions","useGPT4V","setUseGPT4V","gpt4vInput","setGPT4VInput","GPT4VInput","excludeCategory","setExcludeCategory","question","setQuestion","vectorFieldList","setVectorFieldList","VectorFieldOptions","useOidSecurityFilter","setUseOidSecurityFilter","useGroupsSecurityFilter","setUseGroupsSecurityFilter","showGPT4VOptions","setShowGPT4VOptions","showSemanticRankerOption","setShowSemanticRankerOption","showVectorOption","setShowVectorOption","lastQuestionRef","useRef","isLoading","setIsLoading","error","setError","answer","setAnswer","activeCitation","setActiveCitation","activeAnalysisPanelTab","setActiveAnalysisPanelTab","client","useLogin","useMsal","getConfig","token","getToken","configApi","config","useEffect","makeApiRequest","request","result","askApi","e","onPromptTemplateChange","_ev","newValue","onTemperatureChange","range","event","onRetrieveCountChange","onUseSemanticRankerChange","checked","onUseSemanticCaptionsChange","onExcludeCategoryChanged","onExampleClicked","example","onShowCitation","citation","AnalysisPanelTabs","onToggleTab","tab","onUseOidSecurityFilterChange","onUseGroupsSecurityFilterChange","jsxs","styles","jsx","SettingsButton","QuestionInput","Spinner","ExampleList","Answer","x","AnswerError","AnalysisPanel","Panel","DefaultButton","TextField","Slider","SpinButton","Checkbox","GPT4VSettings","inputs","VectorSettings","options","requireAccessControl","isLoggedIn","TokenClaimsDisplay"],"mappings":"uzBAkBO,SAASA,IAAyB,CACrC,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,WAAS,EAAK,EAC1D,CAACC,EAAgBC,CAAiB,EAAIF,WAAiB,EAAE,EACzD,CAACG,EAAsBC,EAAuB,EAAIJ,WAAiB,EAAE,EACrE,CAACK,EAAsBC,EAAuB,EAAIN,WAAiB,EAAE,EACrE,CAACO,EAAaC,CAAc,EAAIR,WAAiB,EAAG,EACpD,CAACS,EAAeC,CAAgB,EAAIV,EAAAA,SAAwBW,EAAc,MAAM,EAChF,CAACC,EAAeC,CAAgB,EAAIb,WAAiB,CAAC,EACtD,CAACc,EAAmBC,CAAoB,EAAIf,WAAkB,EAAI,EAClE,CAACgB,EAAqBC,CAAsB,EAAIjB,WAAkB,EAAK,EACvE,CAACkB,EAAUC,CAAW,EAAInB,WAAkB,EAAK,EACjD,CAACoB,EAAYC,CAAa,EAAIrB,EAAAA,SAAqBsB,GAAW,aAAa,EAC3E,CAACC,EAAiBC,CAAkB,EAAIxB,WAAiB,EAAE,EAC3D,CAACyB,EAAUC,EAAW,EAAI1B,WAAiB,EAAE,EAC7C,CAAC2B,GAAiBC,EAAkB,EAAI5B,EAAA,SAA+B,CAAC6B,EAAmB,UAAWA,EAAmB,cAAc,CAAC,EACxI,CAACC,EAAsBC,EAAuB,EAAI/B,WAAkB,EAAK,EACzE,CAACgC,E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Q,CACxB,EACA,kBAA6BsF,GAAAnF,EAAcmF,CAAM,CAAA,CACrD,EAGHlE,IACGkD,EAAA,IAACiB,GAAA,CACG,iBAAkBvF,GAAYgB,EAC9B,mBAAqBwE,GAAkC9E,GAAmB8E,CAAO,EACjF,oBAAsBjG,GAAiCC,EAAiBD,CAAa,CAAA,CACzF,EAGH4C,GACGmC,EAAA,IAACc,EAAA,CACG,UAAWf,EAAO,qBAClB,QAASzD,GAAwB6E,EACjC,MAAM,0BACN,SAAU,CAACC,EAAWxD,CAAM,GAAKuD,EACjC,SAAUvB,EAAA,CACd,EAEH/B,GACGmC,EAAA,IAACc,EAAA,CACG,UAAWf,EAAO,qBAClB,QAASvD,GAA2B2E,EACpC,MAAM,6BACN,SAAU,CAACC,EAAWxD,CAAM,GAAKuD,EACjC,SAAUtB,EAAA,CACd,EAEHhC,SAAawD,GAAmB,EAAA,CAAA,CAAA,CACrC,CACJ,CAAA,CAAA,CAER,CAEAhH,GAAU,YAAc"} \ No newline at end of file +{"version":3,"file":"Ask-2a9371aa.js","sources":["../../../frontend/src/pages/ask/Ask.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { Checkbox, Panel, DefaultButton, Spinner, Slider, TextField, SpinButton, IDropdownOption, Dropdown } from \"@fluentui/react\";\n\nimport styles from \"./Ask.module.css\";\n\nimport { askApi, configApi, ChatAppResponse, ChatAppRequest, RetrievalMode, VectorFieldOptions, GPT4VInput } from \"../../api\";\nimport { Answer, AnswerError } from \"../../components/Answer\";\nimport { QuestionInput } from \"../../components/QuestionInput\";\nimport { ExampleList } from \"../../components/Example\";\nimport { AnalysisPanel, AnalysisPanelTabs } from \"../../components/AnalysisPanel\";\nimport { SettingsButton } from \"../../components/SettingsButton/SettingsButton\";\nimport { useLogin, getToken, isLoggedIn, requireAccessControl } from \"../../authConfig\";\nimport { VectorSettings } from \"../../components/VectorSettings\";\nimport { GPT4VSettings } from \"../../components/GPT4VSettings\";\n\nimport { useMsal } from \"@azure/msal-react\";\nimport { TokenClaimsDisplay } from \"../../components/TokenClaimsDisplay\";\n\nexport function Component(): JSX.Element {\n const [isConfigPanelOpen, setIsConfigPanelOpen] = useState(false);\n const [promptTemplate, setPromptTemplate] = useState(\"\");\n const [promptTemplatePrefix, setPromptTemplatePrefix] = useState(\"\");\n const [promptTemplateSuffix, setPromptTemplateSuffix] = useState(\"\");\n const [temperature, setTemperature] = useState(0.3);\n const [retrievalMode, setRetrievalMode] = useState(RetrievalMode.Hybrid);\n const [retrieveCount, setRetrieveCount] = useState(3);\n const [useSemanticRanker, setUseSemanticRanker] = useState(true);\n const [useSemanticCaptions, setUseSemanticCaptions] = useState(false);\n const [useGPT4V, setUseGPT4V] = useState(false);\n const [gpt4vInput, setGPT4VInput] = useState(GPT4VInput.TextAndImages);\n const [excludeCategory, setExcludeCategory] = useState(\"\");\n const [question, setQuestion] = useState(\"\");\n const [vectorFieldList, setVectorFieldList] = useState([VectorFieldOptions.Embedding, VectorFieldOptions.ImageEmbedding]);\n const [useOidSecurityFilter, setUseOidSecurityFilter] = useState(false);\n const [useGroupsSecurityFilter, setUseGroupsSecurityFilter] = useState(false);\n const [showGPT4VOptions, setShowGPT4VOptions] = useState(false);\n const [showSemanticRankerOption, setShowSemanticRankerOption] = useState(false);\n const [showVectorOption, setShowVectorOption] = useState(false);\n\n const lastQuestionRef = useRef(\"\");\n\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState();\n const [answer, setAnswer] = useState();\n\n const [activeCitation, setActiveCitation] = useState();\n const [activeAnalysisPanelTab, setActiveAnalysisPanelTab] = useState(undefined);\n\n const client = useLogin ? useMsal().instance : undefined;\n\n const getConfig = async () => {\n const token = client ? await getToken(client) : undefined;\n\n configApi(token).then(config => {\n setShowGPT4VOptions(config.showGPT4VOptions);\n setUseSemanticRanker(config.showSemanticRankerOption);\n setShowSemanticRankerOption(config.showSemanticRankerOption);\n setShowVectorOption(config.showVectorOption);\n if (!config.showVectorOption) {\n setRetrievalMode(RetrievalMode.Text);\n }\n });\n };\n\n useEffect(() => {\n getConfig();\n }, []);\n\n const makeApiRequest = async (question: string) => {\n lastQuestionRef.current = question;\n\n error && setError(undefined);\n setIsLoading(true);\n setActiveCitation(undefined);\n setActiveAnalysisPanelTab(undefined);\n\n const token = client ? await getToken(client) : undefined;\n\n try {\n const request: ChatAppRequest = {\n messages: [\n {\n content: question,\n role: \"user\"\n }\n ],\n context: {\n overrides: {\n prompt_template: promptTemplate.length === 0 ? undefined : promptTemplate,\n prompt_template_prefix: promptTemplatePrefix.length === 0 ? undefined : promptTemplatePrefix,\n prompt_template_suffix: promptTemplateSuffix.length === 0 ? undefined : promptTemplateSuffix,\n exclude_category: excludeCategory.length === 0 ? undefined : excludeCategory,\n top: retrieveCount,\n temperature: temperature,\n retrieval_mode: retrievalMode,\n semantic_ranker: useSemanticRanker,\n semantic_captions: useSemanticCaptions,\n use_oid_security_filter: useOidSecurityFilter,\n use_groups_security_filter: useGroupsSecurityFilter,\n vector_fields: vectorFieldList,\n use_gpt4v: useGPT4V,\n gpt4v_input: gpt4vInput\n }\n },\n // ChatAppProtocol: Client must pass on any session state received from the server\n session_state: answer ? answer.choices[0].session_state : null\n };\n const result = await askApi(request, token);\n setAnswer(result);\n } catch (e) {\n setError(e);\n } finally {\n setIsLoading(false);\n }\n };\n\n const onPromptTemplateChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplate(newValue || \"\");\n };\n\n const onPromptTemplatePrefixChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplatePrefix(newValue || \"\");\n };\n\n const onPromptTemplateSuffixChange = (_ev?: React.FormEvent, newValue?: string) => {\n setPromptTemplateSuffix(newValue || \"\");\n };\n\n const onTemperatureChange = (\n newValue: number,\n range?: [number, number],\n event?: React.MouseEvent | React.TouchEvent | MouseEvent | TouchEvent | React.KeyboardEvent\n ) => {\n setTemperature(newValue);\n };\n\n const onRetrieveCountChange = (_ev?: React.SyntheticEvent, newValue?: string) => {\n setRetrieveCount(parseInt(newValue || \"3\"));\n };\n\n const onRetrievalModeChange = (_ev: React.FormEvent, option?: IDropdownOption | undefined, index?: number | undefined) => {\n setRetrievalMode(option?.data || RetrievalMode.Hybrid);\n };\n\n const onUseSemanticRankerChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseSemanticRanker(!!checked);\n };\n\n const onUseSemanticCaptionsChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseSemanticCaptions(!!checked);\n };\n\n const onExcludeCategoryChanged = (_ev?: React.FormEvent, newValue?: string) => {\n setExcludeCategory(newValue || \"\");\n };\n\n const onExampleClicked = (example: string) => {\n makeApiRequest(example);\n setQuestion(example);\n };\n\n const onShowCitation = (citation: string) => {\n if (activeCitation === citation && activeAnalysisPanelTab === AnalysisPanelTabs.CitationTab) {\n setActiveAnalysisPanelTab(undefined);\n } else {\n setActiveCitation(citation);\n setActiveAnalysisPanelTab(AnalysisPanelTabs.CitationTab);\n }\n };\n\n const onToggleTab = (tab: AnalysisPanelTabs) => {\n if (activeAnalysisPanelTab === tab) {\n setActiveAnalysisPanelTab(undefined);\n } else {\n setActiveAnalysisPanelTab(tab);\n }\n };\n\n const onUseOidSecurityFilterChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseOidSecurityFilter(!!checked);\n };\n\n const onUseGroupsSecurityFilterChange = (_ev?: React.FormEvent, checked?: boolean) => {\n setUseGroupsSecurityFilter(!!checked);\n };\n\n return (\n
\n
\n setIsConfigPanelOpen(!isConfigPanelOpen)} />\n

Ask your data

\n
\n makeApiRequest(question)}\n />\n
\n
\n
\n {isLoading && }\n {!lastQuestionRef.current && }\n {!isLoading && answer && !error && (\n
\n onShowCitation(x)}\n onThoughtProcessClicked={() => onToggleTab(AnalysisPanelTabs.ThoughtProcessTab)}\n onSupportingContentClicked={() => onToggleTab(AnalysisPanelTabs.SupportingContentTab)}\n />\n
\n )}\n {error ? (\n
\n makeApiRequest(lastQuestionRef.current)} />\n
\n ) : null}\n {activeAnalysisPanelTab && answer && (\n onToggleTab(x)}\n citationHeight=\"600px\"\n answer={answer}\n activeTab={activeAnalysisPanelTab}\n />\n )}\n
\n\n setIsConfigPanelOpen(false)}\n closeButtonAriaLabel=\"Close\"\n onRenderFooterContent={() => setIsConfigPanelOpen(false)}>Close}\n isFooterAtBottom={true}\n >\n \n\n \n\n \n \n\n {showSemanticRankerOption && (\n \n )}\n\n \n\n {showGPT4VOptions && (\n {\n setUseGPT4V(useGPT4V);\n }}\n updateGPT4VInputs={inputs => setGPT4VInput(inputs)}\n />\n )}\n\n {showVectorOption && (\n setVectorFieldList(options)}\n updateRetrievalMode={(retrievalMode: RetrievalMode) => setRetrievalMode(retrievalMode)}\n />\n )}\n\n {useLogin && (\n \n )}\n {useLogin && (\n \n )}\n {useLogin && }\n \n
\n );\n}\n\nComponent.displayName = \"Ask\";\n"],"names":["Component","isConfigPanelOpen","setIsConfigPanelOpen","useState","promptTemplate","setPromptTemplate","promptTemplatePrefix","setPromptTemplatePrefix","promptTemplateSuffix","setPromptTemplateSuffix","temperature","setTemperature","retrievalMode","setRetrievalMode","RetrievalMode","retrieveCount","setRetrieveCount","useSemanticRanker","setUseSemanticRanker","useSemanticCaptions","setUseSemanticCaptions","useGPT4V","setUseGPT4V","gpt4vInput","setGPT4VInput","GPT4VInput","excludeCategory","setExcludeCategory","question","setQuestion","vectorFieldList","setVectorFieldList","VectorFieldOptions","useOidSecurityFilter","setUseOidSecurityFilter","useGroupsSecurityFilter","setUseGroupsSecurityFilter","showGPT4VOptions","setShowGPT4VOptions","showSemanticRankerOption","setShowSemanticRankerOption","showVectorOption","setShowVectorOption","lastQuestionRef","useRef","isLoading","setIsLoading","error","setError","answer","setAnswer","activeCitation","setActiveCitation","activeAnalysisPanelTab","setActiveAnalysisPanelTab","client","useLogin","useMsal","getConfig","token","getToken","configApi","config","useEffect","makeApiRequest","request","result","askApi","e","onPromptTemplateChange","_ev","newValue","onTemperatureChange","range","event","onRetrieveCountChange","onUseSemanticRankerChange","checked","onUseSemanticCaptionsChange","onExcludeCategoryChanged","onExampleClicked","example","onShowCitation","citation","AnalysisPanelTabs","onToggleTab","tab","onUseOidSecurityFilterChange","onUseGroupsSecurityFilterChange","jsxs","styles","jsx","SettingsButton","QuestionInput","Spinner","ExampleList","Answer","x","AnswerError","AnalysisPanel","Panel","DefaultButton","TextField","Slider","SpinButton","Checkbox","GPT4VSettings","inputs","VectorSettings","options","requireAccessControl","isLoggedIn","TokenClaimsDisplay"],"mappings":"uzBAkBO,SAASA,IAAyB,CACrC,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,WAAS,EAAK,EAC1D,CAACC,EAAgBC,CAAiB,EAAIF,WAAiB,EAAE,EACzD,CAACG,EAAsBC,EAAuB,EAAIJ,WAAiB,EAAE,EACrE,CAACK,EAAsBC,EAAuB,EAAIN,WAAiB,EAAE,EACrE,CAACO,EAAaC,CAAc,EAAIR,WAAiB,EAAG,EACpD,CAACS,EAAeC,CAAgB,EAAIV,EAAAA,SAAwBW,EAAc,MAAM,EAChF,CAACC,EAAeC,CAAgB,EAAIb,WAAiB,CAAC,EACtD,CAACc,EAAmBC,CAAoB,EAAIf,WAAkB,EAAI,EAClE,CAACgB,EAAqBC,CAAsB,EAAIjB,WAAkB,EAAK,EACvE,CAACkB,EAAUC,CAAW,EAAInB,WAAkB,EAAK,EACjD,CAACoB,EAAYC,CAAa,EAAIrB,EAAAA,SAAqBsB,GAAW,aAAa,EAC3E,CAACC,EAAiBC,CAAkB,EAAIxB,WAAiB,EAAE,EAC3D,CAACyB,EAAUC,EAAW,EAAI1B,WAAiB,EAAE,EAC7C,CAAC2B,GAAiBC,EAAkB,EAAI5B,EAAA,SAA+B,CAAC6B,EAAmB,UAAWA,EAAmB,cAAc,CAAC,EACxI,CAACC,EAAsBC,EAAuB,EAAI/B,WAAkB,EAAK,EACzE,CAACgC,EAAyBC,EAA0B,EAAIjC,WAAkB,EAAK,EAC/E,CAACkC,EAAkBC,EAAmB,EAAInC,WAAkB,EAAK,EAC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GAAA,CACG,iBAAkBvF,GAAYgB,EAC9B,mBAAqBwE,GAAkC9E,GAAmB8E,CAAO,EACjF,oBAAsBjG,GAAiCC,EAAiBD,CAAa,CAAA,CACzF,EAGH4C,GACGmC,EAAA,IAACc,EAAA,CACG,UAAWf,EAAO,qBAClB,QAASzD,GAAwB6E,EACjC,MAAM,0BACN,SAAU,CAACC,EAAWxD,CAAM,GAAKuD,EACjC,SAAUvB,EAAA,CACd,EAEH/B,GACGmC,EAAA,IAACc,EAAA,CACG,UAAWf,EAAO,qBAClB,QAASvD,GAA2B2E,EACpC,MAAM,6BACN,SAAU,CAACC,EAAWxD,CAAM,GAAKuD,EACjC,SAAUtB,EAAA,CACd,EAEHhC,SAAawD,GAAmB,EAAA,CAAA,CAAA,CACrC,CACJ,CAAA,CAAA,CAER,CAEAhH,GAAU,YAAc"} \ No newline at end of file diff --git a/app/backend/static/assets/index-54ce2544.css b/app/backend/static/assets/index-03b3cb66.css similarity index 81% rename from app/backend/static/assets/index-54ce2544.css rename to app/backend/static/assets/index-03b3cb66.css index 0c043933..62185432 100644 --- a/app/backend/static/assets/index-54ce2544.css +++ b/app/backend/static/assets/index-03b3cb66.css @@ -1 +1 @@ -*{box-sizing:border-box}html,body{height:100%;margin:0;padding:0}html{background:#f2f2f2;font-family:Segoe UI,-apple-system,BlinkMacSystemFont,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100%}._layout_1nrkm_1{display:flex;flex-direction:column;height:100%}._header_1nrkm_7{background-color:#222;color:#f2f2f2}._headerContainer_1nrkm_12{display:flex;align-items:center;justify-content:space-around;margin-right:12px;margin-left:12px}._headerTitleContainer_1nrkm_20{display:flex;align-items:center;margin-right:40px;color:#f2f2f2;text-decoration:none}._headerLogo_1nrkm_28{height:40px}._headerTitle_1nrkm_20{margin-left:12px;font-weight:600}._headerNavList_1nrkm_37{display:flex;list-style:none;padding-left:0}._headerNavPageLink_1nrkm_43{color:#f2f2f2;text-decoration:none;opacity:.75;transition-timing-function:cubic-bezier(.16,1,.3,1);transition-duration:.5s;transition-property:opacity}._headerNavPageLink_1nrkm_43:hover{opacity:1}._headerNavPageLinkActive_1nrkm_57{color:#f2f2f2;text-decoration:none}._headerNavLeftMargin_1nrkm_62{margin-left:20px}._headerRightText_1nrkm_66{font-weight:400;margin-left:40px}._microsoftLogo_1nrkm_71{height:23px;font-weight:600}._githubLogo_1nrkm_76{height:20px}._loginButton_m8yze_1{border-radius:5px;padding:30px;font-weight:100}._container_18ti9_1{flex:1;display:flex;flex-direction:column;margin-top:20px}._chatRoot_18ti9_8{flex:1;display:flex}._chatContainer_18ti9_13{flex:1;display:flex;flex-direction:column;align-items:center;width:100%}._chatEmptyState_18ti9_21{flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center;max-height:1024px;padding-top:60px}._chatEmptyStateTitle_18ti9_31{font-size:4rem;font-weight:600;margin-top:0;margin-bottom:30px}._chatEmptyStateSubtitle_18ti9_38{font-weight:600;margin-bottom:10px}@media only screen and (max-height: 780px){._chatEmptyState_18ti9_21{padding-top:0}._chatEmptyStateTitle_18ti9_31{font-size:3rem;margin-bottom:0}}._chatMessageStream_18ti9_54{flex-grow:1;max-height:1024px;max-width:1028px;width:100%;overflow-y:auto;padding-left:24px;padding-right:24px;display:flex;flex-direction:column}._chatMessageGpt_18ti9_66{margin-bottom:20px;max-width:80%;display:flex;min-width:500px}._chatMessageGptMinWidth_18ti9_73{max-width:500px;margin-bottom:20px}._chatInput_18ti9_78{position:sticky;bottom:0;flex:0 0 100px;padding:12px 24px 24px;width:100%;max-width:1028px;background:#f2f2f2}._chatAnalysisPanel_18ti9_91{flex:1;overflow-y:auto;max-height:89vh;margin-left:20px;margin-right:20px}._chatSettingsSeparator_18ti9_99{margin-top:15px}._loadingLogo_18ti9_103{font-size:28px}._commandsContainer_18ti9_107{display:flex;align-self:flex-end}._commandButton_18ti9_112{margin-right:20px;margin-bottom:20px}._answerContainer_1sqax_1{padding:20px;background:rgb(249,249,249);border-radius:8px;box-shadow:0 2px 4px #00000024,0 0 2px #0000001f;outline:transparent solid 1px}._answerLogo_1sqax_11{font-size:28px}._answerText_1sqax_15{font-size:16px;font-weight:400;line-height:22px;padding-top:16px;padding-bottom:16px;white-space:pre-line}._answerText_1sqax_15 table{border-collapse:collapse}._answerText_1sqax_15 td,._answerText_1sqax_15 th{border:1px solid;padding:5px}._selected_1sqax_34{outline:2px solid rgba(115,118,225,1)}._citationLearnMore_1sqax_38{margin-right:5px;font-weight:600;line-height:24px}._citation_1sqax_38{font-weight:500;line-height:24px;text-align:center;border-radius:4px;padding:0 8px;background:#d1dbfa;color:#123bb6;text-decoration:none;cursor:pointer}._citation_1sqax_38:hover{text-decoration:underline}._followupQuestionsList_1sqax_60{margin-top:10px}._followupQuestionLearnMore_1sqax_64{margin-right:5px;font-weight:600;line-height:24px}._followupQuestion_1sqax_60{font-weight:600;line-height:24px;text-align:center;border-radius:4px;padding:0 8px;background:#e8ebfa;color:#000;font-style:italic;text-decoration:none;cursor:pointer}._supContainer_1sqax_83{text-decoration:none;cursor:pointer}._supContainer_1sqax_83:hover{text-decoration:underline}sup{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;vertical-align:top;top:-1;margin:0 2px;min-width:14px;height:14px;border-radius:3px;background:#d1dbfa;color:#123bb6;text-decoration-color:transparent;outline:transparent solid 1px;cursor:pointer}._retryButton_1sqax_112{width:fit-content}@keyframes _loading_1sqax_134{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}._loadingdots_1sqax_134:after{content:"";animation:_loading_1sqax_134 1s infinite}._questionInputContainer_hiipw_1{border-radius:8px;box-shadow:0 8px 16px #00000024,0 0 2px #0000001f;height:90px;width:100%;padding:15px;background:white}._questionInputTextArea_hiipw_12{width:100%;line-height:40px}._questionInputButtonsContainer_hiipw_17{display:flex;flex-direction:column;justify-content:flex-end}._examplesNavList_o3hyg_1{list-style:none;padding-left:0;display:flex;flex-wrap:wrap;gap:10px;flex:1;justify-content:center}._example_o3hyg_1{word-break:break-word;background:#dbdbdb;border-radius:8px;display:flex;flex-direction:column;padding:20px;margin-bottom:5px;cursor:pointer}._example_o3hyg_1:hover{box-shadow:0 8px 16px #00000024,0 0 2px #0000001f;outline:2px solid rgba(115,118,225,1)}._exampleText_o3hyg_29{margin:0;font-size:22px;width:280px;min-height:100px}@media only screen and (max-height: 780px){._exampleText_o3hyg_29{font-size:20px;height:80px}}._container_1p3pb_1{display:flex;justify-content:flex-end;margin-bottom:20px;max-width:80%;margin-left:auto}._message_1p3pb_9{padding:20px;background:#e8ebfa;border-radius:8px;box-shadow:0 2px 4px #00000024,0 0 2px #0000001f;outline:transparent solid 1px}._thoughtProcess_1nmyh_1{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace;word-wrap:break-word;padding-top:12px;padding-bottom:12px}._tList_1nmyh_8{padding:20px 20px 0;display:inline-block;background:#e9e9e9}._tListItem_1nmyh_14{list-style:none;margin:auto auto auto 20px;min-height:50px;border-left:1px dashed #123bb6;padding:0 0 30px 30px;position:relative}._tListItem_1nmyh_14:last-child{border-left:0}._tListItem_1nmyh_14:before{position:absolute;left:-18px;top:-5px;content:" ";border:8px solid #d1dbfa;border-radius:500%;background:#123bb6;height:20px;width:20px}._tStep_1nmyh_40{color:#123bb6;position:relative;font-size:12px}._tCodeBlock_1nmyh_46{max-height:300px}._tProp_1nmyh_50{background-color:#d7d7d7;color:#333232;font-size:12px;padding:3px 10px;border-radius:10px}._citationImg_1nmyh_58{height:450px;max-width:100%;object-fit:contain}._supportingContentNavList_beb5d_1{list-style:none;padding-left:5px;display:flex;flex-direction:column;gap:10px}._supportingContentItem_beb5d_9{word-break:break-word;background:rgb(249,249,249);border-radius:8px;box-shadow:#0000000d 0 0 0 1px,#0000001a 0 2px 3px;outline:transparent solid 1px;display:flex;flex-direction:column;padding:20px}._supportingContentItemHeader_beb5d_23{margin:0}._supportingContentItemText_beb5d_27{margin-bottom:0;font-weight:300}._supportingContentItemImage_beb5d_32{object-fit:contain}._container_cfwv2_1{display:flex;align-items:center;gap:6px;cursor:pointer}._container_1pzrp_1{margin-top:10px} +*{box-sizing:border-box}html,body{height:100%;margin:0;padding:0}html{background:#f2f2f2;font-family:Segoe UI,-apple-system,BlinkMacSystemFont,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100%}._layout_1nrkm_1{display:flex;flex-direction:column;height:100%}._header_1nrkm_7{background-color:#222;color:#f2f2f2}._headerContainer_1nrkm_12{display:flex;align-items:center;justify-content:space-around;margin-right:12px;margin-left:12px}._headerTitleContainer_1nrkm_20{display:flex;align-items:center;margin-right:40px;color:#f2f2f2;text-decoration:none}._headerLogo_1nrkm_28{height:40px}._headerTitle_1nrkm_20{margin-left:12px;font-weight:600}._headerNavList_1nrkm_37{display:flex;list-style:none;padding-left:0}._headerNavPageLink_1nrkm_43{color:#f2f2f2;text-decoration:none;opacity:.75;transition-timing-function:cubic-bezier(.16,1,.3,1);transition-duration:.5s;transition-property:opacity}._headerNavPageLink_1nrkm_43:hover{opacity:1}._headerNavPageLinkActive_1nrkm_57{color:#f2f2f2;text-decoration:none}._headerNavLeftMargin_1nrkm_62{margin-left:20px}._headerRightText_1nrkm_66{font-weight:400;margin-left:40px}._microsoftLogo_1nrkm_71{height:23px;font-weight:600}._githubLogo_1nrkm_76{height:20px}._loginButton_m8yze_1{border-radius:5px;padding:30px;font-weight:100}._container_18ti9_1{flex:1;display:flex;flex-direction:column;margin-top:20px}._chatRoot_18ti9_8{flex:1;display:flex}._chatContainer_18ti9_13{flex:1;display:flex;flex-direction:column;align-items:center;width:100%}._chatEmptyState_18ti9_21{flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center;max-height:1024px;padding-top:60px}._chatEmptyStateTitle_18ti9_31{font-size:4rem;font-weight:600;margin-top:0;margin-bottom:30px}._chatEmptyStateSubtitle_18ti9_38{font-weight:600;margin-bottom:10px}@media only screen and (max-height: 780px){._chatEmptyState_18ti9_21{padding-top:0}._chatEmptyStateTitle_18ti9_31{font-size:3rem;margin-bottom:0}}._chatMessageStream_18ti9_54{flex-grow:1;max-height:1024px;max-width:1028px;width:100%;overflow-y:auto;padding-left:24px;padding-right:24px;display:flex;flex-direction:column}._chatMessageGpt_18ti9_66{margin-bottom:20px;max-width:80%;display:flex;min-width:500px}._chatMessageGptMinWidth_18ti9_73{max-width:500px;margin-bottom:20px}._chatInput_18ti9_78{position:sticky;bottom:0;flex:0 0 100px;padding:12px 24px 24px;width:100%;max-width:1028px;background:#f2f2f2}._chatAnalysisPanel_18ti9_91{flex:1;overflow-y:auto;max-height:89vh;margin-left:20px;margin-right:20px}._chatSettingsSeparator_18ti9_99{margin-top:15px}._loadingLogo_18ti9_103{font-size:28px}._commandsContainer_18ti9_107{display:flex;align-self:flex-end}._commandButton_18ti9_112{margin-right:20px;margin-bottom:20px}._answerContainer_1sqax_1{padding:20px;background:rgb(249,249,249);border-radius:8px;box-shadow:0 2px 4px #00000024,0 0 2px #0000001f;outline:transparent solid 1px}._answerLogo_1sqax_11{font-size:28px}._answerText_1sqax_15{font-size:16px;font-weight:400;line-height:22px;padding-top:16px;padding-bottom:16px;white-space:pre-line}._answerText_1sqax_15 table{border-collapse:collapse}._answerText_1sqax_15 td,._answerText_1sqax_15 th{border:1px solid;padding:5px}._selected_1sqax_34{outline:2px solid rgba(115,118,225,1)}._citationLearnMore_1sqax_38{margin-right:5px;font-weight:600;line-height:24px}._citation_1sqax_38{font-weight:500;line-height:24px;text-align:center;border-radius:4px;padding:0 8px;background:#d1dbfa;color:#123bb6;text-decoration:none;cursor:pointer}._citation_1sqax_38:hover{text-decoration:underline}._followupQuestionsList_1sqax_60{margin-top:10px}._followupQuestionLearnMore_1sqax_64{margin-right:5px;font-weight:600;line-height:24px}._followupQuestion_1sqax_60{font-weight:600;line-height:24px;text-align:center;border-radius:4px;padding:0 8px;background:#e8ebfa;color:#000;font-style:italic;text-decoration:none;cursor:pointer}._supContainer_1sqax_83{text-decoration:none;cursor:pointer}._supContainer_1sqax_83:hover{text-decoration:underline}sup{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;vertical-align:top;top:-1;margin:0 2px;min-width:14px;height:14px;border-radius:3px;background:#d1dbfa;color:#123bb6;text-decoration-color:transparent;outline:transparent solid 1px;cursor:pointer}._retryButton_1sqax_112{width:fit-content}@keyframes _loading_1sqax_134{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}._loadingdots_1sqax_134:after{content:"";animation:_loading_1sqax_134 1s infinite}._questionInputContainer_hiipw_1{border-radius:8px;box-shadow:0 8px 16px #00000024,0 0 2px #0000001f;height:90px;width:100%;padding:15px;background:white}._questionInputTextArea_hiipw_12{width:100%;line-height:40px}._questionInputButtonsContainer_hiipw_17{display:flex;flex-direction:column;justify-content:flex-end}._examplesNavList_o3hyg_1{list-style:none;padding-left:0;display:flex;flex-wrap:wrap;gap:10px;flex:1;justify-content:center}._example_o3hyg_1{word-break:break-word;background:#dbdbdb;border-radius:8px;display:flex;flex-direction:column;padding:20px;margin-bottom:5px;cursor:pointer}._example_o3hyg_1:hover{box-shadow:0 8px 16px #00000024,0 0 2px #0000001f;outline:2px solid rgba(115,118,225,1)}._exampleText_o3hyg_29{margin:0;font-size:22px;width:280px;min-height:100px}@media only screen and (max-height: 780px){._exampleText_o3hyg_29{font-size:20px;height:80px}}._container_1p3pb_1{display:flex;justify-content:flex-end;margin-bottom:20px;max-width:80%;margin-left:auto}._message_1p3pb_9{padding:20px;background:#e8ebfa;border-radius:8px;box-shadow:0 2px 4px #00000024,0 0 2px #0000001f;outline:transparent solid 1px}._thoughtProcess_1ooqd_1{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace;word-wrap:break-word;padding-top:12px;padding-bottom:12px}._tList_1ooqd_8{padding:20px 20px 0;display:inline-block;background:#e9e9e9}._tListItem_1ooqd_14{list-style:none;margin:auto auto auto 20px;min-height:50px;border-left:1px dashed #123bb6;padding:0 0 30px 30px;position:relative}._tListItem_1ooqd_14:last-child{border-left:0}._tListItem_1ooqd_14:before{position:absolute;left:-18px;top:-5px;content:" ";border:8px solid #d1dbfa;border-radius:500%;background:#123bb6;height:20px;width:20px}._tStep_1ooqd_40{color:#123bb6;position:relative;font-size:14px;margin-bottom:8px}._tCodeBlock_1ooqd_47{max-height:300px}._tProp_1ooqd_51{background-color:#d7d7d7;color:#333232;font-size:12px;padding:3px 10px;border-radius:10px;margin-bottom:8px}._citationImg_1ooqd_60{height:450px;max-width:100%;object-fit:contain}._supportingContentNavList_beb5d_1{list-style:none;padding-left:5px;display:flex;flex-direction:column;gap:10px}._supportingContentItem_beb5d_9{word-break:break-word;background:rgb(249,249,249);border-radius:8px;box-shadow:#0000000d 0 0 0 1px,#0000001a 0 2px 3px;outline:transparent solid 1px;display:flex;flex-direction:column;padding:20px}._supportingContentItemHeader_beb5d_23{margin:0}._supportingContentItemText_beb5d_27{margin-bottom:0;font-weight:300}._supportingContentItemImage_beb5d_32{object-fit:contain}._container_cfwv2_1{display:flex;align-items:center;gap:6px;cursor:pointer}._container_1pzrp_1{margin-top:10px} diff --git a/app/backend/static/assets/index-9a71f1dd.js b/app/backend/static/assets/index-9a71f1dd.js new file mode 100644 index 00000000..68d81f3d --- /dev/null +++ b/app/backend/static/assets/index-9a71f1dd.js @@ -0,0 +1,3 @@ +import{bE as z,bF as e,bG as St,bH as Ae,bI as Ct,bJ as yt,r as l,bK as Oe,bL as vt,bM as bt,bN as jt,bO as Tt,bP as wt,bQ as kt,bR as Nt,bS as Lt,bT as At,bU as It,bV as Pt,bW as Ie,bX as Et}from"./vendor-3b0eb66e.js";import{D as Be,S as y,I as Pe,P as Rt,T as pe,a as qt,B as fe,b as Mt,c as ue,d as Ue,C as Gt,e as Ee,L as Ot,f as Bt,g as Ut,h as Re,i as $t,j as Vt,k as Ft,l as q,m as Ht,n as Dt,o as Qt}from"./fluentui-react-cc049b91.js";import{e as zt,E as Kt,f as Wt,g as Jt,D as Xt,h as Yt}from"./fluentui-icons-cc979dd7.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const r of u.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&c(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function c(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();const Zt=".auth/me",es=".auth/refresh",ts=".auth/logout?post_logout_redirect_uri=/";async function ss(){const t=await fetch("/auth_setup");if(!t.ok)throw new Error(`auth setup response was not ok: ${t.status}`);return await t.json()}const U=await ss(),P=U.useLogin,Q=U.requireAccessControl,ns=U.msalConfig,os=U.loginRequest,as=U.tokenRequest,$e=()=>window.location.origin+U.msalConfig.auth.redirectUri,rs=()=>fetch(es).then(t=>t.ok?fetch(Zt).then(s=>s.ok?s.json().then(n=>n.length>0?{id_token:n[0].id_token,access_token:n[0].access_token,user_claims:n[0].user_claims.reduce((c,o)=>(c[o.typ]=o.val,c),{})}:null):null):null),M=await rs(),is=()=>{window.location.href=ts},me=t=>t?.getActiveAccount()!=null||M!=null,ge=t=>M?Promise.resolve(M.access_token):t.acquireTokenSilent({...as,redirectUri:$e()}).then(s=>s.accessToken).catch(s=>{console.log(s)});const cs="/assets/github-fab00c2d.svg",ls="_layout_1nrkm_1",us="_header_1nrkm_7",ds="_headerContainer_1nrkm_12",hs="_headerTitleContainer_1nrkm_20",ps="_headerLogo_1nrkm_28",ms="_headerTitle_1nrkm_20",gs="_headerNavList_1nrkm_37",xs="_headerNavPageLink_1nrkm_43",_s="_headerNavPageLinkActive_1nrkm_57",fs="_headerNavLeftMargin_1nrkm_62",Ss="_headerRightText_1nrkm_66",Cs="_microsoftLogo_1nrkm_71",ys="_githubLogo_1nrkm_76",v={layout:ls,header:us,headerContainer:ds,headerTitleContainer:hs,headerLogo:ps,headerTitle:ms,headerNavList:gs,headerNavPageLink:xs,headerNavPageLinkActive:_s,headerNavLeftMargin:fs,headerRightText:Ss,microsoftLogo:Cs,githubLogo:ys},vs="_loginButton_m8yze_1",bs={loginButton:vs},js=()=>{const{instance:t}=z(),s=t.getActiveAccount(),n=(s||M)!=null,c=()=>{t.loginPopup({...os,redirectUri:$e()}).catch(r=>console.log(r))},o=()=>{s?t.logoutPopup({mainWindowRedirectUri:"/",account:t.getActiveAccount()}).catch(r=>console.log(r)):is()},u=`Logout +${s?.username??M?.user_claims?.preferred_username}`;return e.jsx(Be,{text:n?u:"Login",className:bs.loginButton,onClick:n?o:c})},qe=()=>e.jsxs("div",{className:v.layout,children:[e.jsx("header",{className:v.header,role:"banner",children:e.jsxs("div",{className:v.headerContainer,children:[e.jsx(St,{to:"/",className:v.headerTitleContainer,children:e.jsx("h3",{className:v.headerTitle,children:"GPT + Enterprise data | Sample"})}),e.jsx("nav",{children:e.jsxs("ul",{className:v.headerNavList,children:[e.jsx("li",{children:e.jsx(Ae,{to:"/",className:({isActive:t})=>t?v.headerNavPageLinkActive:v.headerNavPageLink,children:"Chat"})}),e.jsx("li",{className:v.headerNavLeftMargin,children:e.jsx(Ae,{to:"/qa",className:({isActive:t})=>t?v.headerNavPageLinkActive:v.headerNavPageLink,children:"Ask a question"})}),e.jsx("li",{className:v.headerNavLeftMargin,children:e.jsx("a",{href:"https://aka.ms/entgptsearch",target:"_blank",title:"Github repository link",children:e.jsx("img",{src:cs,alt:"Github logo","aria-label":"Link to github repository",width:"20px",height:"20px",className:v.githubLogo})})})]})}),e.jsx("h4",{className:v.headerRightText,children:"Azure OpenAI + AI Search"}),P&&e.jsx(js,{})]})}),e.jsx(Ct,{})]}),Ts="_container_18ti9_1",ws="_chatRoot_18ti9_8",ks="_chatContainer_18ti9_13",Ns="_chatEmptyState_18ti9_21",Ls="_chatEmptyStateTitle_18ti9_31",As="_chatEmptyStateSubtitle_18ti9_38",Is="_chatMessageStream_18ti9_54",Ps="_chatMessageGpt_18ti9_66",Es="_chatMessageGptMinWidth_18ti9_73",Rs="_chatInput_18ti9_78",qs="_chatAnalysisPanel_18ti9_91",Ms="_chatSettingsSeparator_18ti9_99",Gs="_loadingLogo_18ti9_103",Os="_commandsContainer_18ti9_107",Bs="_commandButton_18ti9_112",p={container:Ts,chatRoot:ws,chatContainer:ks,chatEmptyState:Ns,chatEmptyStateTitle:Ls,chatEmptyStateSubtitle:As,chatMessageStream:Is,chatMessageGpt:Ps,chatMessageGptMinWidth:Es,chatInput:Rs,chatAnalysisPanel:qs,chatSettingsSeparator:Ms,loadingLogo:Gs,commandsContainer:Os,commandButton:Bs},ne="";function oe(t){var s={"Content-Type":"application/json"};return P&&M==null&&t&&(s.Authorization=`Bearer ${t}`),s}async function eo(t,s){const n=await fetch(`${ne}/ask`,{method:"POST",headers:oe(s),body:JSON.stringify(t)}),c=await n.json();if(n.status>299||!n.ok)throw Error(c.error||"Unknown error");return c}async function Us(t){return await(await fetch(`${ne}/config`,{method:"GET",headers:oe(t)})).json()}async function $s(t,s){return await fetch(`${ne}/chat`,{method:"POST",headers:oe(s),body:JSON.stringify(t)})}function Ve(t){return`${ne}/content/${t}`}var b=(t=>(t.Hybrid="hybrid",t.Vectors="vectors",t.Text="text",t))(b||{}),I=(t=>(t.TextAndImages="textAndImages",t.Images="images",t.Texts="texts",t))(I||{}),N=(t=>(t.Embedding="embedding",t.ImageEmbedding="imageEmbedding",t.Both="both",t))(N||{});const Vs="_answerContainer_1sqax_1",Fs="_answerLogo_1sqax_11",Hs="_answerText_1sqax_15",Ds="_selected_1sqax_34",Qs="_citationLearnMore_1sqax_38",zs="_citation_1sqax_38",Ks="_followupQuestionsList_1sqax_60",Ws="_followupQuestionLearnMore_1sqax_64",Js="_followupQuestion_1sqax_60",Xs="_supContainer_1sqax_83",Ys="_retryButton_1sqax_112",Zs="_loadingdots_1sqax_134",en="_loading_1sqax_134",j={answerContainer:Vs,answerLogo:Fs,answerText:Hs,selected:Ds,citationLearnMore:Qs,citation:zs,followupQuestionsList:Ks,followupQuestionLearnMore:Ws,followupQuestion:Js,supContainer:Xs,retryButton:Ys,loadingdots:Zs,loading:en};function tn(t,s,n){const c=[];let o=t.trim();if(s){let d=o.length;for(let m=o.length-1;m>=0&&o[m]!=="]";m--)if(o[m]==="["){d=m;break}o=o.substring(0,d)}return{answerHtml:o.split(/\[([^\]]+)\]/g).map((d,x)=>{if(x%2===0)return d;{let m;c.indexOf(d)!==-1?m=c.indexOf(d)+1:(c.push(d),m=c.length);const h=Ve(d);return yt(e.jsx("a",{className:"supContainer",title:d,onClick:()=>n(h),children:e.jsx("sup",{children:m})}))}}).join(""),citations:c}}const Fe=()=>e.jsx(zt,{primaryFill:"rgba(115, 118, 225, 1)","aria-hidden":"true","aria-label":"Answer logo"}),Me=({answer:t,isSelected:s,isStreaming:n,onCitationClicked:c,onThoughtProcessClicked:o,onSupportingContentClicked:u,onFollowupQuestionClicked:r,showFollowupQuestions:d})=>{const x=t.choices[0].context.followup_questions,m=t.choices[0].message.content,h=l.useMemo(()=>tn(m,n,c),[t]),g=Oe.sanitize(h.answerHtml);return e.jsxs(y,{className:`${j.answerContainer} ${s&&j.selected}`,verticalAlign:"space-between",children:[e.jsx(y.Item,{children:e.jsxs(y,{horizontal:!0,horizontalAlign:"space-between",children:[e.jsx(Fe,{}),e.jsxs("div",{children:[e.jsx(Pe,{style:{color:"black"},iconProps:{iconName:"Lightbulb"},title:"Show thought process",ariaLabel:"Show thought process",onClick:()=>o(),disabled:!t.choices[0].context.thoughts?.length}),e.jsx(Pe,{style:{color:"black"},iconProps:{iconName:"ClipboardList"},title:"Show supporting content",ariaLabel:"Show supporting content",onClick:()=>u(),disabled:!t.choices[0].context.data_points})]})]})}),e.jsx(y.Item,{grow:!0,children:e.jsx("div",{className:j.answerText,dangerouslySetInnerHTML:{__html:g}})}),!!h.citations.length&&e.jsx(y.Item,{children:e.jsxs(y,{horizontal:!0,wrap:!0,tokens:{childrenGap:5},children:[e.jsx("span",{className:j.citationLearnMore,children:"Citations:"}),h.citations.map((_,S)=>{const k=Ve(_);return e.jsx("a",{className:j.citation,title:_,onClick:()=>c(k),children:`${++S}. ${_}`},S)})]})}),!!x?.length&&d&&r&&e.jsx(y.Item,{children:e.jsxs(y,{horizontal:!0,wrap:!0,className:`${h.citations.length?j.followupQuestionsList:""}`,tokens:{childrenGap:6},children:[e.jsx("span",{className:j.followupQuestionLearnMore,children:"Follow-up questions:"}),x.map((_,S)=>e.jsx("a",{className:j.followupQuestion,title:_,onClick:()=>r(_),children:`${_}`},S))]})})]})},sn=()=>{const t=vt({from:{opacity:0},to:{opacity:1}});return e.jsx(bt.div,{style:{...t},children:e.jsxs(y,{className:j.answerContainer,verticalAlign:"space-between",children:[e.jsx(Fe,{}),e.jsx(y.Item,{grow:!0,children:e.jsxs("p",{className:j.answerText,children:["Generating answer",e.jsx("span",{className:j.loadingdots})]})})]})})},nn=({error:t,onRetry:s})=>e.jsxs(y,{className:j.answerContainer,verticalAlign:"space-between",children:[e.jsx(Kt,{"aria-hidden":"true","aria-label":"Error icon",primaryFill:"red"}),e.jsx(y.Item,{grow:!0,children:e.jsx("p",{className:j.answerText,children:t})}),e.jsx(Rt,{className:j.retryButton,onClick:s,text:"Retry"})]}),on="_questionInputContainer_hiipw_1",an="_questionInputTextArea_hiipw_12",rn="_questionInputButtonsContainer_hiipw_17",de={questionInputContainer:on,questionInputTextArea:an,questionInputButtonsContainer:rn},cn=({onSend:t,disabled:s,placeholder:n,clearOnSend:c,initQuestion:o})=>{const[u,r]=l.useState("");l.useEffect(()=>{o&&r(o)},[o]);const d=()=>{s||!u.trim()||(t(u),c&&r(""))},x=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),d())},m=(S,k)=>{k?k.length<=1e3&&r(k):r("")},{instance:h}=z(),g=Q&&!me(h),_=s||!u.trim()||g;return g&&(n="Please login to continue..."),e.jsxs(y,{horizontal:!0,className:de.questionInputContainer,children:[e.jsx(pe,{className:de.questionInputTextArea,disabled:g,placeholder:n,multiline:!0,resizable:!1,borderless:!0,value:u,onChange:m,onKeyDown:x}),e.jsx("div",{className:de.questionInputButtonsContainer,children:e.jsx(qt,{content:"Ask question button",relationship:"label",children:e.jsx(fe,{size:"large",icon:e.jsx(Wt,{primaryFill:"rgba(115, 118, 225, 1)"}),disabled:_,onClick:d})})})]})},ln="_examplesNavList_o3hyg_1",un="_example_o3hyg_1",dn="_exampleText_o3hyg_29",xe={examplesNavList:ln,example:un,exampleText:dn},hn=({text:t,value:s,onClick:n})=>e.jsx("div",{className:xe.example,onClick:()=>n(s),children:e.jsx("p",{className:xe.exampleText,children:t})}),pn=["What is included in my Northwind Health Plus plan that is not in standard?","What happens in a performance review?","What does a Product Manager do?"],mn=["Compare the impact of interest rates and GDP in financial markets.","What is the expected trend for the S&P 500 index over the next five years? Compare it to the past S&P 500 performance","Can you identify any correlation between oil prices and stock market trends?"],gn=({onExampleClicked:t,useGPT4V:s})=>e.jsx("ul",{className:xe.examplesNavList,children:(s?mn:pn).map((n,c)=>e.jsx("li",{children:e.jsx(hn,{text:n,value:n,onClick:t})},c))}),xn="_container_1p3pb_1",_n="_message_1p3pb_9",Ge={container:xn,message:_n},se=({message:t})=>e.jsx("div",{className:Ge.container,children:e.jsx("div",{className:Ge.message,children:t})}),fn="_thoughtProcess_1ooqd_1",Sn="_tList_1ooqd_8",Cn="_tListItem_1ooqd_14",yn="_tStep_1ooqd_40",vn="_tCodeBlock_1ooqd_47",bn="_tProp_1ooqd_51",jn="_citationImg_1ooqd_60",B={thoughtProcess:fn,tList:Sn,tListItem:Cn,tStep:yn,tCodeBlock:vn,tProp:bn,citationImg:jn};function Tn(t){const s=t.split(": "),n=s[0],c=Oe.sanitize(s.slice(1).join(": "));return{title:n,content:c}}const wn="_supportingContentNavList_beb5d_1",kn="_supportingContentItem_beb5d_9",Nn="_supportingContentItemHeader_beb5d_23",Ln="_supportingContentItemText_beb5d_27",An="_supportingContentItemImage_beb5d_32",D={supportingContentNavList:wn,supportingContentItem:kn,supportingContentItemHeader:Nn,supportingContentItemText:Ln,supportingContentItemImage:An},In=({supportingContent:t})=>{const s=Array.isArray(t)?t:t.text,n=Array.isArray(t)?[]:t?.images;return e.jsxs("ul",{className:D.supportingContentNavList,children:[s.map((c,o)=>{const u=Tn(c);return e.jsxs("li",{className:D.supportingContentItem,children:[e.jsx("h4",{className:D.supportingContentItemHeader,children:u.title}),e.jsx("p",{className:D.supportingContentItemText,dangerouslySetInnerHTML:{__html:u.content}})]},o)}),n?.map((c,o)=>e.jsx("img",{className:D.supportingContentItemImage,src:c.url},o))]})};var L=(t=>(t.ThoughtProcessTab="thoughtProcess",t.SupportingContentTab="supportingContent",t.CitationTab="citation",t))(L||{});const Pn=({thoughts:t})=>e.jsx("ul",{className:B.tList,children:t.map((s,n)=>e.jsxs("li",{className:B.tListItem,children:[e.jsx("div",{className:B.tStep,children:s.title}),e.jsx(y,{horizontal:!0,tokens:{childrenGap:5},children:s.props&&(Object.keys(s.props)||[]).map(c=>e.jsxs("span",{className:B.tProp,children:[c,": ",JSON.stringify(s.props?.[c])]}))}),Array.isArray(s.description)?e.jsx(jt,{language:"json",wrapLongLines:!0,className:B.tCodeBlock,children:JSON.stringify(s.description,null,2)}):e.jsx("div",{children:s.description})]},n))}),he={disabled:!0,style:{color:"grey"}},En=({answer:t,activeTab:s,activeCitation:n,citationHeight:c,className:o,onActiveTabChanged:u})=>{const r=!t.choices[0].context.thoughts,d=!t.choices[0].context.data_points,x=!n,[m,h]=l.useState(""),g=P?z().instance:void 0,_=async()=>{const S=g?await ge(g):void 0;if(n){const k=n.indexOf("#")?n.split("#")[1]:"",K=await(await fetch(n,{method:"GET",headers:oe(S)})).blob();let W=URL.createObjectURL(K);k&&(W+="#"+k),h(W)}};return l.useEffect(()=>{_()},[]),e.jsxs(Mt,{className:o,selectedKey:s,onLinkClick:S=>S&&u(S.props.itemKey),children:[e.jsx(ue,{itemKey:L.ThoughtProcessTab,headerText:"Thought process",headerButtonProps:r?he:void 0,children:e.jsx(Pn,{thoughts:t.choices[0].context.thoughts||[]})}),e.jsx(ue,{itemKey:L.SupportingContentTab,headerText:"Supporting content",headerButtonProps:d?he:void 0,children:e.jsx(In,{supportingContent:t.choices[0].context.data_points})}),e.jsx(ue,{itemKey:L.CitationTab,headerText:"Citation",headerButtonProps:x?he:void 0,children:n?.endsWith(".png")?e.jsx("img",{src:m,className:B.citationImg}):e.jsx("iframe",{title:"Citation",src:m,width:"100%",height:c})})]})},Rn="_container_cfwv2_1",qn={container:Rn},Mn=({className:t,onClick:s})=>e.jsx("div",{className:`${qn.container} ${t??""}`,children:e.jsx(fe,{icon:e.jsx(Jt,{}),onClick:s,children:"Developer settings"})}),Gn="_container_cfwv2_1",On={container:Gn},Bn=({className:t,disabled:s,onClick:n})=>e.jsx("div",{className:`${On.container} ${t??""}`,children:e.jsx(fe,{icon:e.jsx(Xt,{}),disabled:s,onClick:n,children:"Clear chat"})}),Un="_container_1pzrp_1",$n={container:Un},Vn=[{key:N.Embedding,text:"Text Embeddings"},{key:N.ImageEmbedding,text:"Image Embeddings"},{key:N.Both,text:"Text and Image embeddings"}],Fn=({updateRetrievalMode:t,updateVectorFields:s,showImageOptions:n})=>{const[c,o]=l.useState(b.Hybrid),[u,r]=l.useState(),d=(m,h)=>{o(h?.data||b.Hybrid),t(h?.data||b.Hybrid)},x=(m,h)=>{h&&r(h.key);let g;h?.key==="both"?g=[N.Embedding,N.ImageEmbedding]:g=[h?.key],s(g)};return l.useEffect(()=>{s(n?[N.Embedding,N.ImageEmbedding]:[N.Embedding])},[n]),e.jsxs(y,{className:$n.container,tokens:{childrenGap:10},children:[e.jsx(Ue,{label:"Retrieval mode",options:[{key:"hybrid",text:"Vectors + Text (Hybrid)",selected:c==b.Hybrid,data:b.Hybrid},{key:"vectors",text:"Vectors",selected:c==b.Vectors,data:b.Vectors},{key:"text",text:"Text",selected:c==b.Text,data:b.Text}],required:!0,onChange:d}),n&&[b.Vectors,b.Hybrid].includes(c)&&e.jsx(Gt,{options:Vn,onChange:x,selectedKey:u,defaultSelectedKey:N.Both,label:"Vector Fields (Multi-query vector search)"})]})},Hn=()=>{const{instance:t}=z(),s=t.getActiveAccount(),n=r=>typeof r=="string"?r:JSON.stringify(r),o=(r=>Object.keys(r??{}).map(d=>{let x=d;try{const h=new URL(d).pathname.split("/");d=h[h.length-1]}catch{}return{name:d,value:n((r??{})[x])}}))(s?.idTokenClaims??M?.user_claims),u=[Ee({columnId:"name",compare:(r,d)=>r.name.localeCompare(d.name),renderHeaderCell:()=>"Name",renderCell:r=>r.name}),Ee({columnId:"value",compare:(r,d)=>r.value.localeCompare(d.value),renderHeaderCell:()=>"Value",renderCell:r=>r.value})];return e.jsxs("div",{children:[e.jsx(Ot,{children:"ID Token Claims"}),e.jsxs(Bt,{items:o,columns:u,sortable:!0,getRowId:r=>r.name,children:[e.jsx(Ut,{children:e.jsx(Re,{children:({renderHeaderCell:r})=>e.jsx($t,{children:r()})})}),e.jsx(Vt,{children:({item:r,rowId:d})=>e.jsx(Re,{children:({renderCell:x})=>e.jsx(Ft,{children:x(r)})},d)})]})]})},Dn="_container_1pzrp_1",Qn={container:Dn},zn=({updateGPT4VInputs:t,updateUseGPT4V:s,isUseGPT4V:n,gpt4vInputs:c})=>{const[o,u]=l.useState(n),[r,d]=l.useState(c||I.TextAndImages),x=(h,g)=>{s(!!g),u(!!g)},m=(h,g)=>{if(g){const _=g.key;t(_||I.TextAndImages),_&&d(_)}};return l.useEffect(()=>{o&&t(I.TextAndImages)},[o]),e.jsxs(y,{className:Qn.container,tokens:{childrenGap:10},children:[e.jsx(q,{checked:o,label:"Use GPT-4 Turbo with Vision",onChange:x}),o&&e.jsx(Ue,{selectedKey:r,label:"GPT-4 Turbo with Vision Inputs",options:[{key:I.TextAndImages,text:"Images and text from index"},{text:"Images only",key:I.Images},{text:"Text only",key:I.Texts}],required:!0,onChange:m})]})},Kn=()=>{const[t,s]=l.useState(!1),[n,c]=l.useState(""),[o,u]=l.useState(.3),[r,d]=l.useState(3),[x,m]=l.useState(b.Hybrid),[h,g]=l.useState(!0),[_,S]=l.useState(!0),[k,Se]=l.useState(!1),[K,W]=l.useState(""),[J,He]=l.useState(!1),[De,Qe]=l.useState([N.Embedding]),[Ce,ze]=l.useState(!1),[ye,Ke]=l.useState(!1),[ve,We]=l.useState(I.TextAndImages),[X,Je]=l.useState(!1),E=l.useRef(""),ae=l.useRef(null),[Y,Z]=l.useState(!1),[be,re]=l.useState(!1),[ee,ie]=l.useState(),[je,ce]=l.useState(),[$,G]=l.useState(void 0),[V,Te]=l.useState(0),[T,te]=l.useState([]),[we,ke]=l.useState([]),[Ne,Xe]=l.useState(!1),[Ye,Ze]=l.useState(!1),[et,tt]=l.useState(!1),st=async()=>{const i=O?await ge(O):void 0;Us(i).then(a=>{Xe(a.showGPT4VOptions),g(a.showSemanticRankerOption),Ze(a.showSemanticRankerOption),tt(a.showVectorOption),a.showVectorOption||m(b.Text)})},nt=async(i,a,w,le)=>{let A="",f={};const xt=C=>new Promise(_t=>{setTimeout(()=>{A+=C;const ft={...f,choices:[{...f.choices[0],message:{content:A,role:f.choices[0].message.role}}]};ke([...a,[i,ft]]),_t(null)},33)});try{re(!0);for await(const C of Tt(le))if(C.choices&&C.choices[0].context&&C.choices[0].context.data_points)C.choices[0].message=C.choices[0].delta,f=C;else if(C.choices&&C.choices[0].delta.content)Z(!1),await xt(C.choices[0].delta.content);else if(C.choices&&C.choices[0].context)f.choices[0].context={...f.choices[0].context,...C.choices[0].context};else if(C.error)throw Error(C.error)}finally{re(!1)}return{...f,choices:[{...f.choices[0],message:{content:A,role:f.choices[0].message.role}}]}},O=P?z().instance:void 0,F=async i=>{E.current=i,ee&&ie(void 0),Z(!0),ce(void 0),G(void 0);const a=O?await ge(O):void 0;try{const le={messages:[...T.flatMap(f=>[{content:f[0],role:"user"},{content:f[1].choices[0].message.content,role:"assistant"}]),{content:i,role:"user"}],stream:_,context:{overrides:{prompt_template:n.length===0?void 0:n,exclude_category:K.length===0?void 0:K,top:r,temperature:o,retrieval_mode:x,semantic_ranker:h,semantic_captions:k,suggest_followup_questions:J,use_oid_security_filter:Ce,use_groups_security_filter:ye,vector_fields:De,use_gpt4v:X,gpt4v_input:ve}},session_state:T.length?T[T.length-1][1].choices[0].session_state:null},A=await $s(le,a);if(!A.body)throw Error("No response body");if(_){const f=await nt(i,T,te,A.body);te([...T,[i,f]])}else{const f=await A.json();if(A.status>299||!A.ok)throw Error(f.error||"Unknown error");te([...T,[i,f]])}}catch(w){ie(w)}finally{Z(!1)}},ot=()=>{E.current="",ee&&ie(void 0),ce(void 0),G(void 0),te([]),ke([]),Z(!1),re(!1)};l.useEffect(()=>ae.current?.scrollIntoView({behavior:"smooth"}),[Y]),l.useEffect(()=>ae.current?.scrollIntoView({behavior:"auto"}),[we]),l.useEffect(()=>{st()},[]);const at=(i,a)=>{c(a||"")},rt=(i,a,w)=>{u(i)},it=(i,a)=>{d(parseInt(a||"3"))},ct=(i,a)=>{g(!!a)},lt=(i,a)=>{Se(!!a)},ut=(i,a)=>{S(!!a)},dt=(i,a)=>{W(a||"")},ht=(i,a)=>{He(!!a)},pt=(i,a)=>{ze(!!a)},mt=(i,a)=>{Ke(!!a)},gt=i=>{F(i)},Le=(i,a)=>{je===i&&$===L.CitationTab&&V===a?G(void 0):(ce(i),G(L.CitationTab)),Te(a)},H=(i,a)=>{G($===i&&V===a?void 0:i),Te(a)};return e.jsxs("div",{className:p.container,children:[e.jsxs("div",{className:p.commandsContainer,children:[e.jsx(Bn,{className:p.commandButton,onClick:ot,disabled:!E.current||Y}),e.jsx(Mn,{className:p.commandButton,onClick:()=>s(!t)})]}),e.jsxs("div",{className:p.chatRoot,children:[e.jsxs("div",{className:p.chatContainer,children:[E.current?e.jsxs("div",{className:p.chatMessageStream,children:[be&&we.map((i,a)=>e.jsxs("div",{children:[e.jsx(se,{message:i[0]}),e.jsx("div",{className:p.chatMessageGpt,children:e.jsx(Me,{isStreaming:!0,answer:i[1],isSelected:!1,onCitationClicked:w=>Le(w,a),onThoughtProcessClicked:()=>H(L.ThoughtProcessTab,a),onSupportingContentClicked:()=>H(L.SupportingContentTab,a),onFollowupQuestionClicked:w=>F(w),showFollowupQuestions:J&&T.length-1===a},a)})]},a)),!be&&T.map((i,a)=>e.jsxs("div",{children:[e.jsx(se,{message:i[0]}),e.jsx("div",{className:p.chatMessageGpt,children:e.jsx(Me,{isStreaming:!1,answer:i[1],isSelected:V===a&&$!==void 0,onCitationClicked:w=>Le(w,a),onThoughtProcessClicked:()=>H(L.ThoughtProcessTab,a),onSupportingContentClicked:()=>H(L.SupportingContentTab,a),onFollowupQuestionClicked:w=>F(w),showFollowupQuestions:J&&T.length-1===a},a)})]},a)),Y&&e.jsxs(e.Fragment,{children:[e.jsx(se,{message:E.current}),e.jsx("div",{className:p.chatMessageGptMinWidth,children:e.jsx(sn,{})})]}),ee?e.jsxs(e.Fragment,{children:[e.jsx(se,{message:E.current}),e.jsx("div",{className:p.chatMessageGptMinWidth,children:e.jsx(nn,{error:ee.toString(),onRetry:()=>F(E.current)})})]}):null,e.jsx("div",{ref:ae})]}):e.jsxs("div",{className:p.chatEmptyState,children:[e.jsx(Yt,{fontSize:"120px",primaryFill:"rgba(115, 118, 225, 1)","aria-hidden":"true","aria-label":"Chat logo"}),e.jsx("h1",{className:p.chatEmptyStateTitle,children:"Chat with your data"}),e.jsx("h2",{className:p.chatEmptyStateSubtitle,children:"Ask anything or try an example"}),e.jsx(gn,{onExampleClicked:gt,useGPT4V:X})]}),e.jsx("div",{className:p.chatInput,children:e.jsx(cn,{clearOnSend:!0,placeholder:"Type a new question (e.g. does my plan cover annual eye exams?)",disabled:Y,onSend:i=>F(i)})})]}),T.length>0&&$&&e.jsx(En,{className:p.chatAnalysisPanel,activeCitation:je,onActiveTabChanged:i=>H(i,V),citationHeight:"810px",answer:T[V][1],activeTab:$}),e.jsxs(Ht,{headerText:"Configure answer generation",isOpen:t,isBlocking:!1,onDismiss:()=>s(!1),closeButtonAriaLabel:"Close",onRenderFooterContent:()=>e.jsx(Be,{onClick:()=>s(!1),children:"Close"}),isFooterAtBottom:!0,children:[e.jsx(pe,{className:p.chatSettingsSeparator,defaultValue:n,label:"Override prompt template",multiline:!0,autoAdjustHeight:!0,onChange:at}),e.jsx(Dt,{className:p.chatSettingsSeparator,label:"Temperature",min:0,max:1,step:.1,defaultValue:o,onChange:rt,showValue:!0,snapToStep:!0}),e.jsx(Qt,{className:p.chatSettingsSeparator,label:"Retrieve this many search results:",min:1,max:50,defaultValue:r.toString(),onChange:it}),e.jsx(pe,{className:p.chatSettingsSeparator,label:"Exclude category",onChange:dt}),Ye&&e.jsx(q,{className:p.chatSettingsSeparator,checked:h,label:"Use semantic ranker for retrieval",onChange:ct}),e.jsx(q,{className:p.chatSettingsSeparator,checked:k,label:"Use query-contextual summaries instead of whole documents",onChange:lt,disabled:!h}),e.jsx(q,{className:p.chatSettingsSeparator,checked:J,label:"Suggest follow-up questions",onChange:ht}),Ne&&e.jsx(zn,{gpt4vInputs:ve,isUseGPT4V:X,updateUseGPT4V:i=>{Je(i)},updateGPT4VInputs:i=>We(i)}),et&&e.jsx(Fn,{showImageOptions:X&&Ne,updateVectorFields:i=>Qe(i),updateRetrievalMode:i=>m(i)}),P&&e.jsx(q,{className:p.chatSettingsSeparator,checked:Ce||Q,label:"Use oid security filter",disabled:!me(O)||Q,onChange:pt}),P&&e.jsx(q,{className:p.chatSettingsSeparator,checked:ye||Q,label:"Use groups security filter",disabled:!me(O)||Q,onChange:mt}),e.jsx(q,{className:p.chatSettingsSeparator,checked:_,label:"Stream chat completion responses",onChange:ut}),P&&e.jsx(Hn,{})]})]})]})};var _e;if(P){var R=new wt(ns);!R.getActiveAccount()&&R.getAllAccounts().length>0&&R.setActiveAccount(R.getActiveAccount()),R.addEventCallback(t=>{if(t.eventType===kt.LOGIN_SUCCESS&&t.payload){const s=t.payload;R.setActiveAccount(s)}}),_e=e.jsx(Et,{instance:R,children:e.jsx(qe,{})})}else _e=e.jsx(qe,{});Nt();const Wn=Lt([{path:"/",element:_e,children:[{index:!0,element:e.jsx(Kn,{})},{path:"qa",lazy:()=>Ie(()=>import("./Ask-2a9371aa.js"),["assets/Ask-2a9371aa.js","assets/vendor-3b0eb66e.js","assets/fluentui-react-cc049b91.js","assets/fluentui-icons-cc979dd7.js","assets/Ask-4461589d.css"])},{path:"*",lazy:()=>Ie(()=>import("./NoPage-53567df7.js"),["assets/NoPage-53567df7.js","assets/vendor-3b0eb66e.js"])}]}]);At.createRoot(document.getElementById("root")).render(e.jsx(It.StrictMode,{children:e.jsx(Pt,{router:Wn})}));export{Me as A,gn as E,I as G,cn as Q,b as R,Mn as S,Hn as T,N as V,L as a,nn as b,En as c,zn as d,Fn as e,Us as f,ge as g,eo as h,me as i,Q as r,P as u}; +//# sourceMappingURL=index-9a71f1dd.js.map diff --git a/app/backend/static/assets/index-9a71f1dd.js.map b/app/backend/static/assets/index-9a71f1dd.js.map new file mode 100644 index 00000000..60abc888 --- /dev/null +++ b/app/backend/static/assets/index-9a71f1dd.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"2tCAIA,MAAMA,GAA0B,WAC1BC,GAAiC,gBACjCC,GAA2B,0CA8CjC,eAAeC,IAAqC,CAC1C,MAAAC,EAAW,MAAM,MAAM,aAAa,EACtC,IAACA,EAAS,GACV,MAAM,IAAI,MAAM,mCAAmCA,EAAS,MAAM,EAAE,EAEjE,aAAMA,EAAS,MAC1B,CAEA,MAAMC,EAAY,MAAMF,KAEXG,EAAWD,EAAU,SAErBE,EAAuBF,EAAU,qBAOjCG,GAAaH,EAAU,WAQv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IAACkL,EAAA,CACG,UAAWhL,EAAO,sBAClB,QAASwM,IAA2BlO,EACpC,MAAM,6BACN,SAAU,CAACY,GAAWC,CAAM,GAAKb,EACjC,SAAUoR,EAAA,CACd,EAGJ5P,EAAA,IAACkL,EAAA,CACG,UAAWhL,EAAO,sBAClB,QAAS4L,EACT,MAAM,mCACN,SAAU0D,EAAA,CACd,EACCjR,SAAa6K,GAAmB,KACrC,GACJ,CACJ,GAER,ECjdA,IAAIuH,GACJ,GAAIpS,EAAU,CACN,IAAAqS,EAAe,IAAIC,GAAwBpS,EAAU,EAGrD,CAACmS,EAAa,iBAAiB,GAAKA,EAAa,eAAe,EAAE,OAAS,GAE9DA,EAAA,iBAAiBA,EAAa,iBAAkB,GAIjEA,EAAa,iBAA0B/B,GAAA,CACnC,GAAIA,EAAM,YAAciC,GAAU,eAAiBjC,EAAM,QAAS,CAC9D,MAAMkC,EAAUlC,EAAM,QACtB+B,EAAa,iBAAiBG,CAAO,CACzC,EACH,EAEDJ,SACKK,GAAa,UAAUJ,EACpB,SAAA5Q,MAACG,IAAO,EACZ,EAER,MACIwQ,SAAUxQ,GAAO,IAGrB8Q,KAEA,MAAMC,GAASC,GAAiB,CAC5B,CACI,KAAM,IACN,QAASR,GACT,SAAU,CACN,CACI,MAAO,GACP,cAAUxF,GAAK,GACnB,EACA,CACI,KAAM,KACN,KAAM,IAAMiG,GAAA,WAAO,mBAAiB,2JACxC,EACA,CACI,KAAM,IACN,KAAM,IAAMA,GAAA,WAAO,sBAAgB,4DACvC,CACJ,CACJ,CACJ,CAAC,EAEDC,GAAS,WAAW,SAAS,eAAe,MAAM,CAAgB,EAAE,aAC/DC,GAAM,WAAN,CACG,SAACtR,EAAA,IAAAuR,GAAA,CAAe,OAAAL,EAAgB,GACpC,CACJ","names":["appServicesAuthTokenUrl","appServicesAuthTokenRefreshUrl","appServicesAuthLogoutUrl","fetchAuthSetup","response","authSetup","useLogin","requireAccessControl","msalConfig","loginRequest","tokenRequest","getRedirectUri","getAppServicesToken","r","json","acc","item","appServicesToken","appServicesLogout","isLoggedIn","client","getToken","error","github","LoginButton","instance","useMsal","activeAccount","handleLoginPopup","handleLogoutPopup","logoutText","jsx","DefaultButton","styles","Layout","jsxs","Link","NavLink","isActive","Outlet","BACKEND_URI","getHeaders","idToken","headers","askApi","request","parsedResponse","configApi","chatApi","getCitationFilePath","citation","RetrievalMode","GPT4VInput","VectorFieldOptions","parseAnswerToHtml","answer","isStreaming","onCitationClicked","citations","parsedAnswer","lastIndex","i","part","index","citationIndex","path","renderToStaticMarkup","AnswerIcon","Sparkle28Filled","Answer","isSelected","onThoughtProcessClicked","onSupportingContentClicked","onFollowupQuestionClicked","showFollowupQuestions","followupQuestions","messageContent","useMemo","sanitizedAnswerHtml","DOMPurify","Stack","IconButton","x","AnswerLoading","animatedStyles","useSpring","animated","AnswerError","onRetry","ErrorCircle24Regular","PrimaryButton","QuestionInput","onSend","disabled","placeholder","clearOnSend","initQuestion","question","setQuestion","useState","useEffect","sendQuestion","onEnterPress","ev","onQuestionChange","_ev","newValue","disableRequiredAccessControl","sendQuestionDisabled","TextField","Tooltip","Button","Send28Filled","Example","text","value","onClick","DEFAULT_EXAMPLES","GPT4V_EXAMPLES","ExampleList","onExampleClicked","useGPT4V","UserChatMessage","message","parseSupportingContentItem","parts","title","content","SupportingContent","supportingContent","textItems","imageItems","ind","parsed","img","AnalysisPanelTabs","ThoughtProcess","thoughts","t","k","SyntaxHighlighter","pivotItemDisabledStyle","AnalysisPanel","activeTab","activeCitation","citationHeight","className","onActiveTabChanged","isDisabledThoughtProcessTab","isDisabledSupportingContentTab","isDisabledCitationTab","setCitation","fetchCitation","token","originalHash","citationContent","citationObjectUrl","Pivot","pivotItem","PivotItem","SettingsButton","Settings24Regular","ClearChatButton","Delete24Regular","vectorFields","VectorSettings","updateRetrievalMode","updateVectorFields","showImageOptions","retrievalMode","setRetrievalMode","vectorFieldOption","setVectorFieldOption","onRetrievalModeChange","option","onVectorFieldsChange","list","Dropdown","ChoiceGroup","TokenClaimsDisplay","ToString","a","items","o","key","originalKey","columns","createTableColumn","b","Label","DataGrid","DataGridHeader","DataGridRow","renderHeaderCell","DataGridHeaderCell","DataGridBody","rowId","renderCell","DataGridCell","GPT4VSettings","updateGPT4VInputs","updateUseGPT4V","isUseGPT4V","gpt4vInputs","setUseGPT4V","onuseGPT4V","checked","onSetGPT4VInput","data","Checkbox","Chat","isConfigPanelOpen","setIsConfigPanelOpen","promptTemplate","setPromptTemplate","temperature","setTemperature","retrieveCount","setRetrieveCount","useSemanticRanker","setUseSemanticRanker","shouldStream","setShouldStream","useSemanticCaptions","setUseSemanticCaptions","excludeCategory","setExcludeCategory","useSuggestFollowupQuestions","setUseSuggestFollowupQuestions","vectorFieldList","setVectorFieldList","useOidSecurityFilter","setUseOidSecurityFilter","useGroupsSecurityFilter","setUseGroupsSecurityFilter","gpt4vInput","setGPT4VInput","lastQuestionRef","useRef","chatMessageStreamEnd","isLoading","setIsLoading","setIsStreaming","setError","setActiveCitation","activeAnalysisPanelTab","setActiveAnalysisPanelTab","selectedAnswer","setSelectedAnswer","answers","setAnswers","streamedAnswers","setStreamedAnswers","showGPT4VOptions","setShowGPT4VOptions","showSemanticRankerOption","setShowSemanticRankerOption","showVectorOption","setShowVectorOption","getConfig","config","handleAsyncRequest","responseBody","askResponse","updateState","newContent","resolve","latestResponse","event","readNDJSONStream","makeApiRequest","e","clearChat","onPromptTemplateChange","onTemperatureChange","range","onRetrieveCountChange","onUseSemanticRankerChange","onUseSemanticCaptionsChange","onShouldStreamChange","onExcludeCategoryChanged","onUseSuggestFollowupQuestionsChange","onUseOidSecurityFilterChange","onUseGroupsSecurityFilterChange","example","onShowCitation","onToggleTab","tab","streamedAnswer","c","q","Fragment","SparkleFilled","Panel","Slider","SpinButton","inputs","options","layout","msalInstance","PublicClientApplication","EventType","account","MsalProvider","initializeIcons","router","createHashRouter","__vitePreload","ReactDOM","React","RouterProvider"],"sources":["../../../frontend/src/authConfig.ts","../../../frontend/src/assets/github.svg","../../../frontend/src/components/LoginButton/LoginButton.tsx","../../../frontend/src/pages/layout/Layout.tsx","../../../frontend/src/api/api.ts","../../../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/SupportingContent/SupportingContentParser.ts","../../../frontend/src/components/SupportingContent/SupportingContent.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/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx","../../../frontend/src/components/GPT4VSettings/GPT4VSettings.tsx","../../../frontend/src/pages/chat/Chat.tsx","../../../frontend/src/index.tsx"],"sourcesContent":["// Refactored from https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/1-Authentication/1-sign-in/SPA/src/authConfig.js\n\nimport { IPublicClientApplication } from \"@azure/msal-browser\";\n\nconst appServicesAuthTokenUrl = \".auth/me\";\nconst appServicesAuthTokenRefreshUrl = \".auth/refresh\";\nconst appServicesAuthLogoutUrl = \".auth/logout?post_logout_redirect_uri=/\";\n\ninterface AppServicesToken {\n id_token: string;\n access_token: string;\n user_claims: Record;\n}\n\ninterface AuthSetup {\n // Set to true if login elements should be shown in the UI\n useLogin: boolean;\n // Set to true if access control is enforced by the application\n requireAccessControl: boolean;\n /**\n * Configuration object to be passed to MSAL instance on creation.\n * For a full list of MSAL.js configuration parameters, visit:\n * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md\n */\n msalConfig: {\n auth: {\n clientId: string; // Client app id used for login\n authority: string; // Directory to use for login https://learn.microsoft.com/azure/active-directory/develop/msal-client-application-configuration#authority\n redirectUri: string; // Points to window.location.origin. You must register this URI on Azure Portal/App Registration.\n postLogoutRedirectUri: string; // Indicates the page to navigate after logout.\n navigateToLoginRequestUrl: boolean; // If \"true\", will navigate back to the original request location before processing the auth code response.\n };\n cache: {\n cacheLocation: string; // Configures cache location. \"sessionStorage\" is more secure, but \"localStorage\" gives you SSO between tabs.\n storeAuthStateInCookie: boolean; // Set this to \"true\" if you are having issues on IE11 or Edge\n };\n };\n loginRequest: {\n /**\n * Scopes you add here will be prompted for user consent during sign-in.\n * By default, MSAL.js will add OIDC scopes (openid, profile, email) to any login request.\n * For more information about OIDC scopes, visit:\n * https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes\n */\n scopes: Array;\n };\n tokenRequest: {\n scopes: Array;\n };\n}\n\n// Fetch the auth setup JSON data from the API if not already cached\nasync function fetchAuthSetup(): Promise {\n const response = await fetch(\"/auth_setup\");\n if (!response.ok) {\n throw new Error(`auth setup response was not ok: ${response.status}`);\n }\n return await response.json();\n}\n\nconst authSetup = await fetchAuthSetup();\n\nexport const useLogin = authSetup.useLogin;\n\nexport const requireAccessControl = authSetup.requireAccessControl;\n\n/**\n * Configuration object to be passed to MSAL instance on creation.\n * For a full list of MSAL.js configuration parameters, visit:\n * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md\n */\nexport const msalConfig = authSetup.msalConfig;\n\n/**\n * Scopes you add here will be prompted for user consent during sign-in.\n * By default, MSAL.js will add OIDC scopes (openid, profile, email) to any login request.\n * For more information about OIDC scopes, visit:\n * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes\n */\nexport const loginRequest = authSetup.loginRequest;\n\nconst tokenRequest = authSetup.tokenRequest;\n\n// Build an absolute redirect URI using the current window's location and the relative redirect URI from auth setup\nexport const getRedirectUri = () => {\n return window.location.origin + authSetup.msalConfig.auth.redirectUri;\n};\n\n// Get an access token if a user logged in using app services authentication\n// Returns null if the app doesn't support app services authentication\nconst getAppServicesToken = (): Promise => {\n return fetch(appServicesAuthTokenRefreshUrl).then(r => {\n if (r.ok) {\n return fetch(appServicesAuthTokenUrl).then(r => {\n if (r.ok) {\n return r.json().then(json => {\n if (json.length > 0) {\n return {\n id_token: json[0][\"id_token\"] as string,\n access_token: json[0][\"access_token\"] as string,\n user_claims: json[0][\"user_claims\"].reduce((acc: Record, item: Record) => {\n acc[item.typ] = item.val;\n return acc;\n }, {}) as Record\n };\n }\n\n return null;\n });\n }\n\n return null;\n });\n }\n\n return null;\n });\n};\n\nexport const appServicesToken = await getAppServicesToken();\n\n// Sign out of app services\n// Learn more at https://learn.microsoft.com/azure/app-service/configure-authentication-customize-sign-in-out#sign-out-of-a-session\nexport const appServicesLogout = () => {\n window.location.href = appServicesAuthLogoutUrl;\n};\n\n// Determine if the user is logged in\n// The user may have logged in either using the app services login or the on-page login\nexport const isLoggedIn = (client: IPublicClientApplication | undefined): boolean => {\n return client?.getActiveAccount() != null || appServicesToken != null;\n};\n\n// Get an access token for use with the API server.\n// ID token received when logging in may not be used for this purpose because it has the incorrect audience\n// Use the access token from app services login if available\nexport const getToken = (client: IPublicClientApplication): Promise => {\n if (appServicesToken) {\n return Promise.resolve(appServicesToken.access_token);\n }\n\n return client\n .acquireTokenSilent({\n ...tokenRequest,\n redirectUri: getRedirectUri()\n })\n .then(r => r.accessToken)\n .catch(error => {\n console.log(error);\n return undefined;\n });\n};\n","export default \"__VITE_ASSET__4e6ad5ae__\"","import { DefaultButton } from \"@fluentui/react\";\nimport { useMsal } from \"@azure/msal-react\";\n\nimport styles from \"./LoginButton.module.css\";\nimport { getRedirectUri, loginRequest } from \"../../authConfig\";\nimport { appServicesToken, appServicesLogout } from \"../../authConfig\";\n\nexport const LoginButton = () => {\n const { instance } = useMsal();\n const activeAccount = instance.getActiveAccount();\n const isLoggedIn = (activeAccount || appServicesToken) != null;\n\n const handleLoginPopup = () => {\n /**\n * When using popup and silent APIs, we recommend setting the redirectUri to a blank page or a page\n * that does not implement MSAL. Keep in mind that all redirect routes must be registered with the application\n * For more information, please follow this link: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations\n */\n instance\n .loginPopup({\n ...loginRequest,\n redirectUri: getRedirectUri()\n })\n .catch(error => console.log(error));\n };\n const handleLogoutPopup = () => {\n if (activeAccount) {\n instance\n .logoutPopup({\n mainWindowRedirectUri: \"/\", // redirects the top level app after logout\n account: instance.getActiveAccount()\n })\n .catch(error => console.log(error));\n } else {\n appServicesLogout();\n }\n };\n const logoutText = `Logout\\n${activeAccount?.username ?? appServicesToken?.user_claims?.preferred_username}`;\n return (\n \n );\n};\n","import { Outlet, NavLink, Link } from \"react-router-dom\";\n\nimport github from \"../../assets/github.svg\";\n\nimport styles from \"./Layout.module.css\";\n\nimport { useLogin } from \"../../authConfig\";\n\nimport { LoginButton } from \"../../components/LoginButton\";\n\nconst Layout = () => {\n return (\n
\n
\n
\n \n

GPT + Enterprise data | Sample

\n \n \n

Azure OpenAI + AI Search

\n {useLogin && }\n
\n
\n\n \n
\n );\n};\n\nexport default Layout;\n","const BACKEND_URI = \"\";\n\nimport { ChatAppResponse, ChatAppResponseOrError, ChatAppRequest, Config } from \"./models\";\nimport { useLogin, appServicesToken } from \"../authConfig\";\n\nexport function getHeaders(idToken: string | undefined): Record {\n var headers: Record = {\n \"Content-Type\": \"application/json\"\n };\n // If using login and not using app services, add the id token of the logged in account as the authorization\n if (useLogin && appServicesToken == null) {\n if (idToken) {\n headers[\"Authorization\"] = `Bearer ${idToken}`;\n }\n }\n\n return headers;\n}\n\nexport async function askApi(request: ChatAppRequest, idToken: string | undefined): Promise {\n const response = await fetch(`${BACKEND_URI}/ask`, {\n method: \"POST\",\n headers: getHeaders(idToken),\n body: JSON.stringify(request)\n });\n\n const parsedResponse: ChatAppResponseOrError = await response.json();\n if (response.status > 299 || !response.ok) {\n throw Error(parsedResponse.error || \"Unknown error\");\n }\n\n return parsedResponse as ChatAppResponse;\n}\n\nexport async function configApi(idToken: string | undefined): Promise {\n const response = await fetch(`${BACKEND_URI}/config`, {\n method: \"GET\",\n headers: getHeaders(idToken)\n });\n\n return (await response.json()) as Config;\n}\n\nexport async function chatApi(request: ChatAppRequest, idToken: string | undefined): Promise {\n return await fetch(`${BACKEND_URI}/chat`, {\n method: \"POST\",\n headers: getHeaders(idToken),\n body: JSON.stringify(request)\n });\n}\n\nexport function getCitationFilePath(citation: string): string {\n return `${BACKEND_URI}/content/${citation}`;\n}\n","export const enum RetrievalMode {\n Hybrid = \"hybrid\",\n Vectors = \"vectors\",\n Text = \"text\"\n}\n\nexport const enum GPT4VInput {\n TextAndImages = \"textAndImages\",\n Images = \"images\",\n Texts = \"texts\"\n}\n\nexport const enum VectorFieldOptions {\n Embedding = \"embedding\",\n ImageEmbedding = \"imageEmbedding\",\n Both = \"both\"\n}\n\nexport type ChatAppRequestOverrides = {\n retrieval_mode?: RetrievalMode;\n semantic_ranker?: boolean;\n semantic_captions?: boolean;\n exclude_category?: string;\n top?: number;\n temperature?: number;\n prompt_template?: string;\n prompt_template_prefix?: string;\n prompt_template_suffix?: string;\n suggest_followup_questions?: boolean;\n use_oid_security_filter?: boolean;\n use_groups_security_filter?: boolean;\n use_gpt4v?: boolean;\n gpt4v_input?: GPT4VInput;\n vector_fields: VectorFieldOptions[];\n};\n\nexport type ResponseMessage = {\n content: string;\n role: string;\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 ResponseContext = {\n data_points: string[];\n followup_questions: string[] | null;\n thoughts: Thoughts[];\n};\n\nexport type ResponseChoice = {\n index: number;\n message: ResponseMessage;\n context: ResponseContext;\n session_state: any;\n};\n\nexport type ChatAppResponseOrError = {\n choices?: ResponseChoice[];\n error?: string;\n};\n\nexport type ChatAppResponse = {\n choices: ResponseChoice[];\n};\n\nexport type ChatAppRequestContext = {\n overrides?: ChatAppRequestOverrides;\n};\n\nexport type ChatAppRequest = {\n messages: ResponseMessage[];\n context?: ChatAppRequestContext;\n stream?: boolean;\n session_state: any;\n};\n\nexport type Config = {\n showGPT4VOptions: boolean;\n showSemanticRankerOption: boolean;\n showVectorOption: boolean;\n};\n","import { renderToStaticMarkup } from \"react-dom/server\";\nimport { getCitationFilePath } from \"../../api\";\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 const path = getCitationFilePath(part);\n\n return renderToStaticMarkup(\n onCitationClicked(path)}>\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 { ChatAppResponse, getCitationFilePath } from \"../../api\";\nimport { parseAnswerToHtml } from \"./AnswerParser\";\nimport { AnswerIcon } from \"./AnswerIcon\";\n\ninterface Props {\n answer: ChatAppResponse;\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.choices[0].context.followup_questions;\n const messageContent = answer.choices[0].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.choices[0].context.thoughts?.length}\n />\n onSupportingContentClicked()}\n disabled={!answer.choices[0].context.data_points}\n />\n
\n
\n
\n\n \n
\n
\n\n {!!parsedAnswer.citations.length && (\n \n \n Citations:\n {parsedAnswer.citations.map((x, i) => {\n const path = getCitationFilePath(x);\n return (\n onCitationClicked(path)}>\n {`${++i}. ${x}`}\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 { useMsal } from \"@azure/msal-react\";\nimport { Stack, TextField } from \"@fluentui/react\";\nimport { Button, Tooltip, Field, Textarea } from \"@fluentui/react-components\";\nimport { Send28Filled } from \"@fluentui/react-icons\";\nimport { isLoggedIn, requireAccessControl } from \"../../authConfig\";\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 const { instance } = useMsal();\n const disableRequiredAccessControl = requireAccessControl && !isLoggedIn(instance);\n const sendQuestionDisabled = disabled || !question.trim() || disableRequiredAccessControl;\n\n if (disableRequiredAccessControl) {\n placeholder = \"Please login to continue...\";\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 \"What is included in my Northwind Health Plus plan that is not in standard?\",\n \"What happens in a performance review?\",\n \"What does a Product Manager do?\"\n];\n\nconst GPT4V_EXAMPLES: string[] = [\n \"Compare the impact of interest rates and GDP in financial markets.\",\n \"What is the expected trend for the S&P 500 index over the next five years? Compare it to the past S&P 500 performance\",\n \"Can you identify any correlation between oil prices and stock market trends?\"\n];\n\ninterface Props {\n onExampleClicked: (value: string) => void;\n useGPT4V?: boolean;\n}\n\nexport const ExampleList = ({ onExampleClicked, useGPT4V }: Props) => {\n return (\n
    \n {(useGPT4V ? GPT4V_EXAMPLES : 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","import DOMPurify from \"dompurify\";\n\ntype ParsedSupportingContentItem = {\n title: string;\n content: string;\n};\n\nexport function parseSupportingContentItem(item: string): ParsedSupportingContentItem {\n // Assumes the item starts with the file name followed by : and the content.\n // Example: \"sdp_corporate.pdf: this is the content that follows\".\n const parts = item.split(\": \");\n const title = parts[0];\n const content = DOMPurify.sanitize(parts.slice(1).join(\": \"));\n\n return {\n title,\n content\n };\n}\n","import { parseSupportingContentItem } from \"./SupportingContentParser\";\n\nimport styles from \"./SupportingContent.module.css\";\n\ninterface Props {\n supportingContent: string[] | { text: string[]; images?: { url: string }[] };\n}\n\nexport const SupportingContent = ({ supportingContent }: Props) => {\n const textItems = Array.isArray(supportingContent) ? supportingContent : supportingContent.text;\n const imageItems = !Array.isArray(supportingContent) ? supportingContent?.images : [];\n return (\n
    \n {textItems.map((c, ind) => {\n const parsed = parseSupportingContentItem(c);\n return (\n
  • \n

    {parsed.title}

    \n

    \n

  • \n );\n })}\n {imageItems?.map((img, ind) => {\n return ;\n })}\n
\n );\n};\n","export enum AnalysisPanelTabs {\n ThoughtProcessTab = \"thoughtProcess\",\n SupportingContentTab = \"supportingContent\",\n CitationTab = \"citation\"\n}\n","import { Stack } from \"@fluentui/react\";\nimport SyntaxHighlighter from \"react-syntax-highlighter\";\n\nimport styles from \"./AnalysisPanel.module.css\";\n\nimport { Thoughts } from \"../../api\";\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 { ChatAppResponse } from \"../../api\";\nimport { AnalysisPanelTabs } from \"./AnalysisPanelTabs\";\nimport { ThoughtProcess } from \"./ThoughtProcess\";\nimport { useMsal } from \"@azure/msal-react\";\nimport { getHeaders } from \"../../api\";\nimport { useLogin, getToken } from \"../../authConfig\";\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: ChatAppResponse;\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.choices[0].context.thoughts;\n const isDisabledSupportingContentTab: boolean = !answer.choices[0].context.data_points;\n const isDisabledCitationTab: boolean = !activeCitation;\n const [citation, setCitation] = useState(\"\");\n\n const client = useLogin ? useMsal().instance : undefined;\n\n const fetchCitation = async () => {\n const token = client ? await getToken(client) : undefined;\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 headers: getHeaders(token)\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 return (\n pivotItem && onActiveTabChanged(pivotItem.props.itemKey! as AnalysisPanelTabs)}\n >\n \n \n \n \n \n \n \n {activeCitation?.endsWith(\".png\") ? (\n \n ) : (\n