Prompt class
Top level prompt section.
- Extends
Remarks
Prompts are compositional such that they can be nested to create complex prompt hierarchies.
Constructors
Prompt(Prompt |
Creates a new 'Prompt' instance. |
Inherited Properties
required | If true the section is mandatory otherwise it can be safely dropped. |
sections | |
separator | |
tokens | The requested token budget for this section.
|
Constructor Details
Prompt(PromptSection[], number, boolean, string)
Creates a new 'Prompt' instance.
new Prompt(sections: PromptSection[], tokens?: number, required?: boolean, separator?: string)
Parameters
- sections
Sections to render.
- tokens
-
number
Optional. Sizing strategy for this section. Defaults to -1, 'auto'.
- required
-
boolean
Optional. Indicates if this section is required. Defaults to true
.
- separator
-
string
Optional. Separator to use between sections when rendering as text. Defaults to \n\n
.
Inherited Property Details
required
If true the section is mandatory otherwise it can be safely dropped.
required: boolean
Property Value
boolean
Inherited From LayoutEngine.required
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.
tokens: number
Property Value
number
Inherited From LayoutEngine.tokens