#include <Pt/Mcp/ContentType.h>
Formats a tool result as MCP content. More...
Inherited by ImageContent, and TextContent.
Public Member Functions | |
| virtual ContentFormatter * | getFormatter () const =0 |
| Creates a new ContentFormatter for a result. More... | |
| virtual void | releaseFormatter (ContentFormatter *formatter) const =0 |
| Releases a ContentFormatter previously obtained from getFormatter(). More... | |
ContentType determines how a Decomposer result is serialized into an MCP content block (text, image, etc.). getFormatter() creates the ContentFormatter used to write the block; the caller drives it directly (beginFormat(), the Decomposer begin/advance protocol, finishFormat()) and releases it via releaseFormatter().
|
pure virtual |
The caller owns the returned ContentFormatter and must release it via releaseFormatter() once done with it, whether the format completed normally or was abandoned. The output stream is not known yet; it is passed to ContentFormatter::beginFormat().
Implemented in ImageContent, and TextContent.
|
pure virtual |
Deletes formatter; the caller must not use it afterward. Does not write anything - call formatter->finishFormat() first to complete the content block normally.
Implemented in ImageContent, and TextContent.