writer
Estimated time to read: 38 minutes
Classes¶
CsvWriter¶
Defined in: packages/poml/writer.ts:1288
Extends¶
Extended by¶
Constructors¶
Constructor¶
new CsvWriter(
ir?,options?):CsvWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
MarkdownOptions
Returns¶
Inherited from¶
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protectedoptions:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
MarkdownWriter.createMappingNode
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1289
Parameters¶
tableHeadElements¶
Cheerio\<any>
tableBodyElements¶
Cheerio\<any>
tableElement¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Overrides¶
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
MarkdownWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:646
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Inherited from¶
MarkdownWriter.initializeOptions
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:664
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1333
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1030
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
Inherited from¶
MarkdownWriter.processMultipleTableRows
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:659
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
MarkdownWriter.raiseErrorAndReturnEmpty
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1174
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Inherited from¶
MarkdownWriter.writeElementTree
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1318
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Overrides¶
MarkdownWriter.writeElementTreeImpl
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
MarkdownWriter.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
MarkdownWriter.writeWithSourceMap
EnvironmentDispatcher¶
Defined in: packages/poml/writer.ts:564
Extends¶
Writer\<any>
Constructors¶
Constructor¶
new EnvironmentDispatcher(
ir?,options?):EnvironmentDispatcher
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
any
Returns¶
Inherited from¶
Writer<any>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protectedoptions:any
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Writer.tokenizerCache
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
Writer.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
Writer.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):any
Defined in: packages/poml/writer.ts:82
Parameters¶
options?¶
any
Returns¶
any
Inherited from¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
Writer.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:565
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
Writer.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeWithSourceMap
FreeWriter¶
Defined in: packages/poml/writer.ts:1655
Extends¶
Writer\<FreeOptions>
Constructors¶
Constructor¶
new FreeWriter(
ir?,options?):FreeWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
TruncateOptions
Returns¶
Inherited from¶
Writer<FreeOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protectedoptions:TruncateOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Writer.tokenizerCache
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
Writer.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
Writer.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):TruncateOptions
Defined in: packages/poml/writer.ts:1656
Parameters¶
options?¶
TruncateOptions
Returns¶
TruncateOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
Writer.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1696
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
Writer.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeWithSourceMap
HtmlWriter¶
Defined in: packages/poml/writer.ts:1195
Extends¶
Writer\<HtmlOptions>
Constructors¶
Constructor¶
new HtmlWriter(
ir?,options?):HtmlWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
HtmlOptions
Returns¶
Inherited from¶
Writer<HtmlOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protectedoptions:HtmlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Writer.tokenizerCache
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
Writer.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
Writer.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):HtmlOptions
Defined in: packages/poml/writer.ts:1198
Parameters¶
options?¶
HtmlOptions
Returns¶
HtmlOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
Writer.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1272
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
Writer.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeWithSourceMap
JsonWriter¶
Defined in: packages/poml/writer.ts:1515
Extends¶
SerializeWriter\<JsonOptions>
Constructors¶
Constructor¶
new JsonWriter(
ir?,options?):JsonWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
JsonOptions
Returns¶
Inherited from¶
SerializeWriter<JsonOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protectedoptions:JsonOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
SerializeWriter.tokenizerCache
Accessors¶
serializeLanguage¶
Get Signature¶
get serializeLanguage():
string
Defined in: packages/poml/writer.ts:1516
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
SerializeWriter.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
SerializeWriter.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):JsonOptions
Defined in: packages/poml/writer.ts:1520
Parameters¶
options?¶
JsonOptions
Returns¶
JsonOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1389
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1468
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1496
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1454
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1353
Parameters¶
element¶
Cheerio\<any>
text¶
string
type¶
string
Returns¶
any
Inherited from¶
SerializeWriter.parseText
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
SerializeWriter.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1526
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
SerializeWriter.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeWithSourceMap
MarkdownWriter¶
Defined in: packages/poml/writer.ts:645
Extends¶
Writer\<MarkdownOptions>
Extended by¶
Constructors¶
Constructor¶
new MarkdownWriter(
ir?,options?):MarkdownWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
MarkdownOptions
Returns¶
Inherited from¶
Writer<MarkdownOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protectedoptions:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Writer.tokenizerCache
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
Writer.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1056
Parameters¶
tableHeadElements¶
Cheerio\<any>
tableBodyElements¶
Cheerio\<any>
tableElement¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
Writer.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:646
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
Writer.initializeOptions
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:664
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1183
Returns¶
string
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1030
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:659
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
MarkdownBox
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
Writer.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1174
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1107
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
Writer.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeWithSourceMap
MultiMediaWriter¶
Defined in: packages/poml/writer.ts:1713
Extends¶
Writer\<MultiMediaOptions>
Constructors¶
Constructor¶
new MultiMediaWriter(
ir?,options?):MultiMediaWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
any
Returns¶
Inherited from¶
Writer<MultiMediaOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protectedoptions:any
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Writer.tokenizerCache
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
Writer.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
Writer.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):any
Defined in: packages/poml/writer.ts:1714
Parameters¶
options?¶
any
Returns¶
any
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
Writer.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1847
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeElementTrees()¶
writeElementTrees(
elements,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1830
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
Writer.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
Writer.writeWithSourceMap
TsvWriter¶
Defined in: packages/poml/writer.ts:1338
Extends¶
Constructors¶
Constructor¶
new TsvWriter(
ir?,options?):TsvWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
MarkdownOptions
Returns¶
Inherited from¶
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protectedoptions:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1289
Parameters¶
tableHeadElements¶
Cheerio\<any>
tableBodyElements¶
Cheerio\<any>
tableElement¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Inherited from¶
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:1339
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:664
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1343
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1030
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
Inherited from¶
CsvWriter.processMultipleTableRows
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:659
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
CsvWriter.raiseErrorAndReturnEmpty
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1174
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Inherited from¶
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1318
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Inherited from¶
CsvWriter.writeElementTreeImpl
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
CsvWriter.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
XmlWriter¶
Defined in: packages/poml/writer.ts:1574
Extends¶
SerializeWriter\<XmlOptions>
Constructors¶
Constructor¶
new XmlWriter(
ir?,options?):XmlWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
XmlOptions
Returns¶
Inherited from¶
SerializeWriter<XmlOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protectedoptions:XmlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
SerializeWriter.tokenizerCache
Accessors¶
serializeLanguage¶
Get Signature¶
get serializeLanguage():
string
Defined in: packages/poml/writer.ts:1575
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
SerializeWriter.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
SerializeWriter.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):XmlOptions
Defined in: packages/poml/writer.ts:1579
Parameters¶
options?¶
XmlOptions
Returns¶
XmlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1389
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1468
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1496
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1454
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1353
Parameters¶
element¶
Cheerio\<any>
text¶
string
type¶
string
Returns¶
any
Inherited from¶
SerializeWriter.parseText
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
SerializeWriter.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1636
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
SerializeWriter.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeWithSourceMap
YamlWriter¶
Defined in: packages/poml/writer.ts:1542
Extends¶
SerializeWriter\<YamlOptions>
Constructors¶
Constructor¶
new YamlWriter(
ir?,options?):YamlWriter
Defined in: packages/poml/writer.ts:75
Parameters¶
ir?¶
string
options?¶
YamlOptions
Returns¶
Inherited from¶
SerializeWriter<YamlOptions>.constructor
Properties¶
ir¶
protectedir:string=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protectedoptions:YamlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protectedtokenizerCache:object={}
Defined in: packages/poml/writer.ts:73
Index Signature¶
[model: string]: Tiktoken
Inherited from¶
SerializeWriter.tokenizerCache
Accessors¶
serializeLanguage¶
Get Signature¶
get serializeLanguage():
string
Defined in: packages/poml/writer.ts:1543
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:260
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:425
Transform a WriterResult into discrete source map segments.
The segments are ordered so that rich content can be reconstructed in the correct visual order while preserving multimedia positioning.
Parameters¶
result¶
WriterResult
Returns¶
SourceSegment[]
Inherited from¶
SerializeWriter.buildSourceMap
createMappingNode()¶
protectedcreateMappingNode(element,outputLength):MappingNode
Defined in: packages/poml/writer.ts:154
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:178
Add an offset to mapping nodes.
Parameters¶
mappings¶
MappingNode[]
Original mappings.
indent¶
number
The offset amount.
ignoreBefore¶
number
Ignore the mappings before this index.
Returns¶
MappingNode[]
- The new mappings.
Inherited from¶
SerializeWriter.indentMappings
indentMultiMedia()¶
protectedindentMultiMedia(multimedia,indent,ignoreBefore):PositionalContentMultiMedia[]
Defined in: packages/poml/writer.ts:188
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):YamlOptions
Defined in: packages/poml/writer.ts:1547
Parameters¶
options?¶
YamlOptions
Returns¶
YamlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1389
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1468
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1496
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1454
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1353
Parameters¶
element¶
Cheerio\<any>
text¶
string
type¶
string
Returns¶
any
Inherited from¶
SerializeWriter.parseText
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:201
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protectedreset(ir):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protectedtruncateText(text,charLimit?,tokenLimit?,options?):string
Defined in: packages/poml/writer.ts:90
Parameters¶
text¶
string
charLimit?¶
number
tokenLimit?¶
number
options?¶
TruncateOptions
Returns¶
string
Inherited from¶
SerializeWriter.truncateText
write()¶
write(
ir):RichContent
Defined in: packages/poml/writer.ts:241
Convert an IR string into RichContent without exposing mapping information.
The method delegates to writeWithSourceMap and then collapses the returned segments back into a single rich content value.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.write
writeElementTree()¶
writeElementTree(
element,$):WriterPartialResult
Defined in: packages/poml/writer.ts:1554
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:252
Convert an IR string into an array of speaker messages.
It internally uses writeMessagesWithSourceMap and removes the mapping information from each message.
Parameters¶
ir¶
string
Returns¶
Message[]
Inherited from¶
SerializeWriter.writeMessages
writeMessagesWithSourceMap()¶
writeMessagesWithSourceMap(
ir):SourceMapMessage[]
Defined in: packages/poml/writer.ts:378
Similar to writeWithSourceMap but groups the segments into speaker messages.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeMessagesWithSourceMap
writeWithSourceMap()¶
writeWithSourceMap(
ir):SourceMapRichContent[]
Defined in: packages/poml/writer.ts:362
Render the IR string and return detailed mapping for each produced content segment.
Each returned SourceMapRichContent describes the slice of the input IR that generated the piece of output.
Parameters¶
ir¶
string
Returns¶
Inherited from¶
SerializeWriter.writeWithSourceMap