writer
Estimated time to read: 38 minutes
Classes¶
CsvWriter¶
Defined in: packages/poml/writer.ts:1443
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
MarkdownWriter.createMappingNode
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1444
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:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
MarkdownWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:686
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Inherited from¶
MarkdownWriter.initializeOptions
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:704
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1494
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
Inherited from¶
MarkdownWriter.processMultipleTableRows
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:699
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:259
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:1308
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Inherited from¶
MarkdownWriter.writeElementTree
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1473
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Overrides¶
MarkdownWriter.writeElementTreeImpl
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:598
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
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:214
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:259
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:599
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1838
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):TruncateOptions
Defined in: packages/poml/writer.ts:1839
Parameters¶
options?¶
TruncateOptions
Returns¶
TruncateOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
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:259
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:1879
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1332
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):HtmlOptions
Defined in: packages/poml/writer.ts:1335
Parameters¶
options?¶
HtmlOptions
Returns¶
HtmlOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
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:259
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:1424
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1686
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:1687
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):JsonOptions
Defined in: packages/poml/writer.ts:1691
Parameters¶
options?¶
JsonOptions
Returns¶
JsonOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1514
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:214
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:259
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:1697
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:685
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1119
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:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:686
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
Writer.initializeOptions
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:704
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1320
Returns¶
string
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:699
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:259
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:1308
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1173
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1899
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
Writer.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
Writer.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):any
Defined in: packages/poml/writer.ts:1900
Parameters¶
options?¶
any
Returns¶
any
Overrides¶
Writer.initializeOptions
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
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:259
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:2054
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
Writer.writeElementTree
writeElementTrees()¶
writeElementTrees(
elements,$):WriterPartialResult
Defined in: packages/poml/writer.ts:2034
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1499
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:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
handleTable()¶
protectedhandleTable(tableHeadElements,tableBodyElements,tableElement,$):MarkdownBox
Defined in: packages/poml/writer.ts:1444
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:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
initializeOptions()¶
protectedinitializeOptions(options?):MarkdownOptions
Defined in: packages/poml/writer.ts:1500
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
makeBox()¶
protectedmakeBox(text,layout,element):MarkdownBox
Defined in: packages/poml/writer.ts:704
Parameters¶
text¶
string | MarkdownBox
layout¶
"block" | "newline" | "inline"
element¶
Cheerio\<any>
Returns¶
MarkdownBox
Inherited from¶
markupLanguage()¶
protectedmarkupLanguage():string
Defined in: packages/poml/writer.ts:1504
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protectedprocessMultipleTableRows(elements,$):StringTableRow[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
StringTableRow[]
Inherited from¶
CsvWriter.processMultipleTableRows
raiseError()¶
protectedraiseError(message,element):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio\<any>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protectedraiseErrorAndReturnEmpty(message,element):MarkdownBox
Defined in: packages/poml/writer.ts:699
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:259
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:1308
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Inherited from¶
writeElementTreeImpl()¶
protectedwriteElementTreeImpl(element,$):MarkdownBox
Defined in: packages/poml/writer.ts:1473
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
MarkdownBox
Inherited from¶
CsvWriter.writeElementTreeImpl
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1751
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:1752
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):XmlOptions
Defined in: packages/poml/writer.ts:1756
Parameters¶
options?¶
XmlOptions
Returns¶
XmlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1514
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:214
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:259
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:1816
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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:1716
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:1717
Returns¶
string
Overrides¶
SerializeWriter.serializeLanguage
Methods¶
assignSpeakers()¶
assignSpeakers(
result,$):SpeakerNode[]
Defined in: packages/poml/writer.ts:278
Parameters¶
result¶
WriterPartialResult
$¶
CheerioAPI
Returns¶
SpeakerNode[]
Inherited from¶
SerializeWriter.assignSpeakers
buildSourceMap()¶
protectedbuildSourceMap(result):SourceSegment[]
Defined in: packages/poml/writer.ts:455
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:159
Parameters¶
element¶
Cheerio\<any>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protectedindentMappings(mappings,indent,ignoreBefore):MappingNode[]
Defined in: packages/poml/writer.ts:185
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:201
Parameters¶
multimedia¶
PositionalContentMultiMedia[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia[]
Inherited from¶
SerializeWriter.indentMultiMedia
initializeOptions()¶
protectedinitializeOptions(options?):YamlOptions
Defined in: packages/poml/writer.ts:1721
Parameters¶
options?¶
YamlOptions
Returns¶
YamlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protectedparseAny(element,$,singleAsObject?):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protectedparseEnv(element,$):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protectedparseGeneralElement(element,$):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protectedparseObject(element,$):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protectedparseText(element,text,type):any
Defined in: packages/poml/writer.ts:1514
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:214
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:259
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:1728
Parameters¶
element¶
Cheerio\<any>
$¶
CheerioAPI
Returns¶
WriterPartialResult
Overrides¶
SerializeWriter.writeElementTree
writeMessages()¶
writeMessages(
ir):Message[]
Defined in: packages/poml/writer.ts:270
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:406
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:390
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