|
Entropic 2.3.8
Local-first agentic inference engine
|
Streaming filter that removes <think> blocks from output. More...
#include <entropic/core/stream_think_filter.h>
Public Member Functions | |
| StreamThinkFilter (TokenCallback cb, void *ud) | |
| Construct with consumer callback. | |
| void | set_raw_callback (TokenCallback cb, void *ud) |
| Set optional raw callback (receives ALL tokens unfiltered). | |
| void | on_token (const char *chunk, size_t len) |
| Process a chunk of tokens. | |
| void | flush () |
| Flush any buffered partial tag content. | |
Streaming filter that removes <think> blocks from output.
Processes tokens character-by-character. Content inside <think>...</think> tags is suppressed from the consumer callback but always forwarded to the raw callback (if set).
Definition at line 36 of file stream_think_filter.h.
| entropic::StreamThinkFilter::StreamThinkFilter | ( | TokenCallback | cb, |
| void * | ud | ||
| ) |
Construct with consumer callback.
| cb | Consumer token callback (receives filtered output). |
| ud | Consumer user_data. |
| cb | Consumer callback. |
| ud | Consumer user_data. |
Definition at line 19 of file stream_think_filter.cpp.
| void entropic::StreamThinkFilter::flush | ( | ) |
Flush any buffered partial tag content.
Flush buffered partial tag and UTF-8 content.
Call at end of generation to ensure no content is lost in the tag accumulator.
Definition at line 160 of file stream_think_filter.cpp.
| void entropic::StreamThinkFilter::on_token | ( | const char * | chunk, |
| size_t | len | ||
| ) |
Process a chunk of tokens.
Process an incoming token through the think-tag filter.
| chunk | Token data. |
| len | Token byte length. |
| chunk | Token byte data. |
| len | Byte length of chunk. @utility |
Definition at line 146 of file stream_think_filter.cpp.
| void entropic::StreamThinkFilter::set_raw_callback | ( | TokenCallback | cb, |
| void * | ud | ||
| ) |
Set optional raw callback (receives ALL tokens unfiltered).
Set raw (unfiltered) callback.
| cb | Raw callback. |
| ud | Raw user_data. |
| cb | Raw callback. |
| ud | Raw user_data. |
Definition at line 29 of file stream_think_filter.cpp.