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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protected
options:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
MarkdownWriter
.createMappingNode
handleTable()¶
protected
handleTable(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()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):MarkdownOptions
Defined in: packages/poml/writer.ts:686
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Inherited from¶
MarkdownWriter
.initializeOptions
makeBox()¶
protected
makeBox(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()¶
protected
markupLanguage():string
Defined in: packages/poml/writer.ts:1494
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protected
processMultipleTableRows(elements
,$
):StringTableRow
[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
StringTableRow
[]
Inherited from¶
MarkdownWriter
.processMultipleTableRows
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protected
raiseErrorAndReturnEmpty(message
,element
):MarkdownBox
Defined in: packages/poml/writer.ts:699
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
MarkdownBox
Inherited from¶
MarkdownWriter
.raiseErrorAndReturnEmpty
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
truncateText()¶
protected
truncateText(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()¶
protected
writeElementTreeImpl(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protected
options:any
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):any
Defined in: packages/poml/writer.ts:82
Parameters¶
options?¶
any
Returns¶
any
Inherited from¶
Writer.initializeOptions
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protected
options:TruncateOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):TruncateOptions
Defined in: packages/poml/writer.ts:1839
Parameters¶
options?¶
TruncateOptions
Returns¶
TruncateOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protected
options:HtmlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):HtmlOptions
Defined in: packages/poml/writer.ts:1335
Parameters¶
options?¶
HtmlOptions
Returns¶
HtmlOptions
Overrides¶
Writer.initializeOptions
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protected
options:JsonOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):JsonOptions
Defined in: packages/poml/writer.ts:1691
Parameters¶
options?¶
JsonOptions
Returns¶
JsonOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protected
parseAny(element
,$
,singleAsObject?
):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protected
parseEnv(element
,$
):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protected
parseGeneralElement(element
,$
):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protected
parseObject(element
,$
):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protected
parseText(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()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protected
options:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
handleTable()¶
protected
handleTable(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()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):MarkdownOptions
Defined in: packages/poml/writer.ts:686
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
Writer.initializeOptions
makeBox()¶
protected
makeBox(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()¶
protected
markupLanguage():string
Defined in: packages/poml/writer.ts:1320
Returns¶
string
processMultipleTableRows()¶
protected
processMultipleTableRows(elements
,$
):StringTableRow
[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
StringTableRow
[]
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
raiseErrorAndReturnEmpty()¶
protected
raiseErrorAndReturnEmpty(message
,element
):MarkdownBox
Defined in: packages/poml/writer.ts:699
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
MarkdownBox
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protected
truncateText(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()¶
protected
writeElementTreeImpl(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
Writer.ir
options¶
protected
options:any
Defined in: packages/poml/writer.ts:72
Inherited from¶
Writer.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
Writer.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):any
Defined in: packages/poml/writer.ts:1900
Parameters¶
options?¶
any
Returns¶
any
Overrides¶
Writer.initializeOptions
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
Writer.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
Writer.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
options¶
protected
options:MarkdownOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
handleTable()¶
protected
handleTable(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()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(multimedia
,indent
,ignoreBefore
):PositionalContentMultiMedia
[]
Defined in: packages/poml/writer.ts:201
Parameters¶
multimedia¶
PositionalContentMultiMedia
[]
indent¶
number
ignoreBefore¶
number
Returns¶
PositionalContentMultiMedia
[]
Inherited from¶
initializeOptions()¶
protected
initializeOptions(options?
):MarkdownOptions
Defined in: packages/poml/writer.ts:1500
Parameters¶
options?¶
MarkdownOptions
Returns¶
MarkdownOptions
Overrides¶
makeBox()¶
protected
makeBox(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()¶
protected
markupLanguage():string
Defined in: packages/poml/writer.ts:1504
Returns¶
string
Overrides¶
processMultipleTableRows()¶
protected
processMultipleTableRows(elements
,$
):StringTableRow
[]
Defined in: packages/poml/writer.ts:1090
Parameters¶
elements¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
StringTableRow
[]
Inherited from¶
CsvWriter
.processMultipleTableRows
raiseError()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
raiseErrorAndReturnEmpty()¶
protected
raiseErrorAndReturnEmpty(message
,element
):MarkdownBox
Defined in: packages/poml/writer.ts:699
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
MarkdownBox
Inherited from¶
CsvWriter
.raiseErrorAndReturnEmpty
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
truncateText()¶
protected
truncateText(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()¶
protected
writeElementTreeImpl(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protected
options:XmlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):XmlOptions
Defined in: packages/poml/writer.ts:1756
Parameters¶
options?¶
XmlOptions
Returns¶
XmlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protected
parseAny(element
,$
,singleAsObject?
):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protected
parseEnv(element
,$
):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protected
parseGeneralElement(element
,$
):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protected
parseObject(element
,$
):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protected
parseText(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()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protected
truncateText(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¶
protected
ir:string
=''
Defined in: packages/poml/writer.ts:71
Inherited from¶
SerializeWriter.ir
options¶
protected
options:YamlOptions
Defined in: packages/poml/writer.ts:72
Inherited from¶
SerializeWriter.options
tokenizerCache¶
protected
tokenizerCache: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()¶
protected
buildSourceMap(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()¶
protected
createMappingNode(element
,outputLength
):MappingNode
Defined in: packages/poml/writer.ts:159
Parameters¶
element¶
Cheerio
\<any
>
outputLength¶
number
Returns¶
MappingNode
Inherited from¶
SerializeWriter.createMappingNode
indentMappings()¶
protected
indentMappings(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()¶
protected
indentMultiMedia(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()¶
protected
initializeOptions(options?
):YamlOptions
Defined in: packages/poml/writer.ts:1721
Parameters¶
options?¶
YamlOptions
Returns¶
YamlOptions
Overrides¶
SerializeWriter.initializeOptions
parseAny()¶
protected
parseAny(element
,$
,singleAsObject?
):any
Defined in: packages/poml/writer.ts:1549
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
singleAsObject?¶
boolean
Returns¶
any
Inherited from¶
SerializeWriter.parseAny
parseEnv()¶
protected
parseEnv(element
,$
):any
Defined in: packages/poml/writer.ts:1639
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseEnv
parseGeneralElement()¶
protected
parseGeneralElement(element
,$
):any
Defined in: packages/poml/writer.ts:1667
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseGeneralElement
parseObject()¶
protected
parseObject(element
,$
):any
Defined in: packages/poml/writer.ts:1625
Parameters¶
element¶
Cheerio
\<any
>
$¶
CheerioAPI
Returns¶
any
Inherited from¶
SerializeWriter.parseObject
parseText()¶
protected
parseText(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()¶
protected
raiseError(message
,element
):WriterPartialResult
Defined in: packages/poml/writer.ts:214
Parameters¶
message¶
string
element¶
Cheerio
\<any
>
Returns¶
WriterPartialResult
Inherited from¶
SerializeWriter.raiseError
reset()¶
protected
reset(ir
):void
Defined in: packages/poml/writer.ts:86
Parameters¶
ir¶
string
Returns¶
void
Inherited from¶
SerializeWriter.reset
truncateText()¶
protected
truncateText(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