You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
in message.py under utils there is a get_text_parts() but no equivalent function for data e.g. get_data_parts()
Describe the solution you'd like
e.g.
defget_data_parts(parts: list[Part]) ->list[dict[str, Any]]:
"""Extracts dictionary data from all DataPart objects in a list of Parts. Args: parts: A list of `Part` objects from a message. Returns: A list of dictionaries containing the data from any `DataPart` objects found. """# This line is the key: it looks for DataPart and gets the .data attributereturn [part.root.dataforpartinpartsifisinstance(part.root, DataPart)]
Describe alternatives you've considered
obviously write an maintain my own function, but if the message structure changes best if it's part of the library.
Activity
feat: Add `get_data_parts()` and `get_file_parts()` helper methods (#312