Communicate bot responses using `PartialResponse`
mainWhen implementing a bot, yield fp.PartialResponse objects to communicate with Poe. Poe automatically concatenates the text fields.
Fields:
text(str): The next chunk of text to display. Note: This should be the next token/chunk, as Poe handles concatenation.data(Optional[dict[str, Any]]): Arbitrary JSON data, primarily used for OpenAI function calling.is_suggested_reply(bool): IfTrue, creates a suggested reply button with the provided text.is_replace_response(bool): IfTrue, clears previously displayed text and replaces it with this value.
# Inside a bot implementation
async def get_response(self, ...):
yield fp.PartialResponse(text="Hello")
yield fp.PartialResponse(text=" world!")
yield fp.PartialResponse(text=" How can I help?", is_suggested_reply=True)