UNPKG

langflow-chatbot

Version:

Add a Langflow-powered chatbot to your website.

26 lines (25 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PlaintextMessageParser = void 0; class PlaintextMessageParser { /** * For plaintext, parsing a chunk doesn't depend on prior content. * It simply returns the chunk itself. * @param chunk The current chunk of text from the stream. * @param rawAccumulatedContentBeforeThisChunk The raw, unparsed content accumulated before this chunk (ignored for plaintext). * @returns The chunk itself. */ parseChunk(chunk, rawAccumulatedContentBeforeThisChunk) { // Plaintext processing doesn't typically care about previous chunks for the current one. return chunk; } /** * For plaintext, parsing a complete message returns the message itself. * @param fullContent The complete raw string content. * @returns The same content, as it's treated as plain text. */ parseComplete(fullContent) { return fullContent; } } exports.PlaintextMessageParser = PlaintextMessageParser;