Skip to main content

Class: abstract BasePromptTemplate<TemplatesVar, Vars>

Extended by

Type Parameters

TemplatesVar extends readonly string[] = string[]

Vars extends readonly string[] = string[]

Constructors

new BasePromptTemplate()

protected new BasePromptTemplate<TemplatesVar, Vars>(options): BasePromptTemplate<TemplatesVar, Vars>

Parameters

options: BasePromptTemplateOptions<TemplatesVar, Vars>

Returns

BasePromptTemplate<TemplatesVar, Vars>

Defined in

packages/core/prompts/dist/index.d.ts:29

Properties

functionMappings

functionMappings: Partial<Record<TemplatesVar[number] | string & object, MappingFn<string[]>>>

Defined in

packages/core/prompts/dist/index.d.ts:28


metadata

metadata: Metadata

Defined in

packages/core/prompts/dist/index.d.ts:19


options

options: Partial<Record<TemplatesVar[number] | string & object, string>>

Defined in

packages/core/prompts/dist/index.d.ts:25


outputParser

outputParser: undefined | BaseOutputParser<any>

Defined in

packages/core/prompts/dist/index.d.ts:26


templateVarMappings

templateVarMappings: Partial<Record<string & object | Vars[number], TemplatesVar[number] | string & object>>

Defined in

packages/core/prompts/dist/index.d.ts:27


templateVars

templateVars: Set<string>

Set of template variables used in the prompt template. Used for type hints only. To get the list of template variables used in the prompt at run-time, use the vars method.

Defined in

packages/core/prompts/dist/index.d.ts:24

Accessors

template

Get Signature

get abstract template(): string

Returns

string

Defined in

packages/core/prompts/dist/index.d.ts:38

Methods

format()

abstract format(options?): string

Parameters

options?: Partial<Record<TemplatesVar[number] | string & object, string>>

Returns

string

Defined in

packages/core/prompts/dist/index.d.ts:36


formatMessages()

abstract formatMessages(options?): ChatMessage[]

Parameters

options?: Partial<Record<TemplatesVar[number] | string & object, string>>

Returns

ChatMessage[]

Defined in

packages/core/prompts/dist/index.d.ts:37


mapAllVars()

protected mapAllVars(options): Record<string, string>

Parameters

options: Record<TemplatesVar[number] | string & object, string>

Returns

Record<string, string>

Defined in

packages/core/prompts/dist/index.d.ts:34


mapFunctionVars()

protected mapFunctionVars(options): Record<TemplatesVar[number], string>

Parameters

options: Record<TemplatesVar[number] | string & object, string>

Returns

Record<TemplatesVar[number], string>

Defined in

packages/core/prompts/dist/index.d.ts:33


mapTemplateVars()

protected mapTemplateVars(options): object

Parameters

options: Record<TemplatesVar[number] | string & object, string>

Returns

object

Defined in

packages/core/prompts/dist/index.d.ts:30


partialFormat()

abstract partialFormat(options): BasePromptTemplate<TemplatesVar, Vars>

Parameters

options: Partial<Record<TemplatesVar[number] | string & object, string>>

Returns

BasePromptTemplate<TemplatesVar, Vars>

Defined in

packages/core/prompts/dist/index.d.ts:35