Closed
Description
Is this a new feature, an improvement, or a change to existing functionality?
Improvement
How would you describe the priority of this feature request
High
Please provide a clear description of problem this feature solves
How to correctly use the MessageMeta
, MultiMessage
and TensorMemory
classes is a common error I see from developers when making custom pipelines. The main issue seems to stem around which values to use for offset
, count
, mess_offset
and mess_count
when changing or creating new MultiMessage
classes.
Related to #674
Describe your ideal solution
We could improve the developer experience in a few ways:
- Better documentation in the developer guide
- We have few common scenarios that would be good to point out when creating a new
MultiMessage
object:- If using an existing
MessageMeta
:- In this scenario, you would want to copy the
mess_offset
andmess_count
from the incoming message'sMessageMeta
.
- In this scenario, you would want to copy the
- If creating a new
MessageMeta
at the same time:- In this scenario,
mess_offset = 0
andmess_count = MessageMeta.count
- In this scenario,
- If using an existing
TensorMemory
:- In this scenario, you would want to copy the
offset
andcount
from the incoming message'sTensorMemory
.
- In this scenario, you would want to copy the
- If creating a new
TensorMemory
at the same time:- In this scenario,
offset = 0
andcount = TensorMemory.count
- In this scenario,
- If using an existing
- We have few common scenarios that would be good to point out when creating a new
- Adding static functions with more overloads to create these classes for the developer in different scenarios
- One overload could be made for each of the above scenarios to remove the need for developers to manually set the values
- Adding assertions to the
MessageMeta
andMultiMessage
classes to check for common mistakes- For example, one common mistake is choosing
offest
andcount
options which are impossible. If theMessageMeta
class only has 100 rows, then the following must be trueMultiMessage.offset + MultiMessage.count <= MessageMeta.count
. Otherwise you can index past the last item in the meta.
- For example, one common mistake is choosing
Describe any alternatives you have considered
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- I have searched the open feature requests and have found no duplicates for this feature request
Metadata
Assignees
Labels
Type
Projects
Status
Done