Skip to content

Commit

Permalink
feat: enhance message state update and add random command execution
Browse files Browse the repository at this point in the history
- Updated `updateMessagesStateEvent` function to set question and history messages state with a randomized command
- Replaced `loadingCircle` command with a dynamically selected random command for more varied UI responses
- Added console log for random command verification
  • Loading branch information
mollybeach committed Nov 12, 2024
1 parent 5fe0534 commit 42a64a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webapp/src/stores/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const threejsCanvasEvent = (command) => {
export const updateMessagesStateEvent = (question) => {
$question.set(question);
$historyMessages.set( [...$historyMessages.get(), createMessage("me") ]);
threejsCanvasEvent("loadingCircle");
// threejsCanvasEvent("loadingCircle");
const randomCommand = Object.keys(commandMap)[Math.floor(Math.random() * Object.keys(commandMap).length)];
console.log('Random Command:', randomCommand);
threejsCanvasEvent(randomCommand);
postAzureMLMessagesData(question, $historyMessages.get())
.then(response => {
$botResponse.set(response.answer);
Expand Down

0 comments on commit 42a64a1

Please sign in to comment.