Closed mikecvet closed 7 months ago
@mikecvet
Thank you for your pull request.
I was also thinking that it might be nice to have a simple text extractor function within MessagesResponseBody which returns something like a Result<String, Err> like body.content.text, which returns the text from either the SingleText or first MultipleBlock if it exists (and the number of ContentBlocks is 1).
That is a good idea!
I implemented clust::messages::Content::flatten_into_text()
along with your idea:
and add code for examples:
on the latest main branch.
If there seem to be no issues, I'm going to release it in v0.6.0.
That is a good idea!
I implemented
clust::messages::Content::flatten_into_text()
along with your idea
This looks great. Thanks!
Thank you, too!
Adds some code to the
create_a_message
example to demonstrate how to extract the actual response text from theMessagesResponseBody
and itsContent::MultipleBlock
content field.I was also thinking that it might be nice to have a simple text extractor function within
MessagesResponseBody
which returns something like aResult<String, Err>
like body.content.text, which returns the text from either theSingleText
or firstMultipleBlock
if it exists (and the number ofContentBlocks
is 1).What do you think?