p5-app-duckpan icon indicating copy to clipboard operation
p5-app-duckpan copied to clipboard

Allow for Instant Answers priorities

Open moollaza opened this issue 10 years ago • 3 comments

In the backend of DuckDuckGo we have relatively simple tiered system which allows us to prioritize certain instant answers, or force others to only trigger when nothing else does.

We should be able to do this in DuckPAN so users can make sure when priorities are assigned, the instant answers will behave the same way in production.

My initial thought is to allow lists of package_name's to be given as arguments to new options:

duckpan server --high My::IA --low This::IA That::IA

An alternative, which more closely represents how things happen in production, would be to have a file which specifies the list of IA's that should be loaded and organizes them by priority. We could simply allow for a file (YAML?) that specifes which are considered low, which are considered high:

low priority:
 - This::IA
 - That::IA

high priority:
  - My::IA

@mwmiller @killerfish -- any thoughts?

moollaza avatar Nov 18 '14 01:11 moollaza

I'd go for using YAML, writing options everytime would be a hassle, and we can leave it to the user to specifiy if they'd like to use it or not, through an option, perhaps.

killerfish avatar Nov 18 '14 08:11 killerfish

I think this should probably wait for the upcoming JSON metadata. I'm not even sure it's entirely the right answer, but that's a discussion for a different forum.

mwmiller avatar Nov 18 '14 08:11 mwmiller

@mwmiller I think replicating the actual backend organization (via JSON Metadata) would be really awesome, but is likely overkill?

I think the typical use case for this feature would be to give a single IA priority over a few others (just bumping the priority of your IA might be good enough?) to make sure it returns when the triggers collide

moollaza avatar Nov 18 '14 22:11 moollaza