Add canSendMessage state & update ChatHeadless constructor #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
canSendMessage
state --true
when there's no message currently being process andfalse
otherwisegetNextMessage
andstreamNextMessage
from sending a call to API as another message is still being processedloading
state such that it's set to false as soon as the response starts instead of when a response is fully completedChatHeadless
constructor by grouping the params into aHeadlessConfig
interface.HeadlessConfig
. This way, future changes to headless's constructor -- such as adding new fields -- will not need code change in chat-headless-reactJ=CLIP-158
TEST=manual&auto
see the updated jest test passed
see that the expected behavior works in test-site (loading dots controlled by loading state and input enable/disable controlled by canSendMessage)