added
v0.0.57 Support Passing Attachments between Bots
18 days ago by John Li
- Bots can now pass attachments to each other via
fp.stream_request
. To do this, call thepost_message_attachment function
, which continues to work like before, but will now also implicitly emit a file event to other server bots calling it. Calling bots will receive the file in theattachment
field of aPartialResponse
from the bot. - OpenAI tool calling improvement: the request will finish without making an extra unnecessary second call to the OpenAI bot if no tools are decided to be called. This saves cost to the user.
Protocol Changes:
- Add new file event to the protocol:
{
url: str,
name: str,
content_type: str,
inline_ref: Optional[str] = None,
}
- This event represents an attachment made by a bot. It is implicitly yielded when you call
post_message_attachment
, which continues to work like before.
fastapi_poe changes:
- Added
attachment
field toPartialResponse
object, which can contain file attachments from other bots.