-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Ability to choose probability of each response when using random responses #1016
Comments
I think that this feature is related with chooseResponse function, between lines 49~53. I did a draft just to try out a solution of how use the probability of each response could be implemented. But how this would work? Should an option be added at settings of each response to adjust this probability, which is enabled only when random response mode is activated? Also, the probability of all responses should sum up to 1 (100%), right? This seems a quite tricky, as more responses are added, all remaining responses probability are affected too. On other hand, without normalizing these scores, it might be confuse for user to handle it. Just trying to contribuite into the discussion. |
I think to get around the problem of having to make all the probabilities add up to 100 (which would be quite tricky to implement without a UI redesign) we could instead use weights, which would only be applied if the random response mode is chosen. You would specify a weight value for each response. That is, a response with a weight of 2 should appear twice as often as a response with a weight of 1. Therefore percentage could be (responseWeight / sumOfWeights). I think as far as how to specify it, whenever the random response mode is enabled, a new small box would appear on the dropdown next to each response that can be sent where you can type the weight. |
That is also what I aimed at the draft. Normalizing the values and then compare with random output. This code is badly made, as I did not have time to optimize it. But could you check if its propose fits what you thought? |
I'm not sure if many people would use this feature it seems quite specific. I could settle on adding this feature to the response settings: As per the implementation, I guess it would be simpler by adding weights to the responses like @maillouxc suggested:
Example: if we have two response, one weighted 1 (default) and the other 2, we would have this array: |
I do agree with the popularity signal, but how exactly does this works? Also, the array ideia is way simpler than the approach I thought at first. Nice call! =] |
It's a bit off topic, but to answer your question it's not an exact science. Usually I look at the issue upvotes (👍), and other activities like comments. But I also listen to the users feedback and support requests. For example, the recent CRUD endpoints weren't subject of an open issue, but this was the biggest misconception in support requests. Lots of people expected it to work like that. So, I decided it was important. It's also a good feature making Mockoon a more serious competitor. I add to that a bit of "this would make sense", "this is a quick win and could be interesting", "this is highly upvoted but would take a lot of time", etc. I hope this answers your request! I am also completely open to feedback, advice and help of any kind 😄 |
I have a need to simulate an error which occurs very infrequently. The random response feature is very useful, but I'd really like to be able to adjust the probability of each response.
The text was updated successfully, but these errors were encountered: