-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor messages #13
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ORM-1537 Stop answer button - fix
Currently, we only allow aborting the answer when the message is loading, not when it's updating. Therefore, if the answer is too long, we can't stop it ORM-1536 Quick actions fixes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🔥🔥🔥
) | ||
} | ||
|
||
if (this.interaction.response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do a earlier return here so we do not have everything wrapped in a If:
if(!this.interaction.reponse) {
return;
}
} | ||
}) | ||
|
||
console.log('latest state', latestState) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we leave it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for spotting 😺
Here are the key points covered in the PR:
regenerateLast
function provided by the orama client. We are currently not getting answers as an array of strings, so we always show the last regenerated answer.path
is not absolute, so we may want to pass abaseUrl
to make the link work.resultsMapping
) to display the correct fields.I also did some refactoring to the
chatContext
state, so it now only includes:I removed
messages
in favor ofinteractions
, and the status is now handled as a single interaction status (not a global one). This way, updating the UI according to the answer status (which. is what we mostly do) becomes simpler. The type of a single interaction is:Which is closer to the status we get from the server. These types should be imported by the client for consistency though