LayoutEngine class

Base layout engine that renders a set of auto, fixed, or proportional length sections.

Remarks

This class is used internally by the Prompt and GroupSection classes to render their sections.

Constructors

LayoutEngine(PromptSection[], number, boolean, string)

Properties

required

If true the section is mandatory otherwise it can be safely dropped.

sections
separator
tokens

The requested token budget for this section.

  • Values between 0.0 and 1.0 represent a percentage of the total budget and the section will be layed out proportionally to all other sections.
  • Values greater than 1.0 represent the max number of tokens the section should be allowed to consume.

Constructor Details

LayoutEngine(PromptSection[], number, boolean, string)

new LayoutEngine(sections: PromptSection[], tokens: number, required: boolean, separator: string)

Parameters

sections

PromptSection[]

List of sections to layout.

tokens

number

Sizing strategy for this section.

required

boolean

Indicates if this section is required.

separator

string

Separator to use between sections when rendering as text.

Property Details

required

If true the section is mandatory otherwise it can be safely dropped.

required: boolean

Property Value

boolean

sections

sections: PromptSection[]

Property Value

separator

separator: string

Property Value

string

tokens

The requested token budget for this section.

  • Values between 0.0 and 1.0 represent a percentage of the total budget and the section will be layed out proportionally to all other sections.
  • Values greater than 1.0 represent the max number of tokens the section should be allowed to consume.
tokens: number

Property Value

number