Closed OAkyildiz closed 2 years ago
It appears I made a painful choice back in the day on the method signature (entity_value, entity_type). Because these are positional and untyped, reversing them would be a breaking change to the API, to be discovered at runtime and super opaque (even the boldest disclaimers in
We could add an additional method (register_entities) to try to fix this semantic, but the ordering would be inconsistent in an unpleasant way.
I'm happy to review a PR in this vein!
I simply put the for loop into the function. Not paralellized, (well, probably no need for that), no type check for string but the tests are passing. Also updated the respective @property
and added an example.
This hasn't seen any forward progress, and I'm not super to pursue it myself (as a small ergonomic change). @OAkyildiz if you have the time to wrap up your PR, please indicate as much, otherwise I'll be closing this on 9/17 as out of scope/stale for 1.0.0.
Thanks!
In the
IntentDeterminationEngine.register_entity(...)
registering intent in for loops in the user's code does not look pythonic and interacting that way with the API does not look refined to the end user.In the following pull request, the iteration of
entity_value
s is internalized the iteration in a simple manner. It is a minor change, the iteration can also be parallelized, but it can be applied to similar methods to avoid externalfor
loops from becoming the formal way of interacting with the API.