Skip to content

[FEA]: Improve developer experience with MessageMeta and MultiMessage classes #687

Closed
@mdemoret-nv

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:

  1. Better documentation in the developer guide
    1. We have few common scenarios that would be good to point out when creating a new MultiMessage object:
      1. If using an existing MessageMeta:
        1. In this scenario, you would want to copy the mess_offset and mess_count from the incoming message's MessageMeta.
      2. If creating a new MessageMeta at the same time:
        1. In this scenario, mess_offset = 0 and mess_count = MessageMeta.count
      3. If using an existing TensorMemory:
        1. In this scenario, you would want to copy the offset and count from the incoming message's TensorMemory.
      4. If creating a new TensorMemory at the same time:
        1. In this scenario, offset = 0 and count = TensorMemory.count
  2. Adding static functions with more overloads to create these classes for the developer in different scenarios
    1. One overload could be made for each of the above scenarios to remove the need for developers to manually set the values
  3. Adding assertions to the MessageMeta and MultiMessage classes to check for common mistakes
    1. For example, one common mistake is choosing offest and count options which are impossible. If the MessageMeta class only has 100 rows, then the following must be true MultiMessage.offset + MultiMessage.count <= MessageMeta.count. Otherwise you can index past the last item in the meta.

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

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions