Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add canSendMessage state & update ChatHeadless constructor #13

Merged
merged 3 commits into from
May 25, 2023

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented May 25, 2023

  • added canSendMessage state -- true when there's no message currently being process and false otherwise
    • when it's false, it will prevent getNextMessage and streamNextMessage from sending a call to API as another message is still being processed
  • updated loading state such that it's set to false as soon as the response starts instead of when a response is fully completed
  • updated ChatHeadless constructor by grouping the params into a HeadlessConfig interface.
    • in a separate PR, I will update chat-headless-react to use HeadlessConfig. This way, future changes to headless's constructor -- such as adding new fields -- will not need code change in chat-headless-react

J=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)

@yen-tt yen-tt requested a review from a team as a code owner May 25, 2023 18:25
@yen-tt yen-tt merged commit f1b0ad0 into main May 25, 2023
@yen-tt yen-tt deleted the dev/canSendMessage branch May 25, 2023 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants