86
Views
2
Comments
Solved
[Azure OpenAI Connector] How to get access to the response when using StreamingChatCompletion?
azure-openai-connector
Reactive icon
Forge asset by Platform Maintenance
Application Type
Reactive
Platform Version
11.21.0 (Build 39257)

I am trying to build a basic chat application using StreamingChatCompletion but I think I must be missing something: where can I access the response from the assistant?

As far as I can see the response is inserted into the DOM directly, it is never written to the variable associated with the widget you provide. 

However, in order to have a proper chat with the assistant, you should send the conversation for context, not just your latest prompt. So I need the responses from previous prompts.

Am I missing something?

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Hi Atalaia,

Long time, no see! :D

We've just uploaded a version where the response from the assistant is being sent in the OnEndCallback.

To get the answer from the assistant, you need to add a screen action that has an input parameter of type Text, something like this:

Then, you need to use a JS node before calling the StreamChatCompletion to output the callback function:

Use the output of the JS node to be the input parameter OnDoneCallback:

You'll be able to achieve something like this:

Please let me know if this works for you,

Cheers,

Bruno

2020-11-17 19-30-43
João Atalaia

Hi there, Bruno!

that worked perfectly, thanks 😊


Don't forget to update the description of the "OnDoneCallback" parameter to mention the new input required.

And while you're at it, for feature parity with the non-streaming action, you might as well add the ExtraInformation output to the callback as well 😁

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.