cosmicespresso / bot_or_not Goto Github PK
View Code? Open in Web Editor NEW2019 Mozilla Creative Awards: Truth or Dare with a π€or a π€·ββοΈ
2019 Mozilla Creative Awards: Truth or Dare with a π€or a π€·ββοΈ
seems to be a gRPC issue. added a try-catch to wrap around the server call, but it's hard to test as this error very occasional, and nobody seems very sure what's causing it.
if you see it, lmk!
In the first Chat round, we currently expect the player to initiate conversation. This is to avoid the impression that the bot is somehow 'in control' of the interaction, but we run the risk that the interaction could be very slow/awkward to start if both parties remain silent.
Thus, perhaps building in a 4-8 second timeout window, after which the bot will initiate conversation might be a good way to handle the interaction. Unsure of the do's and dont's of this WRT the current react flow but happy to look at this later this week.
How this worked before:
When a new bot was configured before starting a round, if the bot was the 'truth challenge bot' (the one that challenges the player) then a function called chooseTruth
would be called. This would select a truth challenge from a list on the backend, and append it to the chat at the start of the round.
What happens now:
chooseTruth()
is getting called (twice, actually -- eek), but the bot appends nothing to the chat window, until the player says something.
I assume this is because botQueue
is now getting cleared at the start of each round.
What I assume needs to happen:
chooseTruth()
needs to get called after botQueue
is cleared. unsure why getting called twice though.
@Kallirroi does this seem right? lmk if there's anything I'm missing, happy to look into this this afternoon.
We're unlikely to want to do this so it's not really an issue per se, but wanted to check that this was expected behaviour!
59 seconds continues as normal
60 seconds loops back round to 0, then continues
61 seconds loops back round to 0, then continues
I reckon it's because of this line in Utils.js
:
var seconds = (Math.floor(time / 1000) % 60);
let context = this.state.currentBot.name === "truth_bot_answering" ? "truthChallenge" : "other"
Round 1: bot speaks first
Round 2: user speaks first
Round 3: bot speaks first (?) or random (?)
every so often the context doesn't set properly, need to figure out why
Just a sanity check about general architecture: right now App.js
holds the state for pretty much everything, and controls the events for everything too. The other components are just recyclable UI. Does that make sense?
I would ideally want to separate the functions that handle the messaging (in a separate function or encapsulate them in the Chat component itself) but worry it might break things, especially bc I'm not sure how the bot array exactly works.
What exactly does App.js need to hold as state, and feed it through the lifecycle methods?
Curious to hear thoughts :)
currently, if you spam the bot by typing too fast, the queued messages get stored and then append to the chat next round.
I tried just setting botQueue to [] each time the bot changes, but i think that the messages are getting stuck in the timeout in Chat.js. Have verified that in this instance the POST request delay isn't the issue (they're returning on average about 145ms), though we might also want to make sure that that isn't a problem for slower internet speeds...
so that the user thinks the other end is trying to come up with something
π€
^ This can't actually be done by DF directly, but I can add a programmable delay in the middleware
need error handling for occasional server snafu: perhaps local store of default fallbacks
we need to reset [messages] between rounds but not between AudioVis<-->Chat component transitions
some kind of gross JSON bug, need some error handling on this guy
{"errorType":"SyntaxError","errorMessage":"Unexpected end of JSON input","trace":["SyntaxError: Unexpected end of JSON input"," at JSON.parse ()"," at Runtime.exports.handler (/var/task/runSample.js:1:1204)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"," at runNextTicks (internal/process/task_queues.js:59:5)"," at processImmediate (internal/timers.js:412:9)"]}
bug you get by having unprocessed async responses after the app leaves the chat window. need some way to handle these
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.