You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,12 +94,6 @@ Note that the documents are uploaded automatically when deploying the sample to
94
94
-**Azure account**. If you're new to Azure, [get an Azure account for free](https://azure.microsoft.com/free) to get free Azure credits to get started. If you're a student, you can also get free credits with [Azure for Students](https://aka.ms/azureforstudents).
95
95
-**Azure subscription with access enabled for the Azure OpenAI service**. You can request access with [this form](https://aka.ms/oaiapply).
96
96
97
-
### Setup and configure Microsoft Entra ID
98
-
99
-
This sample is using Microsoft Entra ID for authentication. To set up Microsoft Entra ID, follow these steps:
100
-
101
-
TODO
102
-
103
97
#### Deploy the sample
104
98
105
99
1. Open a terminal and navigate to the root of the project.
"Based on the latest financial and current stock market value, can you generate a brief summary that provides insights into the current state of Microsoft? Retrieve the latest closing price of a stock using its ticker symbol.";
11
+
12
+
cancelQueryRef.addEventListener("click",()=>{
13
+
aborter.abort();
14
+
aborter=newAbortController();
15
+
cancelQueryRef.classList.add("hidden");
16
+
submitQueryRef.classList.remove("hidden");
17
+
loadingRef.classList.add("hidden");
18
+
});
19
+
20
+
submitQueryRef
21
+
.addEventListener("click",async(event)=>{
22
+
const{ value }=userQueryRef;
23
+
if(value){
24
+
25
+
loadingRef.classList.remove("hidden");
26
+
outputRef.classList.add("hidden");
27
+
cancelQueryRef.classList.remove("hidden");
28
+
submitQueryRef.classList.add("hidden");
29
+
30
+
conststream=awaitsubmitQuery(value);
31
+
loadingRef.classList.add("hidden");
32
+
33
+
outputRef.innerHTML="";
34
+
outputRef.classList.remove("hidden");
35
+
36
+
forawait(constchunkofstream){
37
+
if(aborter.signal.aborted)throwsignal.reason;
38
+
insertText(chunk)();
39
+
}
40
+
41
+
cancelQueryRef.classList.add("hidden");
42
+
submitQueryRef.classList.remove("hidden");
43
+
loadingRef.classList.add("hidden");
44
+
45
+
if(outputRef.innerHTML===""){
46
+
outputRef.innerHTML="Your Assistant could not fetch data. Please try again!"
47
+
}
48
+
}
49
+
});
50
+
51
+
constinsertText=chunk=>()=>{
52
+
constdelta=newTextDecoder().decode(chunk);
53
+
outputRef.innerHTML+=delta;
54
+
outputRef.scrollTop=outputRef.scrollHeight;// scroll to bottom
"Based on the latest financial and current stock market value, can you generate a brief summary that provides insights into the current state of Microsoft? Retrieve the latest closing price of a stock using its ticker symbol.";
23
-
24
-
document
25
-
.querySelector("#submitQueryRef")
26
-
.addEventListener("click",async(event)=>{
27
-
const{ value }=userQueryRef;
28
-
if(value){
29
-
outputRef.classList.remove("hidden");
30
-
outputRef.innerHTML="Your Financial Assistant is thinking...";
31
-
conststream=awaitsubmitQuery(value);
32
-
outputRef.innerHTML="";
33
-
forawait(constchunkofstream){
34
-
constdelta=newTextDecoder().decode(chunk);
35
-
outputRef.innerHTML+=delta;
36
-
outputRef.scrollTop=outputRef.scrollHeight;// scroll to bottom
0 commit comments