refactor(framework) Convert `Driver.pull_messages` to no-arg, returning a list
Issue
Description
Presently, users need to pass the msg_ids returned from driver.push_messages(msgs) to driver.pull_messages(msg_ids) in order to retrieve the response messages. In some cases, users may not want to keep track of msg_ids but still want to retrieve any response messages based on the messages that have been pushed.
Proposal
Explanation
Convert the message_ids arg in the Driver.pull_messages() method to an Optional[Iterable[str]] type. If no message_ids are provided, all message_ids that are stored on the Driver object are retrieved.
This simplifies the usage to:
@app.main()
def main(driver: Driver, context: Context) -> None:
# Get available nodes
driver.get_node_ids()
...
# Push messages
driver.push_messages(messages)
...
# Get replies
replies = driver.pull_messages() # `message_ids` no longer needs to be passed
for reply in replies:
# Do something
[!NOTE]
The user may still passmessage_idstodriver.pull_messages(). In this case, only the IDs that are stored in theDriverobject (during the call topush_messages) will be pulled.
Converting to draft, pending clarification of API usage.
Closing as this is stale.