We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2f51c5 commit e002451Copy full SHA for e002451
articles/ai-services/openai/includes/use-your-data-javascript.md
@@ -68,14 +68,18 @@ async function main(){
68
],
69
},
70
});
71
+ let response = "";
72
for await (const event of events) {
73
for (const choice of event.choices) {
- const delta = choice.delta?.content;
74
- if (delta !== undefined) {
75
- console.log(`Chatbot: ${delta}`);
+ const newText = choice.delta?.content;
+ if (!!newText) {
76
+ response += newText;
77
+ // To see streaming results as they arrive, uncomment line below
78
+ // console.log(newText);
79
}
80
81
82
+ console.log(chatGptAnswer);
83
84
85
main().catch((err) => {
0 commit comments